CMSC140 Programming Project

Fall 2018 CMSC 140 Programming Project 1

Concepts tested in this project

· To work with cout and cin objects

· To work with variables, constants and literals

· To work with string object

· To learn and use different data types

· To learn and follow programming style

· To learn and use basic arithmetic operators

· To learn and use output manipulators

Project Description

The Department plans to purchase a humanoid robot. The Chairman would like us to write a program to show a greeting script the robot can use later. Our first task is to use the following script to prototype the robot for presentation:

(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! 

Write a program that uses the script above as a guide without roles, i.e. robot computer and visitor human, to prototype robot greeting in C++. See example (i.e. Sample Screen Output) below.

Project Specifications

Input for this project:

  • 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

1. The program should declare and initialize (i.e. create and assign values for) variables/constants to hold (at least) the following data:

· Robot Name. Please hard-coded it as “Nao” or a name of your choice.

· Visitor Name. This will hold the user’s name.

· Age. This will hold a person’s or a pet’s age.

· Programmer Name. Please hard-coded it with your full name.

· Assignment Number. Please Hard-coded it with 1.

· Due Date. Please hard-coded it with the due date of this assignment.

2. The program should contain variables AND constants. Use above data items when composing the output of the program.

3. Use 30 days per month, 1 dog year = 7 human year, 1 gold fish year = 5 human year for calculation in the script.

1. The program should declare and initialize (i.e. create and assign values for) variables/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.

· Age. This variable will hold a person’s or a pet’s age.

· Programmer Name. This variable will hold the programmer name. Initialize the variable with your full name.

· Assignment Number. This variable will hold the assignment number. Initialize the variable with 1.

· Due Date. This variable will hold the due date. Initialize the variable with the due date of this assignment.

2. The program should contain variables AND constants, for example

string robot_name; or

string robotName; (camel notation)

3. Use above data items when composing the output of the program, for example

cout << “My name is “ << robot_name;

4. Use 30 days per month, 1 dog year = 7 human year, 1 gold fish year = 5 human year for calculation in the script, for example const int ONE_DOG_YEAR = 7; const int DAYS_PER_MONTH = 30;

Sample Screen Output:

cmsc 140 programming project image 1

NOTE : Be sure to check also

1. CMSC140 Common Project Submission Requirements (.docx)

2. CMSC140 Grading Rubric_CheckList-Project 1 (.xlsx)

Answer Detail

Get This Answer

Invite Tutor