Question: write a program using C++ Problem 3: (USE NESTED FOR LOOPS) WidgetsRUs needs a sales reporting system for quarterly sales (4 month summary). There are

write a program using C++

Problem 3: (USE NESTED FOR LOOPS) WidgetsRUs needs a sales reporting system for quarterly sales (4 month summary). There are multiple reps. The system will first ask for the number of reps. Use a loop to validate that there is at least 1 rep. Then prompt for the name and sales for each rep for 4 months of sales. You do NOT have to validate sales amounts, assume they are ALL VALID. Calculate and print the total sales for that rep along with monthly average. When all input is done, print the total sales of all reps and the average sale per rep. Note that you have to use getline to read a string with spaces but this is going to cause a strange problem that I wil explain on Thurs. So just input the name with no spaces and DO NOT USE GETLINE in order to get started. Sample output (Test case 1) How many sales reps? -2 Must be at least one sales rep, reenter: 2 Enter sales rep name: JohnSmith Month 1 sales for JohnSmith: 510.50 Month 2 sales for JohnSmith: 325.10 Month 3 sales for JohnSmith: 775 Month 4 sales for JohnSmith: 1000 Total sales for JohnSmith: $2610.60 Monthly average: 652.65 Enter sales rep name: AnnJones Month 1 sales for AnnJones: 665.25 Month 1 sales for AnnJones: 850 Month 1 sales for AnnJones: 1225.50 Month 1 sales for AnnJones: 585.10 Total sales for AnnJones: $3325.85 Monthly average: 831.47 Total sales from all reps: $5936.45 Average sales per rep: $2968.23 Test case 2: you create names. 3 sales reps Rep1 sales: 1250.10, 780.50, 375, 925 Rep2 sales: 790.10, 890, 1550.25, 1225 Rep3 sales: 1500, 1200, 775, 4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!