The company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who sells $5,000 worth of merchandise in a week receives $200 plus 9% of $5,000, or a total of $650. You’ve been supplied with a list of items that can be sold by a salesperson. The values of these items are as follows:
Item Value
1 239.99
2 129.75
3 99.95
4 350.89
Pseudocode for this problem might look like this:
initialize gross sales to zero
initialize the product count to zero
while product count is less than four
increment the product count
input the number of items sold
determine the cost per item based on the product count
calculate the product’s sales by multiplying the number of items sold
by the cost per item
add the product’s sales to gross sales
end while
calculate the salesperson’s earnings as $200 plus 9% of gross sales
output the salesperson’s earnings
Output might look like this:
Enter number sold of product #1: 3
Enter number sold of product #2: 0
Enter number sold of product #3: 150
Enter number sold of product #4: 10
Earnings this week: $1,929.92
Press any key to continue . . .