Computer Science, asked by helloeveryone2312200, 3 months ago

6. Program to input salary of an employee and display the salary that the person will receive for each
of the next 5 years if he gets an increment of 10% every year.

python (in loop)
unnecessary answer will be report.​

Answers

Answered by valeriy69
5

\huge\red{\mid{\fbox{\tt{Using\: Python\: 3}}\mid}}

def increment(salary):

salaries = []

new_salary = salary

for _ in range(5):

new_salary *= 1.1

salaries.append(round(new_salary, 2))

return "\n".join([f"Year {idx + 1}: {salary}" for idx, salary in enumerate(salaries)])

print(increment((salary := float(input("salary: ")))))

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Answered by Japji21
4

Answer:

def increment(salary):

salaries = []

new_salary = salary

for _ in range(5):

new_salary *= 1.1

salaries.append(round(new_salary, 2))

return "\n".join([f"Year {idx + 1}: {salary}" for idx, salary in enumerate(salaries)])

print(increment((salary := float(input("salary: ")))))

Similar questions