Concepts tested in this project To work with cout and cin objects To work with variables, constants, and literals To work with string object Use of different data types To follow programming style Use of basic arithmetic operators Use of output manipulators (setw, fixed, setprecision) Project Description The Department plans to purchase a humanoid robot. The Chairman would like you to write a program to show a greeting script the robot can use later. Your first task is to use the following script to prototype the robot for presentation: **************** Robot Prototype Scripting ******************** Hello, welcome to Montgomery College! My name is Nao. May I have your name? john Smith Nice to have you with us today, john Smith! 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: 2 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. Let's play another game, john Smith. Give me a whole number. 4 Very well. Give me another whole number. 5 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. Project Specifications Input Visitor’s name An age Two numbers Output: The program should display the following data: Complete script described above Your name as the programmer Assignment/Project number Due date Processing Requirements The program should declare and initialize (i.e., create and assign values for) variables and constants to hold (at least) the following data: Robot Name. This variable will hold the Robot Name. Initialize the variable with “Nao” or a name of your choice. Visitor Name, this variable will hold the user’s name. This variable will hold a person’s or a pet’s age. A variable for Programmer’s Name. Initialize the variable with your full name. A constant variable for Assignment Number. Initialize the variable with the value 1. A constant variable for Due Date. Initialize the variable with the due date of this assignment. Declare Constant variables for Days of Month. Initialize the variable with the value 30 Human Year. Initialize the variable with the value 1 Goldfish Year. Initialize the variable with the value 5 Dog’s age. Initialize the variable with the value 7 Examples how to declare constants: const int ONE_DOG_YEAR = 7; const int DAYS_PER_MONTH = 30; Examples how to declare and initialize variables: string programmer = "Kate Smiths" string dueDate = "09/06/21"; int projectNum = 1; double dogYear = 0; Use the following data for the computations in the program: 1 month = 30 days Dog’s age = 7 times human’s age, Goldfish age = 5 times human’s age Use the above variables when creating the output of the program, for example: cout << “My name is “ << robotName; Where robotName is a variable defined in your program. Your program should do all calculations using C++ expressions (Don’t use calculators for any calculations) Use C++ constants to store all permanent data. Test Plan Test your program with at least two more test cases. Use the given data as an example. Record your data for input and output in the following table. Make sure your tests cover all the possible scenarios. Test Case # Input Expected Output Actual Output Did the test pass? 1 2 4 5 24 720 17280 1036800 62208000 14 10 9 0 .8 2 3 4 Program design- Flowchart and Pseudocode for the Program due one week after project is given. An intermediate assignment will be created for submission. Flowchart/pseudo code can be submitted electronically in the following format: word document, pdf or handwritten flowchart/pseudo code picture saved as .jpg or png.
Concepts tested in this project
- To work with cout and cin objects
- To work with variables, constants, and literals
- To work with string object
- Use of different data types
- To follow
programming style - Use of basic arithmetic operators
- Use of output manipulators (setw, fixed, setprecision)
Project Description
The Department plans to purchase a humanoid robot. The Chairman would like you to write a program to show a greeting script the robot can use later. Your first task is to use the following script to prototype the robot for presentation:
**************** Robot Prototype Scripting ********************
Hello, welcome to Montgomery College! My name is Nao. May I have your name? john Smith Nice to have you with us today, john Smith! 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: 2
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.
Let's play another game, john Smith. Give me a whole number. 4 Very well. Give me another whole number. 5 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. |
Project Specifications
Input
- Visitor’s name
- An age
- Two numbers
Output: The program should display the following data:
- Complete script described above
- Your name as the programmer
- Assignment/Project number
- Due date
Processing Requirements
- The program should declare and initialize (i.e., create and assign values for) variables and constants to hold (at least) the following data:
- Robot Name. This variable will hold the Robot Name. Initialize the variable with “Nao” or a name of your choice.
- Visitor Name, this variable will hold the user’s name.
- This variable will hold a person’s or a pet’s age.
- A variable for Programmer’s Name. Initialize the variable with your full name.
- A constant variable for Assignment Number. Initialize the variable with the value 1.
- A constant variable for Due Date. Initialize the variable with the due date of this assignment.
- Declare Constant variables for
- Days of Month. Initialize the variable with the value 30
- Human Year. Initialize the variable with the value 1
- Goldfish Year. Initialize the variable with the value 5
- Dog’s age. Initialize the variable with the value 7
- Examples how to declare constants:
- const int ONE_DOG_YEAR = 7;
- const int DAYS_PER_MONTH = 30;
- Examples how to declare and initialize variables:
- string programmer = "Kate Smiths"
- string dueDate = "09/06/21";
- int projectNum = 1;
- double dogYear = 0;
- Use the following data for the computations in the program:
- 1 month = 30 days
- Dog’s age = 7 times human’s age,
- Goldfish age = 5 times human’s age
- Use the above variables when creating the output of the program, for example:
cout << “My name is “ << robotName;
Where robotName is a variable defined in your program.
- Your program should do all calculations using C++ expressions (Don’t use calculators for any calculations)
- Use C++ constants to store all permanent data.
Test Plan
Test your program with at least two more test cases. Use the given data as an example. Record your data for input and output in the following table. Make sure your tests cover all the possible scenarios.
Test Case # |
Input |
Expected Output
|
Actual Output
|
Did the test pass?
|
1 |
2 4 5
|
24 720 17280 1036800 62208000 14 10 9 0 .8
|
|
|
2 |
|
|
|
|
3 |
|
|
|
|
4 |
|
|
|
|
Program design- Flowchart and Pseudocode for the Program due one week after project is given. An intermediate assignment will be created for submission. Flowchart/pseudo code can be submitted electronically in the following format: word document, pdf or handwritten flowchart/pseudo code picture saved as .jpg or png.
Step by step
Solved in 3 steps with 6 images