Webb15 sep. 2024 · Declare a constant named YEAR, and initialize YEAR with the value 2050. Edit the statement myNewAge = myCurrentAge + (2050 − currentYear) so it uses the … Webb15 sep. 2024 · Declare a constant named YEAR, and initialize YEAR with the value 2050. Edit the statement myNewAge = myCurrentAge + (2050 − currentYear) so it uses the constant named YEAR. Edit the statement cout << "I will be " << myNewAge << " in 2050." << endl; so it uses the constant named YEAR.#include using namespace std; int …
Declare a constant named YEAR, and initialize YEAR with the
Webb20 maj 2024 · In this lab, you declare and initialize constants in a C++ program. The program, which is saved in a file named NewAge2.cpp, calculates your age in the year 2050. Instructions Declare a constant named YEAR, and initialize YEAR with the value 2050. Edit the statement myNewAge = myCurrentAge + (2050 − currentYear) so it … Webb22 sep. 2024 · Correct answers: 3 question: Declare a constant named YEAR, and initialize YEAR with the value 2050. Edit the statement myNewAge = myCurrentAge + (2050 − currentYear) so it uses the constant named YEAR. Edit the statement cout << I will be << myNewAge << in 2050. << endl; so it uses the constant named YEAR.#include … mhr weapons ranked
Summary In this lab, you declare and initialize variables.
WebbInitialize this variable with the value of the current year. Use four digits for the year. Execute the program by clicking the Run button at the bottom of the screen. Sample program execution: My Current Age is 29. I will be 65 in 2050. Grading When you have completed your program, click the Submit button to record your score. my answer like that: WebbQuestion: Instructions Declare an integer variable named myNewAge. Declare and initialize an integer variable named myCurrentAge. Initialize this variable with your … Webb8 mars 2024 · Explanation: Line 4: Declare an integer variable named myNewAge.; Line 5: Declare and initialize an integer variable named myCurrentAge with a value of 29.; Line 6: Declare and initialize an integer variable named currentYear with the current year, 2024.; Line 8: Calculate the value of myNewAge by subtracting the difference between … mhr weapon sharpness