Question: I need help with C++ coding, its a basic code but I don't know how to write it. If I saw the answer I'd understand

I need help with C++ coding, its a basic code but I don't know how to write it. If I saw the answer I'd understand it alot better.

Class,

Create a C/C++ program that does the following tasks.

  1. Create a variable and assign your name to it.
  2. Create a variable named yearFutureand assign it the value 2040.
  3. Create a variable named currentYear and assign the current 4 digit year to it.
  4. Create a variable named myAge and assign your current age in years to this variable.
  5. Create a variable named ageInFuture.
  6. Compute your age in the yearFuture and assign it to the variable ageIn2040.
    1. myAge + ( year2040 - currentYear);
  7. Display the following output - using the variables in the program. ( 2040 should refer to a variable )

My Name is XXXXX XXXX and I will be ## in the year 2040.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!