programming homework question i'm using the replit program to learn c++
For this Assignment you will attach ONE file, your program file (the .cpp file)
Write a program that will ask the user to input their name and birth year. Then, using the user’s inputs, you will calculate their current age and display it to the screen.
You will need to declare the following variables with the corresponding data types:
Variable Name
|
Data Type
|
Purpose
|
name
|
string
|
Stores the user’s inputted name
|
birthYear
|
int
|
Stores the user’s inputted birth year
|
currYear
|
int
|
Stores the hardcoded value for the current year
|
age
|
int
|
Stores the calculated age value
|
You must output the following title for your program and format your output as shown in the SAMPLE OUTPUT below.
PSEUDO-CODE
- Define variables for name, birthyear, currYear, and age.
- Assign value of currYear variable to “actual” current year (hardcode).
- Ask the user for their full name.
- Read in the input from the user.
- Ask the user for their birth year.
- Read in the input from the user.
- Calculate their age
- Output their name and age as shown in the Sample Output
CONSTRAINTS for the program:
•The program MUST be written as one main program (NO Functions).
• You can only use the following libraries &
• You must use: int main()
• No Arrays or Vectors
• The program MUST use integers and strings.
• The program must use local variables.
• Output must be formatted properly.
• Include a comment at the beginning of the program stating the purpose of the program,
your name, the date, and your class.
writing the program
checking the program
• Does the program input the user’s full name?
• Does the program use integers?