Question: please validate the following code because I need to get 3 5 8 5 2 . 7 8 at the 1 0 year when using

please validate the following code because I need to get 35852.78 at the 10 year when using startingSalary of 30000, numberYears 10, percentage 2% with this code using python
startingSalary = float(input("Enter starting salary:"))
numberYears = int(input("Enter number of years:"))
percentage = float(input("Enter the annual % increase:"))
base = percentage /100
for year in range(1, numberYears +1):
startingSalary *=(1+ base)
print(f"Year {year} : ${startingSalary:.2f}")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!