hey, I just started taking c++ and did the first couple projects ok but this one has me stumped. a large company pays salespeople on a commission basis. The salespeople each receive 200$ per week plus 9% of their gross sales for that week.
Make a program that uses a while statement to input each salespersons gross sale for the last week and calculates and displays that sales persons earnings process one salespersons figures at a time.
Sorry so long any help would be awesome. Thank you
A large company pays salespeople on a commision basis.
So you need to find out what they got from a sale. That's in the while loop. Perhaps,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#define SIZE /* max amount here */
// or
constint size = /* max amount here */;
// Array stores sales for the week, total sales for the week
int employeeOne_sales[SIZE], totalSales;
int i = 0; // Iterator
while (i++ < SIZE) { // While i < SIZE; then add 1 to i after using it (postfix increment)
std::cin << salesemployeeOne_sales[i]; // Get sales of the week
}
// Got input, now we can figure out his/her gross sale product
i = 0;
while (i++ < SIZE) { // While i < SIZE; then add 1 to i after using it (postfix increment)
sales += employeeOne_sales[i]; // Add the current
}