Problem specification Create a program that allows the user to enter a person's age (in years) and current salary. Both input items should be entered as integers. The program should display a person's total earnings before retirement at age 65, using annual raise rates of 3%, 4%, and 5%. Display the total earning bre amounts as integers.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 21PE
icon
Related questions
Question
Create a program that allows the user to enter a person's age (in years) and current salary. Both
Next, you plan the algorithm and then desk-check it. Figure 8-15 shows the completed IPO
algorithm contains two loops. The outer loop keeps track of the three annual raise rates (3%, 4%,
chart and desk-check table, which (for simplicity) uses an age of 62 and a salary of $25000. The
before retirement at age 65, using annual raise rates of 3%, 4%, and 5%. To calculate
then for the input. In this case, the program should display a person's total earnings
in Figure 8-15. You begin by analyzing the problem, looking first for the output and
In this lab, you will plan and create an algorithm for the problem specification shown
Frepure 8-15 Problem specification, IPO chart, and desk-check table for the retirement algorithm (continues)
and 5%). The nested loop keeps track of the number of years until retirement.
the amounts, the program will need to know the person's age and current salary.
The Car Depreciation Program
263
LAB 8-2 Plan and Create
Problem specification
t items should be entered as integers. The program should display a person's total earnings
tore retirement at age 65, using annual raise rates of 3%, 4%, and 5%. Display the total earning
amounts as integers.
Processing
Processing items:
raise rate (3%, 4%, 5%)
years until retirement
new salary
year (counter)
Output molni sdo 0
total earnings (at end of
each of the years until
retirement)
Input
age (1-64 years)
Current salary
10 Algorithm:
10.0 YT 1. enter the age
2. if (the age is less than 1 or greater than 64)
display reenter message
else
10.0- 0
enter current salary
calculate years until retirement = 65 - age
repeat for (each raise rate)
assign current salary to new salary
assign current salary to total earnings
repeat for (year 2 to years until retirement) ol
new salary = new salary * (1 + raise rate)
add new salary to total earnings
end repeat
display raise rate and total earnings
end repeat
end if
at this point, the
current salary is
year l's salary
What
is
8 folder.
oject/
Canent age
r of rows.
current salary
62
raise rate
years until retirement
25000
e
Cows.
05
.06
Transcribed Image Text:Create a program that allows the user to enter a person's age (in years) and current salary. Both Next, you plan the algorithm and then desk-check it. Figure 8-15 shows the completed IPO algorithm contains two loops. The outer loop keeps track of the three annual raise rates (3%, 4%, chart and desk-check table, which (for simplicity) uses an age of 62 and a salary of $25000. The before retirement at age 65, using annual raise rates of 3%, 4%, and 5%. To calculate then for the input. In this case, the program should display a person's total earnings in Figure 8-15. You begin by analyzing the problem, looking first for the output and In this lab, you will plan and create an algorithm for the problem specification shown Frepure 8-15 Problem specification, IPO chart, and desk-check table for the retirement algorithm (continues) and 5%). The nested loop keeps track of the number of years until retirement. the amounts, the program will need to know the person's age and current salary. The Car Depreciation Program 263 LAB 8-2 Plan and Create Problem specification t items should be entered as integers. The program should display a person's total earnings tore retirement at age 65, using annual raise rates of 3%, 4%, and 5%. Display the total earning amounts as integers. Processing Processing items: raise rate (3%, 4%, 5%) years until retirement new salary year (counter) Output molni sdo 0 total earnings (at end of each of the years until retirement) Input age (1-64 years) Current salary 10 Algorithm: 10.0 YT 1. enter the age 2. if (the age is less than 1 or greater than 64) display reenter message else 10.0- 0 enter current salary calculate years until retirement = 65 - age repeat for (each raise rate) assign current salary to new salary assign current salary to total earnings repeat for (year 2 to years until retirement) ol new salary = new salary * (1 + raise rate) add new salary to total earnings end repeat display raise rate and total earnings end repeat end if at this point, the current salary is year l's salary What is 8 folder. oject/ Canent age r of rows. current salary 62 raise rate years until retirement 25000 e Cows. 05 .06
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning