204k views
2 votes
At one college, the tuition for a full-time student is $8,000 per semester. It has been announced that the tuition will increase by 3 percent each year for the next 5 years. Write a program with a loop that displays the projected semester tuition amount for the next 5 years. Your program's output must exactly match the output shown in the sample run below. Notice the wording of the messages and the placement of spaces and punctuation. Also, make sure that the tuition amounts are rounded to two decimal places.

Sample Run
In 1 year, the tuition wil1 be \$8240.0.
In 2 years, the tuition will be $8487.2.
In 3 years, the tuition wil1 be \$8741.816.
In 4 years, the tuition wil1 be \$9004.07048.
In 5 years, the tuition wi11 be \$9274.192594400001.

User Jumperchen
by
8.2k points

1 Answer

5 votes

Final answer:

A Python program is provided to calculate and display the projected college tuition costs over the next five years, accounting for a 3% annual increase.

Step-by-step explanation:

Understanding the continual rise of college expenses is critical for students planning their financial future. Yet, there's also a practical aspect to consider, which involves calculating how tuition fees will grow over time. This is where programming can be applied to create a useful tool for projecting future tuition costs.

Let's write a simple program using Python that encapsulates a loop to display the projected semester tuition amount for the next five years, accounting for a 3% yearly increase:

tuition = 8000
increase_rate = 0.03

for year in range(1, 6):
tuition *= (1 + increase_rate)
print(f"In {year} year{('s' if year != 1 else '')}, the tuition will be ${tuition:.2f}.")

Upon running this program, students will receive output that details their potential tuition expenses over the coming five-year period, helping to better prepare financially for the rising cost of education.

User CyberMJ
by
7.7k points