Question: All code must be in C++ using G++ compiler Write a program where a hacker tries to guess a PIN. The program should have an


All code must be in C++ using G++ compiler
Write a program where a hacker tries to guess a PIN. The program should have an array of five integers named PIN, and should initialize each PIN number with a random number in the range of 0 through 9. Now a hacker tries to guess the PIN stored in the system by entering 5 digits at the console. The system reads the numbers entered by the user into an array named GuessedPIN. After reading the numbers entered by the hacker, the program is to compare the corresponding elements in the two arrays and keep a count of the digits that match. For example, the following shows the PIN array and the GuessedPIN array with sample numbers stored in each. There are two matching digits (array elements 2 and 4) PIN Guessed PIN
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
