Gambling Fool

This assignment uses the Dice class from Chapter 5 of your textbook to simulate a slot machine.  It is meant to familiarize you with the following concepts discussed in class and the textbook:
Conditionals and boolean variables
Loops
Error checking values from user input
Using classes
Implementing classes

Slots

Write a program to simulate the play of a slot machine. Your program should do the following:

  1. Ask the gambler how much money she wants to spend between 1 and 1000 dollars.
  2. Ask the gambler which type of machine she wants to play (one, five, or ten dollar per pull). 
    The gambler should type in the value as a word not as an integer (i.e., ten, not the number 10). If there is a typo when the gambler types in the word one, five or ten, then tell the gambler her option is not available and ask her to try again. Repeatedly prompt until the gambler finally types in one of the three valid options.
  3. Convert as much of the gambler's money into her chosen dollar coins as possible.
    For example, if the gambler wants to spend 17 dollars at the 5 dollar machine, then 15 dollars could be converted into three coins. Inform the gambler how many coins she has and that the extra 2 dollars will not be spent.
  4. For each coin entered in the machine, the "handle" is pulled to spin the wheels of the machine, giving the gambler a chance to win more money.
    The slot machine has three wheels that spin. The left and right wheels have the numbers 1-10 on them. The middle wheel has the numbers 1-9 and a special symbol "*" which matches with anything. Each time the wheel is spun, show the three numbers (or "*" for the middle wheel) and print a message informing the gambler if she  won or not.
    The following rules determine the gambler's winnings:
    If the same number appears on all three wheels, the gambler wins 10 times the coin. The same two numbers and the "*" is equivalent to the same number appearing on all three wheels.
    If the same number appears only on two wheels, the gambler wins 2 times the coin. A "*" and any other number is equivalent to the number appearing on two wheels.
    If the numbers are all different, the gambler gets no winnings.
  5. After a complete game (all the coins have been played in the slot machine), print a message indicating how much money the gambler won, and a message indicating if the gambler made money, lost money, or broke even. Money not spent (for example, the 2 dollars in the example above) is not used in the comparison.
  6. Finally, if the gambler won money, ask if she would like to play her winnings (yes or no). If the gambler responds yes, then play another game with the winnings.

Below are two sample runs. Your output does not have to look exactly like this, but should follow the specifications above.  Input from the user is shown in italics.

How many dollars do you want to spend? 4
Which dollar machine do you wish to play (one, five, or ten)? one
You have 4 coins.
Spinning... Numbers are 5 * 9
*** Congratulations, you won $2
Spinning... Numbers are 8 * 8
*** Congratulations, you won $10
Spinning... Numbers are 9 2 2
*** Congratulations, you won $2
Spinning... Numbers are 8 7 5
Total winnings are $14
You won money!
Do you want to play your $14 in winnings (yes or no)? no
 
How many dollars do you want to spend? 88
Which dollar machine do you wish to play (one, five, or ten)? tne
We do not have a tne slot machine. (one, five, or ten)? fve
We do not have a fve slot machine. (one, five, or ten)? ten
You have 8 coins, you can spend all but 8 dollars.
Spinning... Numbers are 7 2 4
Spinning... Numbers are 8 7 10
Spinning... Numbers are 5 7 4
Spinning... Numbers are 7 4 6
Spinning... Numbers are 10 * 3
*** Congratulations, you won $20
Spinning... Numbers are 2 9 3
Spinning... Numbers are 4 5 7
Spinning... Numbers are 3 * 5
*** Congratulations, you won $20
Total winnings are $40
You lost money!
Do you want to play your $40 in winnings (yes or no)? yes
You have 4 coins.
Spinning... Numbers are 9 8 9
*** Congratulations, you won $20
Spinning... Numbers are 5 6 7
Spinning... Numbers are 1 6 3
Spinning... Numbers are 2 4 7
Total winnings are $20
You lost money!
Do you want to play your $20 in winnings (yes or no)? yes
You have 2 coins.
Spinning... Numbers are 8 3 1
Spinning... Numbers are 2 7 5
Total winnings are $0
You lost money!
You have no more money, go home.

Making Classes

When writing your program, you should create two classes: a SlotMachine class and a Gambler class.

Your SlotMachine class should provide at least the following member functions:
int Spin ()        // spins the slot machine, generating 3 random values
                   // returns winning factor (i.e., 10 if all matched, 2 if two matched,
                   // or 0 if none matched) and increments number of spins on the machine
int NumSpins()     // returns the number of spins on the machine

Your Gambler class should provide at least the following member functions:
int GetWinnings ()                // returns amount of money the gambler has won
void UpdateWinnings (int amount)  // updates the gambler's winning by the given amount
                                  // (i.e., positive for wins and negative for losses)
bool PlayAgain ()                 // prompt the user to play again
                                  // returns true if the user answers yes,
                                  // otherwise returns false

Like the Dice class shown in the book, you should implement each of your classes in two separate files: e.g., machine.h and machine.cpp. See the code here for a start.