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.
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
Online 13,645 posts
since Feb 2002