Write a program to: Prompt the user for each employee’s id (an integer value) and the sales amount For each employee, display the commission earned Display the total commission earned by all the employees Display the average commission earned by an employee Display the employee id, the commission and the bonus paid to the employee with the highest commission
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
A company of 20 employees wants to find the employee who made the highest commission so he/she can be paid a 10% bonus of the commission he/she earned for that month.
The commission an employee makes is calculated by multiplying the sales amount by the commission rate. The commission rates are shown below:
Sales Amount | Commission |
---|---|
Less Than 40000 | No commission |
40000 to 80000 inclusive | 5% |
Greater than 80000 | 10% |
Write a program to:
- Prompt the user for each employee’s id (an integer value) and the sales amount
- For each employee, display the commission earned
- Display the total commission earned by all the employees
- Display the average commission earned by an employee
- Display the employee id, the commission and the bonus paid to the employee with the highest commission
Must be written in c++, no arrays to be used, only use iostream library
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images