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
PLACE YOUR NAME HER
#include
#include
using namespace std;
Function prototypes
void printDescription;
void computePaycheckfloat int, float& float&;
int main
float payRate;
float grossPay;
float netPay;
int hours;
cout setprecision 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;
computePaycheckpayRatehours,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 ;
Exercise : Are the parameters gross and net, in the modified calPaycheck func tion you created in Exercise above, pass by value or pass by reference?
Exercise : 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 : Run the program again using the data from Exercise 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
