Problem

If necessary, create a new project named Intermediate23 Project and save it in the Cpp7\...

If necessary, create a new project named Intermediate23 Project and save it in the Cpp7\Chap13 folder. Also create a new source file named Intermediate23.cpp. Write a program that displays the color of the item whose item number is entered by the user. All item numbers contain exactly seven characters. All items are available in four colors: blue, green, red, and white. The fourth character in the item number indicates the item’s color, as follows: a B or b indicates Blue, a G or g indicates Green, an R or r indicates Red, and a W or w indicates White. If the item number does not contain exactly seven characters, or if the fourth character is not one of the valid color characters, the program should display an appropriate message. Use a sentinel value to end the program. Save and then run the program. Test the program using the following item numbers: 123B567, 34AG123, 111r222, 111w222, 123, 1234567, and 111k456.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search