You have been provided with the framework of a program, that contains the main along with the function calls for 4 funct

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

You have been provided with the framework of a program, that contains the main along with the function calls for 4 funct

Post by answerhappygod »

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 
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply