Question: Complete the following C++ program by including the definition for the function named calcNetPay that returns weekly pay in currency format. The function has the

Complete the following C++ program by including the definition for the function named calcNetPay that returns weekly pay in currency format. The function has the formal parameter hours to pass the value of the number of hours worked in a week and the formal parameter rate to pass the value of the hourly rate.

*;Deductions:

o Assume a FIT rate of 10%

o Assume a SS tax rate of 6.2%

o Assume a Medicare tax rate of 1.45%

o Assume No deductions for Health or Dental

o Do not worry about adding an Overtime handling element to the function at this time.

*;Do indeed display the number in currency format ($ in front, and precision of 2 decimal places after the decimal)

*;Add 2 additional function calls to the program passing the following parameters in the main functions body (in a cout statement):

o hours: 25, rate: 7.95

o hours: 39, rate: 65.78

#include #include using namespace std;

double calcNetPay(double, double);// function prototype

int main ( ) {

double clockedHours = 32.5, hourlyRate = 55.25; cout << calcNetPay (clockedHours, hourlyRate) << endl; system("pause");

return 0;

}

double calcNetPay(double hours, double rate) { // complete the function definition //return the weekly pay number (variable) here return 0.0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!