Question: C++ language fill in the blanks Part a #include #include using namespace std; /******************************************************************************* * Function prototype *******************************************************************************/ void computePaycheck( double , unsigned , double

C++ language fill in the blanks

Part a

#include

#include

using namespace std;

/*******************************************************************************

* Function prototype

*******************************************************************************/

void computePaycheck(double, unsigned, double&, double&, double = 0.15);

/*******************************************************************************

* Description:

* Starting point of the program. Asks the user to enter their pay rate

* and hours worked to calculate and display their paycheck.

*

* Input(s):

* N/A

*

* Output:

* An integer that signals the exit code to the operating system (OS)

*******************************************************************************/

int main() {

// variables

double payRate = 0.0, grossPay = 0.0, netPay = 0.0;

unsigned hours = 0;

// adjust the output to include two digits after the decimal point

cout << fixed << setprecision(2);

// TODO: prompt and store the pay rate

// TODO: prompt and store the hours worked

// TODO: call the function to compute the paycheck

// TODO: display the gross pay and net pay

// terminate

return 0;

}

Part b

#include

using namespace std;

/*******************************************************************************

* Function prototypes

*******************************************************************************/

void readTemps(float[], const int);

float calcAverage(const float[], const int);

float calcHigh(const float[], const int);

float calcLow(const float[], const int);

/*******************************************************************************

* Description:

* Starting point of the program. Asks the user to select the number of

* temperature recordings to save (cannot exceed `MAX_SIZE`). Calls the

* auxiliary functions and displays the results.

*

* Input(s):

* N/A

*

* Output:

* An integer that signals the exit code to the operating system (OS)

*******************************************************************************/

int main() {

// variables

const int MAX_SIZE = 50;

int actualSize = 0;

float tempArray[MAX_SIZE];

// validation loop

do {

cout << "Please input the number of temperatures to be read: ";

cin >> actualSize;

} while ((actualSize == 0) || (actualSize > MAX_SIZE));

// call the functions

readTemps(tempArray, actualSize);

cout << "The average temperature is " << calcAverage(tempArray, actualSize);

cout << " The highest temperature is " << calcHigh(tempArray, actualSize);

cout << " The lowest temperature is " << calcLow(tempArray, actualSize);

// terminate

return 0;

}

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!