Question: Write a program to prompt the user to enter a first name, last name, employee ID number, hours worked that week and hourly rate for
Write a program to prompt the user to enter a first name, last name, employee ID number, hours worked that week and hourly rate for 6 employees. Use a loop to accept the data detailed below. Save the records in a text file.
Name the file as YourFirstInitialYourLastName.
Write a second program that reads the records from your new text file, then for each employee, determines if the employee qualifies for overtime and calculates total pay. Display the records read from the file on screen with appropriate headings above the data being displayed. Save screenshot for submission.
If the hours are greater than 40, display 'Pay overtime' and calculated total pay with overtime.
If the hours are less than or equal to 40, display 'No overtime' and calculated total pay without overtime. Note: overtime is 1.5 times regular pay
Use the data as follows:
Name | ID | Hours | Hourly Payrate |
Priya Jones | 112245 | 50 | $19.00 |
Sam Wayne | 001326 | 24 | $14.50 |
Jennifer Kharel | 121378 | 40 | $21.25 |
Ayesha Oso | 043245 | 39 | $23.50 |
Amir Ngo | 212399 | 42 | $17.75 |
Mohammed James | 012345 | 31 | $22.00 |
Step by Step Solution
There are 3 Steps involved in it
Program 1 Program that reads data from user and writes to text file Opening file for writing fp open... View full answer
Get step-by-step solutions from verified subject matter experts
