Need Help With Bonus Rate Program

Dec 6, 2015 at 8:22am
jm sales
Last edited on Dec 6, 2015 at 4:40pm
Dec 6, 2015 at 8:25am
You forgot to ask a question. We don't do homework here, this is your homework not our. Ask a specific question and we'll help out.
Dec 6, 2015 at 8:36am
my question is my bonus rate=0 is giving me an error and i dont know why?
I'm stuck there and thats why I can' continue.
Last edited on Dec 6, 2015 at 8:36am
Dec 6, 2015 at 8:40am
You're trying to set bonusRate to zero, but there is no variable named bonusRate. You have to create the variable before you can use it.

Almost certainly, your compiler already told you this. Your compiler's error messages are extraordinarily useful.
Last edited on Dec 6, 2015 at 8:41am
Dec 6, 2015 at 8:48am
well I'm trying to write a function so that the user can enter the bonus rate. I just don't understand that part
Dec 6, 2015 at 8:51am
Here is how to create a variable. In this case, I'm going to create a variable named bonusRate, that is going to be an int.
int bonusRate;

Here is how to now set that variable to some value. I'm going to set it to 3 in this example.
bonusRate = 3;

And here is how to create it and immediately set it to a value.
int bonusRate = 3;
Dec 6, 2015 at 8:58am
Thank you Moschops. Will keep on trying.
Dec 6, 2015 at 9:23am
#include <iostream>
#include <iomanip>
#include <string>


}
Last edited on Dec 6, 2015 at 4:39pm
Dec 6, 2015 at 10:03am
Is there a question that goes with this?
Dec 6, 2015 at 6:08pm
Well that's odd. The original question seems to have vanished. Not to worry, I've got a copy here:

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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;

// Global Constant Variables
	const int EmployeeId = 5; // Number of Employees
	const int Months = 3;// Number of Months
						 
// Function Prototype

	void entersales(const string[], double[][Months]);
	double getbonusRate(void);
	void Table(const string[], const double[][Months], const double);
	
	int main()
	{
		// string stores Employee Identification Numbers  A123, B456, C789, D222, and E333	

		{
		const string EmployeeId[5]{ "A123","B456","C789","D222","E333" };
		};

		// Variables that will hold sales
		double sales[EmployeeId][Months] = {};

bonusRate = 0;

entersales(EmployeeId, sales);
stats(EmployeeId, sales, getbonusRate);

return 0;
	}
Dec 6, 2015 at 6:11pm
Not odd at all. Many people remove all their comments so non of their class mate or teachers find their thread. Or perhaps they have other motives.
Dec 6, 2015 at 6:23pm
Gosh, really. I never would have guessed.
Dec 6, 2015 at 6:50pm
yes my assignment is due tomorrow and since I posted my answer on the web it was to potentially stop any of my classmates from having access to my code. Not worried about my teacher since no one did my work for me.
Topic archived. No new replies allowed.