This preview shows page 1. Sign up to view the full content.
Unformatted text preview: Create a program that reads in a color and then using a SWITCH statement prints the ap-propriate label along with keeping track of the total number of each color. The robotic eye will recognize three cases for each color (i.e. For Red, robotic eye will recognize R, red or RED) so be sure to account for each case. Run the program for the following sequence of colors: R BLUE red yellow GREEN B B D RED Y ORANGE YELLOW blue R Y G Once you have completed the sequence, display the total of each of the 5 categories with an appropriate label (i.e. There were ? that were the color red) Hint: For each color you will need a variable that you set to zero before the sequence (i.e. N red = 0). As the sequence is input there should be code to increment each counter (i.e. N red = N red + 1;)...
View Full Document
This note was uploaded on 04/29/2009 for the course ASE 201 taught by Professor Hayes during the Spring '07 term at University of Texas at Austin.
- Spring '07