Simulate Pairs card game

Write a C++ program to simulate Pairs card game. The game is played by two players. It will ask user to choose two cards from a matrix and try to find the pairs. If user finds a pair s/he gets 10 points, if not looses 1 point. At the end of the game, program will display the name and the score of the user.

For this program create two classes:
Game class:
- data members 4x4 array of cards (char), 2 players (player), winner (string)
- Constructor to initialize the array of cards randomly to the first 8 letters of the alphabet (a,b,c,d,e,f,g,h) and score to zero. (use srand (time(NULL)); and then create random numbers for array indexes using rand())

- play() member function: to let users to choose cards and try to find the pairs in order, updates scores each time. If user is successful, s/he gets 10 points, if not looses 1 point.
-necessary get() and set() functions

Player class:
-name of the player (string), score (int)
-constructor to input name and initialize score to zero
-update()member function that receives a parameter (int) and updates the score by that parameter value.
-necessary get() and set() functions
Which part are you having problems with?
I reach a clever man who write all code for my homework :D

He may be clever but he's not helping you learn c++ by doing it for you.
Topic archived. No new replies allowed.