Question: Use a sentinel - controlled loop ( i . e . do not use a counting - type of loop ) . For each loop

Use a sentinel-controlled loop (i.e. do not use a counting-type of loop). For each loop iteration, the user should enter the item category (1,2 or 3). Choice: A value other than 1-3 should end the loop or, if ending your loop in another way, add a validation loop to ensure 1-3 is entered. In the loop iteration, after the successful category entry, have the user enter the item's cost.Ensure that the entered value is 0 or more (also use a validation loop). Keep a running total for the costs per category. After the items have all been entered (you're done looping), display the total cost for all items in each of the 3 categories. Finally, display which category (1,2 or 3) had the highest total.

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 Programming Questions!