Answer:
The program is as follows:
def calctuit(pay,n,yrs):
if n == 0:
return
pay*=(1.025)
print("Year ",yrs,": ",pay)
calctuit(pay,n-1,yrs+1)
n = int(input("Years: "))
pay = float(input("Tuition: "))
yrs = 1
calctuit(pay,n,yrs)
Explanation:
The function begins here
def calctuit(pay,n,yrs):
This represents the base case
if n == 0:
return
This calculates the tuition for each year
pay*=(1.025)
This prints the tuition
print("Year ",yrs,": ",pay)
This calls the function again (i.e. recursively)
calctuit(pay,n-1,yrs+1)
The function ends here
This gets the number of years
n = int(input("Years: "))
This gets the tuition
pay = float(input("Tuition: "))
This initializes the years to 1
yrs = 1
This calls the function
calctuit(pay,n,yrs)