In Python, how do I change my code to display the correct way.  The salaries should be floating point numbers and the salaries should be input in even hundreds.  For example, a salary of 69,030 should be entered as 69.0 and a salary of 58,510 should be input as 58.5 and a salary of 42,800 should be entered as 42.8. The display when the program is finished should be in a format that looks like this $69,000.     My display looks like this:    Enter employee name: Bob Enter Salaries: 69.0 Enter employee name: Mary Enter Salaries: 58.5 Enter employee name: Joe Enter Salaries: 42.8 Enter employee name:  Bob     $69 Mary        $58 Joe     $42 The average salary is: $56 The highest salary is: $69 The lowest salary is: $42   The display I need should look like this though:   Enter employee name: Bob Enter Salaries: 69.0 Enter employee name: Mary Enter Salaries: 58.5 Enter employee name: Joe Enter Salaries: 42.8 Enter employee name:  Bob     $69 Mary        $58 Joe     $42 The average salary is: $56000 The highest salary is: $69000 The lowest salary is: $42000     Code: employee_names=[] employees_salaries=[] while True:    employee_name=input("Enter employee name: ")    if employee_name =="":        break    Salaries=float(input("Enter Salaries: "))    employee_names.append(employee_name)    employees_salaries.append(int(Salaries)) for i in range(0,len(employee_names)):    print("{}\t\t${:,}".format(employee_names[i],employees_salaries[i])) average=int(sum(employees_salaries)/len(employees_salaries)) print("The average salary is: ${:,}".format(average)) highest=max(employees_salaries) print("The highest salary is: ${:,}".format(highest)) lowest=min(employees_salaries) print("The lowest salary is: ${:,}".format(lowest))

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

In Python, how do I change my code to display the correct way. 

The salaries should be floating point numbers and the salaries should be input in even hundreds.  For example, a salary of 69,030 should be entered as 69.0 and a salary of 58,510 should be input as 58.5 and a salary of 42,800 should be entered as 42.8. The display when the program is finished should be in a format that looks like this $69,000.

 

 

My display looks like this: 

 

Enter employee name: Bob
Enter Salaries: 69.0
Enter employee name: Mary
Enter Salaries: 58.5
Enter employee name: Joe
Enter Salaries: 42.8
Enter employee name: 
Bob     $69
Mary        $58
Joe     $42
The average salary is: $56
The highest salary is: $69
The lowest salary is: $42

 

The display I need should look like this though:

 

Enter employee name: Bob
Enter Salaries: 69.0
Enter employee name: Mary
Enter Salaries: 58.5
Enter employee name: Joe
Enter Salaries: 42.8
Enter employee name: 
Bob     $69
Mary        $58
Joe     $42
The average salary is: $56000
The highest salary is: $69000
The lowest salary is: $42000

 

 

Code:

employee_names=[]
employees_salaries=[]

while True:
   employee_name=input("Enter employee name: ")
   if employee_name =="":
       break
   Salaries=float(input("Enter Salaries: "))
   employee_names.append(employee_name)
   employees_salaries.append(int(Salaries))


for i in range(0,len(employee_names)):
   print("{}\t\t${:,}".format(employee_names[i],employees_salaries[i]))

average=int(sum(employees_salaries)/len(employees_salaries))
print("The average salary is: ${:,}".format(average))

highest=max(employees_salaries)
print("The highest salary is: ${:,}".format(highest))

lowest=min(employees_salaries)
print("The lowest salary is: ${:,}".format(lowest))

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY