Westonci.ca is the premier destination for reliable answers to your questions, brought to you by a community of experts. Our platform offers a seamless experience for finding reliable answers from a network of knowledgeable professionals. Discover detailed answers to your questions from a wide network of experts on our comprehensive Q&A platform.

In 2019, the tuition for a full time student is $7,180 per semester. The tuition will be going up for the next 7 years at a rate of 3.5% per year. Write your program using a loop that displays the projected semester tuition for the next 7 years. You may NOT hard code each years tuition into your program. Your program should calculate the tuition for each year given the starting tuition in 2019 ($7, 180) and the rate of increase (3.5%). You should then display the actual year (2020, 2021, through 2026) and the tuition amount per semester for that year

Sagot :

Answer:

In Python:

tuition = 7180

year = 2019

rate = 0.035

for i in range(2019,2027):

   print(str(year)+": "+str(round(tuition,2)))

   tuition = tuition * (1 + rate)

   year = year + 1

   

Explanation:

This initializes the tuition to 7180

tuition = 7180

This initializes the year to 2019

year = 2019

This initializes the rate to 3.5%

rate = 0.035

This iterates through years 2019 to 2026

for i in range(2019,2027):

This prints the year and tuition

   print(str(year)+": "+str(round(tuition,2)))

This calculates the tuition

   tuition = tuition * (1 + rate)

This increments year by 1

   year = year + 1