Question
Make a fully functioning program that correctly uses a list , reads and writes to an external file Megan owns a small neighborhood coffee shop,
Make a fully functioning program that correctly uses a list, reads and writes to an external file
Megan owns a small neighborhood coffee shop, and she has fifteen employees who work as baristas. All of the employees have the same hourly pay rate. Megan has asked you to design a program that will allow her to enter the number of hours worked by each employee and then display the amounts of all the employees' gross pay. You determine that the program should perform the following steps:
1.For each employee:
a.get the employee name from the file named employee_names.txt (attached in Blackboard)
b.get the number of hours worked from the employee
i.write a try/except statement to gracefully respond to a ValueError exception for hours
c.store in employee_names file - beside the corresponding employee name
d.read data from file and store hours worked in a list element.
2.For each list element: use the value stored in the element to calculate an employee's gross pay.
a.Display the amount of the gross pay.
b.Hourly rate $12.00
c.Overtime should be calculated at time and a half after 40 hours
list of employee's
George Thomas Melinda Harris Norah Jeddery Jorge Ortiz Samantha Gregory Tanvi Gupta William Edwards Tania Gomez Erica Sanders Gracie Lou Freebush Tony Montana Obi-Wan Kenobi Cruella De Vil Marty McFly Napoleon Dynamite
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started