My code looks as follows-
Residency = (input("Type of residency? 'I' for In-state, 'O' for out of state, 'G' for Graduate: "))
In_State = 10000
Out_Of_State = 24000
Graduate = 40000
if Residency == 'I':
Tuition = In_State
elif Residency == 'O':
Tuition = Out_Of_State
elif Residency == 'G':
Tuition = Graduate
year_1 = float(Tuition * .03 + Tuition)
year_1_inc = float(Tuition * .03)
year_2 = float(year_1 * .03 + year_1)
year_2_inc = float(year_1 * .03)
year_3 = float(year_2 * .03 + year_2)
year_3_inc = float(year_2 * .03)
year_4 = float(year_3 *.03 + year_3)
year_4_inc = float(year_3 * .03)
year_5 = float(year_4 * .03 + year_4)
year_5_inc = float(year_4 * .03)
print('UNDERGRADUATE TUITION FOR THE NEXT FIVE YEARS')
print('ACADEMIC YEAR'," ",'TUITION'," ",'INCREASE')
print("-------------", " ","-------"," ","--------")
print ('2016-17' + ' ' + (format(year_1, '.2f')) + ' ' + (format(year_1_inc, '.2f')))
print ('2017-18' + ' ' + (format(year_2, '.2f')) + ' ' + (format(year_2_inc, '.2f')))
print ('2018-19' + ' ' + (format(year_3, '.2f')) + ' ' + (format(year_3_inc, '.2f')))
print ('2019-20' + ' ' + (format(year_4, '.2f')) + ' ' + (format(year_4_inc, '.2f')))
print ('2020-21' + ' ' + (format(year_5, '.2f')) + ' ' + (format(year_5_inc, '.2f')))
print ('TOTAL TUITION INCREASE' + ' ' + (format(year_1_inc + year_2_inc + year_3_inc + year_4_inc + year_5_inc, '.2f')))
This post has been edited by andrewsw: 07 March 2016 - 01:12 PM
Reason for edit:: fixed [code][/code] tags

New Topic/Question
Reply


MultiQuote


|