Backgound
The employees can be any one of the two types: 1) Full-Time Salaried (FTS) and 2) Part-Time Hourly (PTH).
Currently, there are totally 1050 FTS employees and 274 PTH employees in a company.
The company plans to add up to 50 new employees
FTS employees are paid in a fixed amount per week irrespective of the number of hours they work.
FTS employees are paid a gross salary anywhere between $1000 to $1500 per week (after picking randomly the
salary should be fixed for an employee until a pay-hike).
FTS employee Take home salary would be 30% less owing to federal/state income taxes and other deductibles.
PTH employees are paid a gross wage of $35.25 per hour.
PTH employees’ incomes depend on the number of hours worked.
PTH employees work anywhere between 20 to 30 hours per week.
PTH employee Take home salary would be 20% less owing to federal/state income taxes.
Program
Create a data structure for employees that will store the following information for each employee:
• Full Name
• ID (IDs have a format 333-xxxx. Employee1 = 333-0000, employee2 = 333-0001 and so on.)
• Status: FTS or PTH
• Gross Salary per week (only for FTS employees)
• Wages per hour (only for PTH employees)
• Hours worked per week (only for PTH employees)
Notes: Type/number of data structures can be student’s personal choice
Remember: Allow space in your data-structure for adding new employees
Initialize the database: Fill random values for all the information for all the current employees (1050 FTS
employees and 274 PTH employees).
Your program in an infinite loop, should ask for the following choices
a) Add New Employee
Write a user-defined function that will process this choice
a. Ask for Name
b. Assign a random ID that has not been used yet. Two employees should NOT have the same
employee ID.
c. Ask for Status
d. If the Status is FTS, ask for Gross Salary
e. If the Status is PTH, ask for Wages per hour
f. ADD the new employee to the data-structure and provide confirmation
b) Delete Employee
Write a user-defined function that will process this choice
a. Ask for ID and delete the employee-entry
b. Provide confirmation that the entry is deleted
c. If not found, print “NOT FOUND”
c) Search and Display Employee Information
Write a user-defined function that will process this choice
a. Ask for ID and print all information
b. If not found, print “NOT FOUND”
c. If FTS employee, print gross_salary and take-home_salary
d. If PTH employee, print wages/hr, number_of_hours_worked_this_week (random), gross_salary
and take-home_salary
d) Update Employee Information
Write a user-defined function that will process this choice
a. Ask for ID (print NOT FOUND if the ID is not found)
b. Ask for WHAT do you want to update (Status or Pay-scale)
c. Ask for new Status: (updating the status of an employee)
i. Update the status of the specified employee
ii. Provide confirmation about status change
d. Ask for Pay Hike Percentage: (example: 2 means increasing salary or wages by 2%)
i. Increase the salary or wages of the specified employee by the specified percentage
ii. Provide confirmation (Display old salary or wages and new salary or wages)
e) FTS Employee Statistics
Write a user-defined function that will process this choice
a. List ALL FTS employees names and IDs
b. Print Average of the Salary/week
c. Print Standard Deviation of the Salary/week
f) PTH Employee Statistics
Write a user-defined function that will process this choice
a. List ALL PTH employees names and IDs
b. Print Average of the Hours_worked/week and Salary/week
c. Print Standard Deviation of the Hours_worked/week and Salary/week
g) QUIT the system
a. Quit the infinite loop
1 answer
http://www.jiskha.com/display.cgi?id=1290107746