Computer Science, asked by helloeveryone2312200, 4 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 jai696
2

\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 amritamohanty918
1

Answer:

Use Python 3

def increment(salary):

def increment(salary):salaries = []

def increment(salary):salaries = []new_salary = salary

def increment(salary):salaries = []new_salary = salaryfor _ in range(5):

def increment(salary):salaries = []new_salary = salaryfor _ in range(5):new_salary *= 1.1

def increment(salary):salaries = []new_salary = salaryfor _ in range(5):new_salary *= 1.1salaries.append(round(new_salary, 2))

def increment(salary):salaries = []new_salary = salaryfor _ in range(5):new_salary *= 1.1salaries.append(round(new_salary, 2))return "\n".join([f"Year {idx + 1}: {salary}" for idx, salary in enumerate(salaries)])

def increment(salary):salaries = []new_salary = salaryfor _ in range(5):new_salary *= 1.1salaries.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