When the user has pressed the 9 to exit print out a display


This program requires you to use a loop as well as the switch statement. You will display this menu on the screen.

(Press 9 to stop voting)

The Many Colors of M&M's Candy

  1. red
  2. blue
  3. brown
  4. yellow
  5. green
  6. purple

Vote on your favorite color by pressing the number before it.

In this program, you will keep track of the number of votes for each color of M&M's candy. The user will be able to vote until he/she types the sentinel character 9. Display the menu and ask the user to enter a number. Check the number entered against the numbers 1 - 2 - 3 - 4 - 5 - 6. If the number entered is 1, add one to the redctr. If the user has entered 2, add one to the bluectr, etc.

When the user has pressed the 9 to exit, print out a display telling how many votes each color received.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: When the user has pressed the 9 to exit print out a display
Reference No:- TGS02705989

Now Priced at $10 (50% Discount)

Recommended (97%)

Rated (4.9/5)