You are on page 1of 1

#Calculate tuition 3% increase for next 5 years and display

#declare variables
PERCENT_RATE = 0.03

tuition = 8000.00
tuitIncrease = 0.0
years = 5.0
counter = 1.0

print('\nThis program will calculate and display the 3% tuition increase for the
next 5 years.\nThe original cost of tuition is $8,000.\n')

while counter <= years:


if counter == 1:
#increase = 8,000 * 0.03
tuitIncrease = (tuition * PERCENT_RATE)
tuition = tuitIncrease + tuition
print('Year: 3% Increase: Tuition: ') #format display
print(f'{counter:8.0f}{tuitIncrease:18,.2f}{tuition:18,.2f}')
counter += 1
else:
tuitIncrease = (tuition * PERCENT_RATE)
tuition = tuitIncrease + tuition
print(f'{counter:8.0f}{tuitIncrease:18,.2f}{tuition:18,.2f}')
counter += 1

You might also like