Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The following program takes two numbers (pay rate & hours) and multiplies them t

ID: 3657629 • Letter: T

Question

The following program takes two numbers (pay rate & hours) and multiplies them to get gross pay. It then calculates net pay by subtracting 15% of the gross pay. Copy this code into your text editor. Follow the code and the comments to understand how the program works and fill in the appropriate code so the program performs as it should. #include #include using namespace std; //Function prototypes void printDescription(); float computeGrossPay(float, int); float computeNetPay(float); int main() { float payRate; float grossPay; float netPay; int hours; cout << setprecision(2) << fixed; cout << "Welcome to the Pay Roll Program" << endl; printDescription(); //Call to Description function cout << "Please input the pay per hour "; cin >> payRate; cout << endl << "Please input the number of hours worked "; cin >> hours; cout << endl << endl; grossPay = computeGrossPay(payRate, hours); // Fill in the code to display grossPay and to calculate // and display netPay cout << "We hope you enjoyed this program" << endl; return 0; } // ******************************************************************** // printDescription // // task: This function prints a program description // data in: none // data out: none // // ******************************************************************** void printDescription() //The function heading { cout << endl; cout << "************************************************" << endl << endl; cout << "This program takes two numbers (pay rate & hours)" << endl; cout << "and multiplies them to get gross pay " << endl; cout << "it then calculates net pay by subtracting 15%" << endl; cout << "************************************************" << endl << endl; } // ********************************************************************* // computeGrossPay // // task: This function takes rate and time and multiples them to // get gross pay. // data in: pay rate and time in hours worked // data out: the gross pay // // ******************************************************************** float computeGrossPay(float rate, int time) { // Fill in the code to find grosspay } // ********************************************************************* // computeNetPay // // task: This function takes the gross pay and reduces it by 15% // // data in: gross pay // data out: the net pay // // ******************************************************************** float computeNetPay(float gross) { // Fill in the code to compute netPay }

Explanation / Answer

#include #include using namespace std; //Function prototypes void printDescription(); float computeGrossPay(float, int); float computeNetPay(float); int main() { float payRate; float grossPay; float netPay; int hours; cout