Question: User-Defined -Value-Returning Functions Q: Write C++ program to calculate the cost to a company for a proposed raise. The program prompts for the number of
User-Defined -Value-Returning Functions Q: Write C++ program to calculate the cost to a company for a proposed raise. The program prompts for the number of employees and each employee's salary, and then calculates the individual raise and the total cost of raises. Employees earning $25,000 or less will receive a 5% raise. Employees earning between $25,001 and $35,000 will receive a 4% raise. Employees earning $35,001 or greater will receive a 3% raise. Display each employee's raise and the total raises Note: use the following functions prototypes in your program. // user-defined function prototypes // the function getNumber returns an integer value entered by the user giving the number of employees int getNumber() //the function getSalary returns a float value entered by the user giving the employee's salary double getsalary(int empNumber); // the function calcRaise returns the raise calculated for the salary passed double calcRaiseldouble salary) /* the function totalRaises returns the new total of raises using the current total and current raise being processed double totalRaises(double raise, double total); The following is a copy of the screen results that might appear after running your program, depending on the data entered. The input entered by the user is shown in bold. Enter the number of employees: 7 Enter the salary for employee 1: 18600 Employee 1 receives a raise o 9530.0 Enter the salary for employee 2: 24685 Employee 2 receives a raise of $1234.25 Enter the salary for employee 3: 32000 Employee 3 receives a raise of $1280.00 Enter the salary for employee 4: 48000 taployse 4 zeceves aise o 6440.00 Enter the salary for employee 5: 21700 Employee 5 receives a raise of $1085.00 Enter the salary for employee 6: 19800 Employee 6 receives a raise of $990.00 Enter the salary for employee 7: 31500 Employee 7 receives a raise o $1260.00 The total cost of raises: $8219.25
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
