Question: Write a console program: Code the program so that it displays the color of the item whose item number is entered by the user. All

Write a console program: Code the program so that it displays the color of the item whose item number is entered by the user. All the item numbers contain exactly five characters. Allitems are available in four colors: blue, green, red, white. The third character in the item number indicates the item's color, as follows: B or b = Blue G or g = Green R or r = Red W or w = White If the item number does not contain exactly five characters, or the third character is not one of the characters listed above, the program should display an appropriate message on the screen. The program should use a void function to check the item number to determine the color of the item, and the color should be given to the calling function by using a reference variable. Use an array to store the colors and corresponding characters.

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!