memory game using parallel array and class

Jul 22nd, 2013
KateS
Category:
Programming
Price: $20 USD

Question description

must use C++. I am not looking for hints or incomplete work. The code must follow this instruction and must run without error. Please, no fraud and time wasters. If you can't do it, don't even say you can. I will definitely leave u bad rating for wasting my time. 

Objective

To understand and implement software using arrays and previously learned programming constructs.

Instructions

For this assignment you will
create a Memory Game similar to the card game that many of us probably
played as kids. For the Memory Game, you will allow for the user to select an
index of an array of characters and try to find the matching character. If the
guess is wrong, you “flip the card back over” and do not reveal it. If they get
a matching pair, then you display both of the characters. You should keep track
of how many guesses (rounds) the user requires to unveil all of the matches.

The array will have 10
elements, thus, five pairs. You could choose A,B,C,D, and E just to keep things
simple or use a different set of characters. Behind the scenes, you may have an
array that looks like this, for example:


[ ‘A’ ‘B’ ‘B’ ‘A’ ‘C’ ‘D’ ‘D’‘C’ ‘E’ ‘E’ ]


Or anything of the sort. However, the user will (at startup) see the following:

[ - - - - - - - - - - ]


To indicate that none of the “cards” have been unveiled yet.

Print the results at each stage of interaction with the user. For example, a sample interaction could be as follows:

[ - - - - - - - - - - ] Tries: 0

>>0

[ A - - - - - - - - - ] Tries: 1

>>1

[ A B - - - - - - - - ] Tries: 2

No match, sorry.

[ - - - - - - - - - - ]

>>3

[ - - - A - - - - - - ] Tries: 3


>>0

[ A - - A - - - - - - ] Tries: 4

You’ve made a match! Please continue!

[ A - - A - - - - - - ]

Etc.

So the user continues playing until all the letters are recovered. At the end you should say, “congratulations, you’ve matched all the cards in someNumber tries!

Recommendations/Hints

Use parallel arrays One contains the actual letters  One is used to
display the appropriate cards that have been revealed (or not, i.e. ‘-‘ back to
the user)

You should design a class called CMemoryGame to maintain the state of the
game, interact with the user, and determine winning state. Failure to use a
class will result in significant loss of points. You must also write a driver in main.cpp that will use objects of type CMemoryGame that will allow me to test your programs.


Tutor Answer

(Top Tutor) Daniel C.
(997)
School: Boston College
PREMIUM TUTOR

Studypool has helped 1,244,100 students

8 Reviews


Summary
Quality
Communication
On Time
Value
Five Star Tutor
Dec 6th, 2016
" Outstanding Job!!!! "
SjSurvivor143
Nov 21st, 2016
" Thanks for the help. "
Joemoe
Nov 7th, 2016
" <3 it, thanks for saving me time. "
tinytim47
Oct 29th, 2016
" Wow this is really good.... didn't expect it. Sweet!!!! "
pmallory
Oct 25th, 2016
" Totally impressed with results!! :-) "
mixedballz
Oct 16th, 2016
" excellent work as always thanks for the help "
kiln82
Oct 2nd, 2016
" awesome work thanks "
darnay
Sep 23rd, 2016
" The best tutor out there!!!! "
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1824 tutors are online

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors