Question: C++ quesion Related C++ question Write a program that receives input from the user to match a color code used to gain access to a

C++ quesion

 C++ quesion Related C++ question Write a program that receives input

from the user to match a color code used to gain access

Related C++ question

to a door. Users have a maximum of 4 incorrect tries before

Write a program that receives input from the user to match a color code used to gain access to a door. Users have a maximum of 4 incorrect tries before the system exits. Users must enter 4 correct consecutive color-codes to be granted access. The correct code is: Red, Green, Blue. Red. This system can be modeled using the state diagram presented below. Users can input a color value and must match the correct sequence of 4-colors. access Granted false. ele Green Red trycounter Ma Tries: Marries The sample output of the main (success use-case is provided below. Red (0 to select) Green (1 to select) Blue (2 to select Yellow (3 to select Enter color code: 0 Red was selected. Enter color code: 1 Green was selected. Enter color code: 2 Blue was selected. Enter color code: 0 Red was selected. Red, Greed, Blue, Red is the correct code! Access granted

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!