Please write your response in python At a certain college th

Please write your response in python.

At a certain college, the current tuition is as follows:

RESIDENCY ANNUAL TUITION

In-state undergraduate students $10,000 per year

Out-of-state undergraduate $24,000 per year

Professional graduate $40,000 per year

Tuition will be increased by 3% (0.03) every year for the next 5 years.

Write a Python program that will display a message to ask the user to input the type of residency. The program then reads the residency (I for in-state, O for out-of-state, and G for graduate). Based on the residency, the program will use the respective current tuition. The program will then enter a loop and calculate the new tuition for every year for five years. The program will display a table that looks as follows, formatting output amounts to 2 decimal places for amounts.

UNDERGRADUATE TUITION FOR THE NEXT FIVE YEARS ACADEMIC YEAR TUITION INCREASE

------------- ------------ --------

2016-17 10,300.00 300.00

2017-18 10,609.00 309.00

2018-19 10,927.27 318.27

2019-20 11,255.09 327.82

2020-21 11,592.74 337.65

TOTAL TUITION INCREASE 1,592.74

Solution

years = [\"2016-2017\",\"2017-2018\",\"2018-2019\",\"2019-2020\",\"2020,2021\"]
# define the function blocks
def InState():
inState = 10000
total = 0
for i in years:
percent = (3 % 100)*inState
total = total +percent
print(i, inState, percent)
inState = inState + percent
print(\"Total increased = \")
print(total)
  

def OutState():
outState = 24000
total = 0
for i in years:
percent = (3 % 100)*outState
total = total +percent
print(i, outState, percent)
outState = outState + percent
print(\"Total increased = \")
print(total)
  
def Professional():
professional = 40000
total = 0
for i in years:
percent = (3 % 100)*professional
total = total +percent
print(i, professional, percent)
professional = professional + percent
print(\"Total increased = \")
print(total)

#map the inputs to the function blocks
def start():
print(\"\ I:In State()\ O:Out Of State()\ P:Professional\")
num = raw_input(\"Enter type of residency:\\t\")
options[num]()

options = {
\"I\" : InState,
\"O\" : OutState,
\"P\" : Professional,   
}


start()

Please write your response in python. At a certain college, the current tuition is as follows: RESIDENCY ANNUAL TUITION In-state undergraduate students $10,000
Please write your response in python. At a certain college, the current tuition is as follows: RESIDENCY ANNUAL TUITION In-state undergraduate students $10,000

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site