Question: 1 Lab8-2.cpp displays a person's total 2 //earnings before retirement at age 65, 3 //using annual raise rates of 3%, 4%, and 5% 4 //Created/revised

 1 Lab8-2.cpp displays a person's total 2 //earnings before retirement atage 65, 3 //using annual raise rates of 3%, 4%, and 5%

1 Lab8-2.cpp displays a person's total 2 //earnings before retirement at age 65, 3 //using annual raise rates of 3%, 4%, and 5% 4 //Created/revised by kyour name> on 7 #include kiomanip 8 using namespace std; 10 int main O 11 1 12 int age 0; 13 int currentSalary 0; 14 int years ToRetire 2- 0; 15 double new Salary 0.0; 16 double total 0.0 17 18 cout fixed setprecisionCO) 19 20 cout "Current age in years C1 to 64): 21 Cin age 22 23 if age 1 I l age 64) 24 cout "Please enter an age from 1 to 64 endl; 25 else 26 cout "Current salary as a whole number 27 cin current Ssalary 28 29 cout end 30 31 years ToRetire 65 age 32 for (double rate 0.03; rate 0.06; rate 0.01) 33 newSalary current Salary //year 1 salary 34 35 total current Salary //year 1 salary for (int year 2; year years ToRetire year 1) 36 37 new Salary C1 rate); 38 39 total new Salary

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 Databases Questions!