Answer:
currentSalary = float(input("Enter the initial salary: $"))
raisePercent = float(input("Enter the annual % raise: "))
noOfYears = int(input("Enter the number of years: "))
print()
print("Year Salary")
print("-------------")
for k in range(1,noOfYears+1):
print(k,"\t",end="")
print("%.2f"%currentSalary)
currentSalary = currentSalary * (1+raisePercent /100)
Step-by-step explanation:
The Program is developed on Python.
In this program, we define three variables to take inputs-
1. currentSalary for taking the starting salary.
2. raisePercent - for taking the %age increase.
3. noOfYears- for taking the number of years for which we need to calculate the salary.
The Logic for Calculation of salary for given years with the raise %age-
using a Loop starting from 1 to the number of years we multiplying every time the
the %age raise in salary calculated as (1+ %age/100) to the current salary
to get the salary per year then displaying it corresponding to the loop variable.