Concept explainers
This project requires the use of the employees.dat file (supplied). The record format in the file is listed below (separated by a single space):
first_name last_name employee_id phone_number
Overview
You've been asked by your employer to create a employee registry program. The program will be used by the HR department to maintain employee records.
Requirements
When your program starts, it should read the employees.dat file into memory. A menu should be displayed like below.
1. List all employee details
2. List employee by last name
3. Add a new employee
4. Remove an employee
5. Show all managers only
6. Show all staff only
7. Quit
Each menu option should be handled by its own function. You should add utility functions as needed.
When option 1 is selected your program should lists all the information for each employee in a tabular format.
When option 2 is selected your program should prompt the user to enter an employee's last name. If the name entered can be found, your program should list all employee details for that employee. If the name cannot be found, your program should display a message stating so.
When option 3 is selected your program should prompt the user to enter the employee's first name, last name, employee Id, and phone number.
When option 4 is selected your program should allow the user to remove an employee by either last name or employee Id.
When option 5 is selected your program should display only managers. All managers have an Id that starts with the number 8.
When option 6 is selected your program should display only employees. All employees have an Id that starts with the number 1.
When option 7 is selected your program should update the employees.dat file and terminate.
Additional Requirements
· Your program must utilize a struct to hold all employee information and an array to hold all the structs.
· Your array should be able to hold any number of employees. The initial array should 1.5 the size of the initial list to allow for easier adding/removing. When the array is full, then it should increase to 1.5 times the size. You should not resize when data is removed.
· All input must be verified using "reasonableness" reasoning.
· You may not use
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps
- Menu option A -- Determine Hours to StudyThe program will READ in data from a text file named StudyHours.txt. The user corrects any bad data. The program updates the information in StudyHours.txt file. For example if the file contains a letter grade of K which is not a possible letter grade. You will create and submit a text file with a minimum of 5 additional records from example below. The file is named StudyHours.txt and contains the following format: first line full namesecond line number of creditsthird line grade desired for each class Example format StudyHours.txt fileAaron RODgers12ATom brady9Kphilip RiversapplecJoe Theismann15B The program determines the total weekly study hours (for all classes)All data must be displayed in proper case such as Wendy Payne, i.e. no names should be in all lower case or all upper case or a mix such as wendy or PaYNe. Use a function to convert to proper case.The program displays the student’s name, number of credits, expected total number of…arrow_forwardMenu option B -- Determine GradeThe program will READ in data from a text file named Grades.txt. The user corrects any bad data. The program updates the information in Grades.txt file. For example, if the file contains 55 credits which exceeds the max credits you can take during one semester. You will create and submit a text file with a minimum of 5 records in addition to the example below. The file is named Grades.txt and contains the following format: first line full namesecond line number of creditsthird line study hours Such asPatrick Mahomes1236DesHAun waTson9appledrew BrEeS5515JULIO JONES1545 The program determines the grade, assuming it’s the same grade for each classAll data must be displayed in proper case such as Wendy Payne, i.e. no names should be in all lower case or all upper case or a mix such as wendy or PaYNe. Use module(s) to convert to proper case.The program displays the student’s name, number of credits, total weekly study hours, and desired gradeThe information…arrow_forwardC Sharp Random Number File writer and Reader Create an application that writes a series of random numbers to a file. Each random number should be in the range of 1 through 100. The application should let the user specify how many randome numbers the file will hold and should use a SaveFileDialog control to let the user specify the file's name and Location. Create another application that uses an OpenFileDialog control to let the user select the file that was created above. This application should read the numbers from the file, display the numbers in a ListBox control and display: the total of the numbers and the number of random numbers read from the file.arrow_forward
- BAGGINS Trucking maintains a trip file in which each record contains the following data:DRIVER nameMILES driven on tripHOURS driven on trip Design an application that inputs records from the file (until reaching "eof") and, for each record, displays the DRIVER's name and the average Miles-per-Hours (MPH) for the trip where MPH is calculated by dividing the MILES by the HOURS. The program should also accumulate a GRAND total of the MILES driven. At the end, the program should display the GRAND total of the MILES driven. For example, if the trip file contained the following:Smith, 300, 5Williams, 750, 10Jones, 880, 11 then the program should display:Smith averaged 60 mphWilliams averaged 75 mphJones averaged 80 mphGrand total of miles is 1,930 Pseudocode:arrow_forwardprepare a flowchart please # inside data sub subarray[serial, name, amount]; # My data; data = [['01','A',4000],['02','B',8000],['03','C',10000],['04','D',12000],['05','E',16000]] serial = 0 name = 1 amount = 2 #update.... total = 0; for i in data: total = total+i[amount] print(f"The total amount is: {total}")arrow_forwardOpen the project or solution named mpg in this folder: ex_starts\ch07_ex1_mpg Review the code and run the program to refresh your memory on how it works. Notice that, unlike the program in this chapter, this program lets the user perform more than one calculation, it stores the values the user enters in a text file, and it displays the total miles, total gallons, and average miles per gallon when the program starts and after each entry. Add a function that calculates the miles per gallon Define a function named calculate_mpg() before the main() function that calculates the miles per gallon. This function should accept two double values for the miles and gallons, round the result to two decimal places, and return the result as a double type. Modify the code in the main() function so it uses the calculate_mpg() function. Note that the miles per gallon is calculated in three different places. Move the definition for the calculate_mpg() function after the main() function. When you run…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education