Question: / / This program takes two numbers ( payRate & hours ) / / and multiplies them to get grosspay. / / It then calculates

// This program takes two numbers (payRate & hours)
// and multiplies them to get grosspay.
// It then calculates net pay by subtracting 15
//PLACE YOUR NAME HER
#include
#include
using namespace std;
//Function prototypes
void printDescription();
void computePaycheck(float, int, float&, 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" << endl;
cin >> payRate;
cout << endl << "Please input the number of hours worked" << endl;
cin >> hours;
cout << endl << endl;
computePaycheck(payRate,hours,grossPay,netPay);
// Fill in the code to output grossPay
cout << "The gross pay is $"<< grossPay << endl;
cout << "The net pay is $"<< netPay << endl;
cout <<"We hope you enjoyed this program" << endl
return 0;
Exercise 3: Are the parameters gross and net, in the modified calPaycheck func- tion you created in Exercise 1 above, pass by value or pass by reference?
Exercise 4: Alter the program so that gross and net are printed in the function compute computePaycheck instead of in main(). The main() function executes the statement
cout <<"We hoped you enjoyed this program" << endl; after the return from the function calPaycheck.
Exercise 5: Run the program again using the data from Exercise 2. You should get the same results. All parameters should now be passed by value.

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 Programming Questions!