You have been provided with the framework of a program, that contains the main along with the function calls for 4 funct
Posted: Fri May 20, 2022 2:33 pm
You have been provided with the framework of a program, that
contains the main along with the function calls for 4 functions.
Fill in the rest of the code for the function
prototypes and function
definitions to complete the program: DO
NOT EDIT THE MAIN, only fill in the code for the
prototypes and definitions.
#include <iostream>
using namespace std;
//Comments
/*
* This program is to read in two employee salaries and determine
which salary
* is the higher one
* Finds the average of the two salaries
* Then output the two salaries, the larger one, and the average
of both salaries.
*/
//Function Prototypes
//readSalaries – A function to read in the two employee
salaries
//findLargest – A function to find the larger of the two
salaries
//findAverage - A function to find the average of the two
salaries
//printResults – A function to display the two employee
salaries, which is the larger salary and the average of both
salaries
int main ()
{
double salary1, salary2, maxSalary, averageSalary;
readSalaries (salary1, salary2);
maxSalary = findLargest (salary1, salary2);
averageSalary = FindAverage(salary1, salary2);
PrintResults (salary1, salary2, maxSalary,
averageSalary);
return 0;
}
//Function definitions
contains the main along with the function calls for 4 functions.
Fill in the rest of the code for the function
prototypes and function
definitions to complete the program: DO
NOT EDIT THE MAIN, only fill in the code for the
prototypes and definitions.
#include <iostream>
using namespace std;
//Comments
/*
* This program is to read in two employee salaries and determine
which salary
* is the higher one
* Finds the average of the two salaries
* Then output the two salaries, the larger one, and the average
of both salaries.
*/
//Function Prototypes
//readSalaries – A function to read in the two employee
salaries
//findLargest – A function to find the larger of the two
salaries
//findAverage - A function to find the average of the two
salaries
//printResults – A function to display the two employee
salaries, which is the larger salary and the average of both
salaries
int main ()
{
double salary1, salary2, maxSalary, averageSalary;
readSalaries (salary1, salary2);
maxSalary = findLargest (salary1, salary2);
averageSalary = FindAverage(salary1, salary2);
PrintResults (salary1, salary2, maxSalary,
averageSalary);
return 0;
}
//Function definitions