This is a C++ programming related question Consider the definition of the function main. int main() { double rate, hours, amount; . . . } Each of the functions described must have the appropriate parameters to access these variables. Write the following definitions: a. Write the definition of the function getHoursRate that prompts the user to input the hours worked and rate per hour to initialize the variables hours and rate of the function main. b. Write the definition of the value-returning function payCheck that calculatesand returns the amount to be paid to an employee based on the hours worked and rate per hour. The hours worked and rate per hour are stored in the variables hours and rate, respectively, of the function main. The formula for calculating the amount to be paid is as follows: For the first 40 hours, the rate is the given rate; for hours over 40, the rate is 1.5 times the given rate. c. Write the definition of the function printCheck that prints the hours worked, rate per hour, and the salary. d. Write the definition of a function main that tests each of these functions.
This is a C++
Consider the definition of the function main.
int main()
{
double rate, hours, amount;
.
.
.
}
Each of the functions described must have the appropriate parameters to access
these variables. Write the following definitions:
a. Write the definition of the function getHoursRate that prompts the user to input the hours worked and rate per hour to initialize the variables hours and rate of the function main.
b. Write the definition of the value-returning function payCheck that calculatesand returns the amount to be paid to an employee based on the hours worked and rate per hour. The hours worked and rate per hour are stored in the variables hours and rate, respectively, of the function main. The formula for calculating the amount to be paid is as follows: For the first 40 hours, the rate is the given rate; for hours over 40, the rate is 1.5 times the given rate.
c. Write the definition of the function printCheck that prints the hours
worked, rate per hour, and the salary.
d. Write the definition of a function main that tests each of these functions.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images