Question
Create a program that calculates and displays (to 2 places of decimal) the weekly gross pay of salaried employees, hourly employees, and temporary (temp) employees.
Create a program that calculates and displays (to 2 places of decimal) the weekly gross pay of salaried employees, hourly employees, and temporary (temp) employees. The weekly gross pay of a salaried employee is calculated by dividing the employees annual salary by 52. The weekly gross pay of an Hourly employee or a temporary employee is calculated by multiplying the number of hours worked by the pay rate. Create three separate functions (one each for the salaried employee, the hourly employee, and the temporary employees) as follows: For the Salaried employee function, prompt for two value (employee number and yearly salary), and pass them to the function. For the Hourly employee function, prompt for three values (employee number, hours worked and pay rate), and pass them to the function. For the temporary (temp) employee function, prompt for five values (project number, company number, employee number, hours worked and pay rate), and pass them to the function. Use a Default Argument to provide a default pay rate of $15.00 per hour if a value of $0 is supplied in response to the prompt for pay rate for a temp employee. Continue to request, calculate and display employee information until there is no more employee data to process. The information displayed must include the employees number and calculated weekly pay. Your program must be able to process zero employees, to an infinite number of employees. 2 Demonstrate the use of the following in your solution:
Iteration (Looping) Modularity (using functions)
Function Overloading (use overloaded functions for calculating Gross Pay)
Pass-by-Reference using Reference arguments (show, at least, one example of using Pass-by-Reference using Reference argument with each of the overloaded functions)
Default Arguments
Function Prototyping (create a function prototype for each of the overloaded functions)
Inter-function communication.
To demonstrate inter-function communication, all prompts for input must occur in the function main(), and all output must be displayed by the function main(). Your program, depending on the argument(s) supplied by the user, should invoke the appropriate overloaded function. Except for the number of weeks in a year (52), there must be no hardcoded input in your program. For this project, you are free to keep your entire solution in one file.
Please make sure your program work.
I figure it out.
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