Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 9 For Linux UNIX And Windows Advanced Database Administration Certification Certification Study Guide

Authors: Roger E. Sanders, Dwaine R Snow

1st Edition

1583470808, 978-1583470800

More Books

Students also viewed these Databases questions

Question

10. Identify two virtual worlds (other than Second Life).

Answered: 1 week ago

Question

10:16 AM Sun Jan 29 Answered: 1 week ago

Answered: 1 week ago