Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Guessing Game (like Memory) Arrays. Random Numbers Create a Windows C++ Console Application - include a system(pause) line of code just prior to the

C++ Guessing Game (like Memory)
image text in transcribed
image text in transcribed
Arrays. Random Numbers
Create a Windows C++ Console Application
- include a system("pause") line of code just prior to the return statement at the bottom of your code
GUESSING GAME
- adding on to your prior program where you generated pairs of digits in a 4x4 grid
NOTE: it you did not get that prior program to work successfully then just create a 4x4 array and manually populate it with pairs of dispersed digits 1-8 in order to do this part
- after the grid is filled, let the user repetitively guess the location pairs by the user typing in x,y coordinates for one element and then typing in x,y coordinates for another different element, where they think the other matching digit is
~ remember, the user will type in the coordinates from the user perspective' which means they refer to the top left corner as location 1,1 and the bottom right corner as 4.4
- first, prompt the user through for the first set of coordinates using a single console input command and they will enter in format x,y where x is a number from 1 to 4, and y is a number from 1 to 4
- then, prompt the user for the second set of coordinates using a single console input command and they will enter in format x,y where x is a number trom 1 to 4 and y is a number from 1 to 4
validate the user entry; also it is invalid for the user to enter the same coordinates for the first set and the second set of coordinates; it input is not valid then reprompt the user to enter both coordinates
- after the user enters both sets of valid coordinates, display the coordinate locations they entered, and display the digit that is located at each of the two coordinate locations
- NOTE: it the user types in the coordinate pairs 9,9 and 9,9 then display the complete 4x4 grid and then resume asking the user for a new sets of coordinates
After each user match attempt, output data from a user perspective in the range from 1,1 to 4,4:
let the user know if the digit located at each of the two coordinates matched or did not match, through a message
- let the user know the list of successfully matched digits so far, and the list of digits that have not been matched
- also display the user's number of attempts so far and their success percentage (number of successful matches so far/ number of attempts so far), for example:
Input:
User provides input: 1,1
User provides input: 4,4
Output:
Digit located at 1,1 is: 3
Digit located at 4,4 is: 5
Digits DO NOT MATCH
So far you have matched digits:
1
4
8
So far you have not matched digits:
2
3
5
6
7
Arrays, Random Numbers create a Visual Stud /Console Nindows Terminal Application: - Indude a systempause line of code just prior to the return statement at the bottom of your code GUESSING GAME adding on to your prior program where you generated pairs of digits in a 4x4 grid NOTE: If you did not get that prior program to work successfully then just create a 4x4 array and manually populate it with pairs of dispersed digits 1-8 in order to do this part after the grid is filled, let the user repetitively guess the location pairs by the user typing in xy coordinates for one element and then typing in x.y coordinates for another different element, where they think the other matching digitis - remember, the user will type in the coordinates from the user perspective' which means they refer to the top left comer as location 1.1 and the bottom right corner as 4,4 - first, prompt the user through for the first set of coordinates using a single console input command and they will enter in format x,y where x is a number from 1 to 4, andy is a number from 1 to 4 - then, prompt the user for the second set of coordinates using a single console input command and they will enter in format x,y where x is a number from 1 to 4 andy is a number from 1 to 4 - validate the user entry, also it is invalid for the user to enter the same coordinates for the first set and the second set of coordinates; it input is not valid then reprompt the user to enter both coordinates after the user enters both sets of valid coordinates, display the coordinate locations they entered, and display the digit that is located at each of the two coordinate locations - NOTE: If the user types in the coordinate pairs 9,9 and 9,9 - then display the complete 4x4 grid and then resume asking the user for a new sets of coordinates After each user match attempt, output data from a user perspective in the range from 1.1 to 44: - let the user know if the digit located at each of the two coordinates matched or did not match, through a message - let the user know the list of successfully matched digits so far, and the list of digits that have not been matched - also display the user's number of attempts so far and their success porcentage (number of successful matches so far / number of attempts so far), for example: Input User provides input: 1,1 User provides input: 4,4 Output: Digit located at 1,1 is: 3 Digit located at 4.4 is: 5 Digits DO NOT MATCH So far you have matched digits: So far you have not matched digits: Number of match attempts you have made: 10 Success percentage so far (number of matches / number of attempts) : 40% (4 matches / 10 attempts) - let the user try again - let the user know when they have matched all the pairs and how many quesses it took, then exit the program

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions

Question

What has been your desire for leadership in CVS Health?

Answered: 1 week ago

Question

Question 5) Let n = N and Y Answered: 1 week ago

Answered: 1 week ago