Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please include your source code including comments (3 points) and two screen-shots of program run-time (2 points). Imagine that you have an enormous bag of
Please include your source code including comments (3 points) and two screen-shots of program run-time (2 points). Imagine that you have an enormous bag of marbles, with each marble being one of seven colors: red, orange, yellow, green, blue, indigo, violet. You have been asked to count how many of each color marble there are in this bag. You couldn't possibly memorize and count the number of each color marble, and while you could take out each marble and tally its corresponding color on a sheet of paper, that would be rather time-consuming. So imagine that instead, you decide to utilize a C program that will do this for you. The program adds 1 to the amount of each color marble whenever the first letter of the marble's color is entered (i.e., you enter 'r' or 'R', it adds 1 to the number of red marbles) Construct such a program that would do this. Have it count the number of each color with the use of a switch statement, taking individual input values that represent the color of each marble, and allow the program to run until the user enters a specific value. Once that value is entered, have the program output the number of each marble
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started