Question: 1. Given the following C++ function header, compose a single C++ programming statement that calls the function, passing the value 16.0 as an argument, and

1. Given the following C++ function header, compose a single C++ programming statement that calls the function, passing the value 16.0 as an argument, and assigning its return value to a correctly typed variable named solution.

double timesTwo(double value)

2. Given the following C++ function header:

double harmonic(int a, int b = 7, int c = 9, int d = 11)

and the following function call:

double harmonicMean = harmonic(12, 34);

What will the value of the parameter variable named c be after the call is executed?

3. Compose a C++ function named timesNine. The function should accept an integer (int) argument. When the function is called, it should display the product of the argument multiplied times nine (9).

4. Compose a void C++ function named getSpeed that uses a reference parameter variable named speed to accept an integer argument. When called, the function should determine if the value of the parameter variable is in the range from 25 through 65. If the parameter variable is outside the range, set the parameter variable speed to -1. Otherwise, do nothing.

5. Given the following prototype statement for a function that determines the maximum value between two given integer values:

int maximum(int a, int b);

compose the prototype statement for an overloaded function that uses the same function name but determines the maximum value between two given double values.

6)

Paint Job Estimator

A painting company has determined that for every 135 square feet of wall space, one gallon of paint will be required. The company charges seven (7) hours of labor at $37.50 per hour for each whole gallon of paint that must be purchased. Write a C++ console program that asks the user to enter the square feet of wall space to be painted and the price of the paint per gallon.

NOTE: Whole gallons of paint must be purchased. If the calculated amount of paint that is needed to cover the wall is 2.5 gallons, your program will use 3 gallons to determine the cost of paint and labor.

Your program will include and use a function named estimate that is passed as arguments the number of whole gallons of paint required and the cost of the paint per gallon. This function will determine and display the following information:

The number of gallons of paint required.

The number of hours of labor required.

The cost of the paint.

The labor charges.

The total cost for the paint job.

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!