In: Computer Science
can someone please check the code below? Thank you
Hunterville College Tuition
Design a program for Hunterville College. The current tuition is $20,000 per year. Allow the user to enter the rate the tuition increases each year. Display the tuition each year for the next 10 years.
For the programming problem, create the pseudocode and enter it below.
Enter pseudocode here
start
Declarations
num tuition
num year
num TOTAL_YEARS = 10
num INCREASE_RATE
num CURR_TUTION = 20000
housekeeping()
detailLoop()
finish()
stop
housekeeping( )
output “Enter rate the tuition will increase each year>”, INCREASE_RATE
return
detailLoop()
while year <= TOTAL_YEARS
tuition = tuition * (1 + INCREASE_RATE)
output “In”, TOTAL_YEARS, “year(s) the tuition will be”, tuition
year = year + 1
endwhile
return
finish()
output “End of program”
return
I have highlighted the changes you need to make
Your code is correct but there are slight calculation
error.
start
Declarations
num tuition
num year
num TOTAL_YEARS = 10
num INCREASE_RATE
num CURR_TUTION = 20000
housekeeping()
detailLoop()
finish()
stop
housekeeping( )
output “Enter rate the tuition will increase each year>”, INCREASE_RATE
return
detailLoop()
while year <= TOTAL_YEARS
tuition = CURR_TUTION * ( 1 + INCREASE_RATE )
output “In”, year , “year(s) the tuition will be”, tuition
year = year + 1
CURR_TUTION = tution
endwhile
return
finish()
output “End of program”
return