Question: 1. Define a C function named computePay that calculates and returns the total weekly pay for an individual, This function has two input parameters, both

 1. Define a C function named computePay that calculates and returns

1. Define a C function named computePay that calculates and returns the total weekly pay for an individual, This function has two input parameters, both double: the total number of hours worked by the person tat call that h), and the base pay rate per hour (let's call that r). The total pay for the week is calculated as follows . If total hours h is less than O or more than 100, that is clearty a data entry error, and the function should return a value of 0.0 The individual is paid the base hourly rate, r, for each of the first 40 hours. The indlvidual is paid 1.5 times the base rate for all hours above 4o. - e the letter of an appropriate prototype statement for this function from the following possible choices: a. double computePay (hyr b. int computePay (h, r, pl c. void computePay (double h, double r d. int computePay (double a, double b, int c ) 2. Circl e.double computePay (double a, double b); 3. Write the C statements that could be added to the main function to declare two variables and assign to them the values of some number of hours worked and the base hourly pay rate for an individual. Call the computePay function, passing the variables as arguments. (Walk through your function code and make sure it works correctly for 42 hours and 25 hours, as well as a value that would be considered an error.)

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!