1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
The CS Department has purchased a (humanoid) robot recently. The Dept. Chair would like us to create a “Trivia” game as follow for the robot to display welcoming new users -
(Robot) Computer: Hello, welcome to Montgomery College! My name is Nao. May I have your name?
(Visitor) Human: Taylor
(Robot) Computer: Nice to have you with us today, Taylor! Let me impress you with a small game. Give me the age of an important person or a pet to you. Please give me only a number!
(Visitor) Human: 2
(Robot) Computer: You have entered 2. If this is for a person, the age can be expressed as 2 years or 24 months or about 720 days or about 17280 hours or about 1036800 minutes or about 62208000 seconds. If this is for a dog, it is 14 years old in human age. If this is for a gold fish, it is 10 years old in human age.
(Robot) Computer: Let’s play another game, Taylor. Give me a whole number.
(Visitor) Human: 4
(Robot) Computer: Very well. Give me another whole number.
(Visitor) Human: 5
(Robot) Computer: Using the operator ‘+’ in C++, the result of 4 + 5 is 9. Using the operator ‘/’, the result of 4 / 5 is 0; however, the result of 4.0 / 5.0 is about 0.8.
(Robot) Computer: Do you like the games, Taylor? If you do, you can learn more by taking our classes. If you don’t, I am sad. You should talk to our Chairman!
Description
Develop a C++ program, robotic software if you will, to implement the Trivia” game for the robot. See sample test run at the end of this document.
Project Specifications
• Input:
o Visitor’s name
o An age
o Two numbers
• Output
o Execute the Trivia game as described
o Specify the robot name of your choice (it’s your baby!)
o Your name as the Programmer
Processing Requirements
• Declare and initialize (i.e. create and assign values for) variables/constants to hold the followings (and other information if it makes sense):
o Robot Name – Variable to hold the robot name
o Visitor Name – Variable to hold the user’s name.
o Age – Variable to hold a person’s or a pet’s age.
o Programmer Name – Variable to hold the programmer name, your full name.
• Program should utilize include constants, such as –
o ONE_DOG_YEAR = 7;
o DAYS_PER_MONTH = 30;
o Gold fish year = 5 human year for calculation
|