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
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