Write a program to create a list of employees by storing their information in the following arrays:
empId: an array of integers to hold the employee numbers.
hours: an array of integers to hold each employee's hours worked.
payRate: an array of double to hold each employee's pay rate.
wages: an array of double to hold each employee's wage (payRate x hours).
The program should relate the data in each array through the subscripts. For example, the number in element 0 of the hours array should be the hours worked of the employee whose number is stored in element 0 of the empId array. Similarly with the other arrays. Create a constant for the array size to be used by all the arrays.
When the program is run, it first calls a function to display a menu as follows:
==================================================
Employee Payroll
1. Add employee
2. Update employee
3. Retrieve employee
4. List all
5. Quit the Program
Enter your choice:
======================================
There are 6 functions:
- showMenu: display the menu above.
- addEmployee: when 1 is selected, this function asks the user to enter the employee number, hours worked and pay rate. They are stored in their respective arrays. Keep track of the total number of employees entered (how many elements have values) to be used by the listEmployee function. After each input, ask the user if he/she wants to add more. If yes, make sure that the total number of inputs does not exceed the array size before proceeding to ask the user to enter again. If no, return to display the menu.
- updateEmployee: when 2 is selected, this function asks the user to enter the employee number. It searches for the number in the empId array. If found, display the number and ask the user to enter the hours worked and pay rate.
- retrieveEmployee: when 3 is selected, this function asks the user to enter the employee number. It searches for the number in the empId array. If found, display the number, hours worked, pay rate, and wage.
- listEmployee: when 4 is selected, this function traverses the arrays and displays each employee information (number, hours worked, pay rate, and wage). Make sure to display only the elements that have values. Do not use the whole array size if the arrays are not filled up. Make sure to format the output as shown below.
- searchList: this function performs a linear search on an integer array. It is called by updateEmployee and retrieveEmployee functions.
Input Validation: Accept only value between 1 and 5 for the menu choice. The hours worked must be positive. The pay rate must be at least 6.
The output and program details is in attached file.
Hello,
I am a software engineer student. Give the project to me, and it will be done in just a few hours.
P/S: I am new to freelancer.com, please give me a chance. Thank you!
Hello,
I'm a software engineer with 5 years experience in C/C++ programming and Java.
I'll prepare the code compiled, and tested in one day maximum.
Hope to get this job,
Best regards,
as a software engineer i can do this job for you. Award me this project to get fine result. it will take only 6 hours to do this work.... message me your full detail..