Write an application that will play a slot machine keeping count until it wins. The application will have three classes.

A class named Reel that will simulate a slot machine reel. Reel will have a string array with 20 possible faces.

  • The faces I used in my example are: lemon, cherry, banana, seven, diamond, bell, heart, star, strawberry, grape, bell, horseshoe, heart, pear, orange, 10, king, queen, jack, joker
  • Reel will have a function called spin that will spin the reel and land on one of the twenty faces
  • Reel will have other get functions that will retrieve data pertaining to what face was landed on during the spin

A class named SlotMachine that will simulate the slot machine. SlotMachine will

  • contain an array of three Reel objects
  • SlotMachine will have a function called Play that will
    • spin each of the Reel objects and
    • decide if the user won then print out the faces and
    • if the user won then the class containing main named lastname_Assignment5
    • In the main, an object of class SlotMachine will be instantiated The SlotMachine object will play until the user is a winner
    • Main will keep track of how many times the user has played and will display the number of times played once the user has won
    • The application will use the standard form of the C++ header files, meaning the class definitions will be in the .h (Reel.h, SlotMachine.h) files and the implementation of the functions will be in the .cpp files (Reel.cpp, SlotMachine.cpp).
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.