Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

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...

1 answer below »

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

  1. Define variables for name, birthyear, currYear, and age.
    1. Assign value of currYear variable to “actual” current year (hardcode).
  2. Ask the user for their full name.
  3. Read in the input from the user.
  4. Ask the user for their birth year.
  5. Read in the input from the user.
  6. Calculate their age
  7. 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?

Answered Same Day Feb 01, 2022

Solution

Nithin answered on Feb 02 2022
105 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here