One large chemical company pays its salespeople on a commision basis.

The sales people receive $200 per week plus 9 percent of their gross sales for the week.

For example a sells person who sells $5000 worth of chemicals in a week receive $200 plus 9 percent of $5000, or a total of $650.

Develop a C++ program that uses a while structure to input each sales person's gross sales for last week and evaluate and display that salesperson's earning.

Process one saleperson's figure at a time..


CAN SOMEBODY HELP ME WITH DRAWING UP THIS PROGRAM

thank, peter:)

Well im not sure if I could write the program for you (sounds like hw ;)) but since you mention "draw" i can defiently help you "draw" up the program hehe.

First thing that comes to mind when you said draw is UML diagrams. This is a key role in Anaylasis and Design. So to apply such a thing to the above, instead of actually makign a diagram Im goign to give you some key advice on how to begin implmentation.

In the description you posted, all verbs such as "sells" and "recieve" will generally be implmented in methods or functions.

Now as for classes, each noun in your description should be a class, such as "sales person".

Hope that will help you get to coding, just by reading you description I can determien all the classes and methods you will need, good luck.

This seems like a homework problem. So lets think it out rationally. There's a large chemical company that pays people on commission. Okay, so that means that the employees are going to earn a portion of their sales. Now we read the sales people receive $200/week plus 9% of their gross sale. Well, calculating 9% is the same as multiplying gross sale by 0.09. And then we add that to $200/week to calculate the amount per salesperson.

So now it says use a while structure to input each salesperson's gross sales and calculate and display that salesperson's earnings. So we can use the following algorithm:

LOOP:
Ask for salesperson's gross sale
Calculate 9% of their gross sale and put it in a variable such as "wage"
Add 200 to the "wage" variable since all employees get at least that
Print out the "wage" variable
Loop again for the next salesperson

Remember, you're going to need some way to get the while loop to stop. For example, you can set it so that the while loop will loop so long as a value greater than 0 is entered for a gross sale. But if 0 or a negative value is entered, the loop stops and the program ends.

See if you can come up with some C++ code using this algorithm and then we'll be glad to help you more. However, we have a policy on these forums(and almost all other programming forums on the web) where we will HELP you with your homework but won't do it for you.

Hello:

I am new at C++ programming..Anyway I need to create a C++ Program that involves one large chemical company that pays its salepeople on a commission basis. The sale people receive $200 per week plus 9 per cent of their gross sale for that week. For example,a salesperson who sells $5000 worth of chemicals in a week receives $200 plus 9 percent of $5000, or a total of $650. Develop a C++ program that uses a while structure to imput each salesperson's gross sales last week and calculate and display that salesperson's earnings. Process one salesperson's figure at a time.

Can any help me..

REPLY FROM THE ADMINISTRATOR...........

This seems like a homework problem. So lets think it out rationally. There's a large chemical company that pays people on commission. Okay, so that means that the employees are going to earn a portion of their sales. Now we read the sales people receive $200/week plus 9% of their gross sale. Well, calculating 9% is the same as multiplying gross sale by 0.09. And then we add that to $200/week to calculate the amount per salesperson.

So now it says use a while structure to input each salesperson's gross sales and calculate and display that salesperson's earnings. So we can use the following algorithm:

LOOP:
Ask for salesperson's gross sale
Calculate 9% of their gross sale and put it in a variable such as "wage"
Add 200 to the "wage" variable since all employees get at least that
Print out the "wage" variable
Loop again for the next salesperson

Remember, you're going to need some way to get the while loop to stop. For example, you can set it so that the while loop will loop so long as a value greater than 0 is entered for a gross sale. But if 0 or a negative value is entered, the loop stops and the program ends.

See if you can come up with some C++ code using this algorithm and then we'll be glad to help you more. However, we have a policy on these forums(and almost all other programming forums on the web) where we will HELP you with your homework but won't do it for you.
__________________

AND SO I COME UP WITH THIS, DOES THIS LOOK ABOUT RIGHT ???
#include <iostream.h>
int main()
{
int numsales;

while
numsales !=1.0;

numccmmission =(numsales *0.09) +$200;
cout<< numcommission

enter num sales

return 0;//indicate that program ended successfully

} //end function main

Look to hear from you soon....
peter brown

Hello Peter,

Couple things that I see that need help on....

1. When you declare the variable (numsales), it is a good idea to initialize it manually before starting to use it. Some compilers may assign a goofy number to the new variable. So, after your init numsales; I would have a numsales = 0;

2. If you put the program into a compiler, and tried to compile it, the program would error. You are missing syntax... take a look at how the while is to be written. You also forgot to declare numcommission.

3. You tried to use numsales as an integer, but compare it to a real (1.0 is a real number). This is a problem. Reference the 1 as an integer. 1.

4. cin >> numsales is the proper way to enter in the variable.

5. Be careful on operator precidence. Let me explain.... if you do multiplication and addition:

(3 + 4) * 10 = 70
3 + 4 * 10 = 43
3 + (4 * 10) = 43

I would have written numcom = ((numsales * 0.09) + 200) note that the compiler will bomb out with the $200;

Also, I noticed you had very few comments. Teachers (and employers) really love comments. Put them into your code!

Take care,

Christian

Hello Peter,

Couple things that I see that need help on....

1. When you declare the variable (numsales), it is a good idea to initialize it manually before starting to use it. Some compilers may assign a goofy number to the new variable. So, after your init numsales; I would have a numsales = 0;

2. If you put the program into a compiler, and tried to compile it, the program would error. You are missing syntax... take a look at how the while is to be written. You also forgot to declare numcommission.

3. You tried to use numsales as an integer, but compare it to a real (1.0 is a real number). This is a problem. Reference the 1 as an integer. 1.

4. cin >> numsales is the proper way to enter in the variable.

5. Be careful on operator precidence. Let me explain.... if you do multiplication and addition:

(3 + 4) * 10 = 70
3 + 4 * 10 = 43
3 + (4 * 10) = 43

I would have written numcom = ((numsales * 0.09) + 200) note that the compiler will bomb out with the $200;

Also, I noticed you had very few comments. Teachers (and employers) really love comments. Put them into your code!

Take care,

Christian

Could you let me know how to programming this same problem
I have been working on this subject matter and keep coming up with problems? I did all the changes and still not compiling right.

This article has been dead for over six months. Start a new discussion instead.