[SOLVED] SOLVED:program uses a void function to check the item number to determine the color of the item,

10.00 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (1 vote)

Note: 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.Code the program so that it displays the color of the item whos item number is ***** by the user. All item numbers contain exactly five characters. All items are available in four colors:blue,green,red, and 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
For example, if the user enters 12b45, the program should display the word “Blue” on the screen. If the item number does not contain exactly five characters, or if the third character is not one of the characters listed above, the program should display an appropriate message on the screen

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.