Question: language is c++ and need to run it in code blocks. this all is one assignment not different. Lab : Payroll Please read the instructions

language is c++ and need to run it in code blocks. this all is one assignment not different.

Lab : Payroll

Please read the instructions carefully! The goal of this lab is to have you experiment with various combinations of functions, parameters and return values.

Lab a: no parameters, no return value: Write a procedure called payroll that takes no parameters and no return value. The procedure should be called by main() and payroll() should prompt the user for his/her hourly pay rate (a double) and the number of hours he/she worked (an integer). Display the information to the user.

language is c++ and need to run it in code blocks. this

Lab b: 2 parameters, no return value: Write a function called calcPay that takes 2 parameters the hourly rate and number of hours worked but has no return value. The function should be called by payroll(). The function should calculate the users gross pay given its parameters: gross pay is equivalent to hours * rate. Display the information to the user.

all is one assignment not different. Lab : Payroll Please read the

Lab c: 1 parameter, 1 return value: Write a function called taxRate that takes 1 parameters the gross pay and returns an integer between 0 and 100 representing the users tax rate. The function should be called by calcPay(). The function should use the following if-else to decide what the users tax rate is:

If gross pay

Else if the gross pay is

Else if the gross pay is

Else if the gross pay is

Else if the gross pay is

Else the tax rate is 35%.

Lab d: Update the code in calcPay() to call taxRate() and then to subtract out the tax from the users gross pay, i.e.:

pay = grossPay * (1 rateOfTax/100.0);

instructions carefully! The goal of this lab is to have you experiment

When you are done writing the program, write in the comments at the top of the code a definition for the term: parameter. Make sure everyone in the group can explain the difference between the terms argument and parameter.

cAuserslebowringidocumentslvisual studio 20101Projects Lab 51Debug Lab 5.exe Please enter your hourly pay rate $500 Please enter the number of hours you worked: 30 You worked 30 hours earning a rate of $500/hour Press any key to continue . - hourt you orked: 30

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!