Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON 3 only There are 6 employees. Write a program with nested loops, to ask the yearly salary of each employee for 5 years. Your

PYTHON 3 only

There are 6 employees. Write a program with nested loops, to ask the yearly salary of each employee for 5 years. Your program should keep track of the highest salary, lowest salary, and calculate the average salary of each employee. After you collect each employees data, display the highest salary, lowest salary, and average salary for that employee.

Hints: The outer loop is used to keep track of employees, and the inner loop is used to keep track of years for each employee of the outer loop.

In the test case below, please note that the employee count and year count keeps changing for input message and output messages

You can accomplish this by using an input and print statement like:

salary=input("Please enter employee "+ str(empcount) +" salary for year " + str( yearcount) + ": ")

print("Employee " + str(empcount) + " smallest salary is: $"+str(smallest) )

To calculate the average with decimal point, you can use statement like below.

avg=float(totalsal)/5

The above nstructions are examples. Of course, you must replace the variables with the variables used in your program.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions