Question: A random 4-digit number is generated by the computer that only contains the digits 1 to 4. The digits can repeat themselves inside the
A random 4-digit number is generated by the computer that only contains the digits 1 to 4. The digits can repeat themselves inside the number. For example: 1123, 1234, 1221, 1331 and so forth. Using this random 4-digit number (it can be set manually within the code for testing), write a C++ class solution that can be compiled, which allows for the user to guess what the hidden 4-digit number is. You are required to keep track of how many guesses the user makes. If the user correctly identifies a digit in the correct spot, the program must indicate this as a "green flag", but it must not tell her user where the "green flag" was located. If the user correctly identifies a possible digit in the number but it is in the wrong spot, the program must indicate this as an "orange flag". A spot that is a green flag cannot be counted as an orange flag.
Step by Step Solution
There are 3 Steps involved in it
This is the code as your requirement include using namespace std int numG... View full answer
Get step-by-step solutions from verified subject matter experts
