bonusRate
to zero, but there is no variable named bonusRate
. You have to create the variable before you can use it.bonusRate
, that is going to be an int
.int bonusRate;
bonusRate = 3;
int bonusRate = 3;
JM Sales employs 5 salespeople. The sales manager (i.e. the user) wants an application that allows him to enter the sales made by the salespeople during the months of January, February, and March, and the current bonus rate. The program should calculate each salesperson's total sales amount (i.e. the total sales for the 3 months), and bonus amount (total sales amount * current bonus rate). The program should also calculate the total bonus paid to all sales people. Display the total sales amounts, bonus amounts, and total bonus with 2 decimal places. The employee ids are the following: A123, B456, C789, D222, and E333. The employee ids of the salespeople MUST be stored in a one-dimensional array. The sales made by the salespeople during the months of January, February, and March MUST be stored in a two-dimensional array. The sales manager will provide the sales amounts. The arrays will contain related data! The program MUST implement the following functions: A function which accepts the 1-dimensional array of employe ids, and the 2-dimensional array of sales made by the salespeople. This function will ask the sales manager to enter the sales made by the salespeople, and then store them in the 2-dimensional array. The array of employee ids should be used to display the employee id of the salesperson to the sales manager (see the example below). Note: Assume the sales entered will be valid. A function which asks the sales manager to enter the current bonus rate. The bonus rate should be greater than .05 (5%). Use a loop to validate the bonus rate. This function should return the current bonus rate entered by the sales manager. A function which accepts the 1-dimensional array of employe ids, the 2-dimensional array of sales made by the salespeople, and the current bonus rate. The function should calculate the bonus amount of each sales person, and display their employee id, total sales amount (i.e. the total sales for the 3 months), and bonus amount. The function should also calculate and display the total bonus paid to all sales people.
|