Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CIS2542 (C++) Homework Slot Machine Win Payout Percentages Many people dream of working on the next Halo or Elder Scrolls game. Some people sit down

CIS2542 (C++) Homework Slot Machine Win Payout Percentages

Many people dream of working on the next Halo or Elder Scrolls game. Some people sit down on their first day of the job and are told to work with some very different ideas. Village People Party is a video slot machine which may or may not still be found at a local casino. There might still be a few out in the wild if you were to Go West.

Watch a video of someone playing Village People Party at this link. As you can see, Village People Party consists of five vertically scrolling reels of symbols, and three rows. You may notice that certain combinations of symbols and orders pay out more than others. Maybe not. Thats totally okay.

With any slot machine game, the goal of the developers is to work the mathematics so that the game pays out less than it takes in. Obviously, the goal of the players is quite the opposite. If a mathematical model is created with this in mind, the house already wins over the long run, so there is no reason to actually put anything in the game that cheats the player. The player can only win in the short term.

The goal of this assignment is to simplify things a bit and create a mathematical model for a three row and three column slot machine game, similar the one shown below:

When you spin the reels to play one game, one value from each reel is randomly chosen. Remember that the reel is circular, so when you reach the end then you start right back at the beginning, and vice versa.

The three named vertical reels are set up and aligned below. Consider each of the values from 1 to 5 as symbols. Its irrelevant to the model, but you could call the 1 the cherries, 2 the bananas, and so forth.

Left Reel { 1, 2, 3, 4, 5, 2, 2, 3, 4, 2, 2, 1, 1, 3, 3, 4, 2, 1, 1, 1, 4, 3, 2 } Center Reel { 3, 1, 2, 2, 3, 3, 4, 4, 2, 2, 3, 2, 1, 2, 4, 3, 2, 2, 1, 5, 4, 1, 3, 2 } Right Reel { 2, 3, 4, 4, 4, 3, 1, 1, 1, 2, 3, 5, 4, 3, 2, 2, 2, 1, 1, 1, 3, 2, 1, 1, 2 }

In other homework assignments, we have just been running the games over and over again to approximate the final probability values. This works okay but we cannot generate the exact value using this method. This is not how we will approach figuring out the payout rate of this reel set. In this case, we will use an exhaustive method so that we only calculate each possible result once. We can do this since each possible result is equally likely.

Write a C++ program that tries every combination of reel stops and determines the win percentage that the slot machine would pay out.

  • Note that each reel has a different length of symbols on it
  • Based on what you are given here, there are 13800 (or 23 * 24 * 25) total possible ways the reels can stop

If the reels stop at Left[3], Center[6], Right[0] then the result would read as values 4-4-2. Remember to count from index value 0. This result, as shown by the table below, would pay 5 credits.

Here are all the possible winning combinations

  • 1-1-1 pays 5
  • 2-2-2 pays 5
  • 3-3-3 pays 20
  • 3-3-1 pays 2
  • 3-3-2 pays 2
  • 3-3-4 pays 2
  • 3-3-5 pays 2
  • 4-4-4 pays 30
  • 4-4-1 pays 5
  • 4-4-2 pays 5
  • 4-4-3 pays 5
  • 4-4-5 pays 5

So the percentage pay out is calculated as the total credits won in all possible spins, divided by the number of spins. Using the reel set listed above, and this payout set above, the payout percentage result will be 79.4565%.

NOTE: YOU ARE NOT CREATING A WORKING SLOT MACHINE GAME IN ANY SHAPE OR FORM

  • You are not asking the user for input
  • You are not asking the user to do anything
  • You are simply generating all 13,800 possible spin results and calculating the amount of credits won and thus the win percentage payout

Once you have this working and have the correct payout, the final part of this assignment is to tweak the payouts for an upcoming bonus game the designer wants to put in.

Modify the payout values above so that the payout percentage result works down to somewhere between 35-40%. Keep in mind you are trying to make an enticing game for your patrons. You cant just decide to pay all wins 1, for example. Reduce in small amounts until you reach your goal. You must also use positive integer values for all wins. No partial credits and no negative credits are allowed.

Submit to Blackboard your C++ program which pays out in the 35-40% range. You do not need to implement anything with object-oriented programming if you do not choose to. You may just supply one file as your submission and solution to this problem. End results of 79.4565% for this assignment.

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

Students also viewed these Databases questions

Question

What is Centrifugation?

Answered: 1 week ago

Question

To find integral of ?a 2 - x 2

Answered: 1 week ago

Question

To find integral of e 3x sin4x

Answered: 1 week ago

Question

To find the integral of 3x/(x - 1)(x - 2)(x - 3)

Answered: 1 week ago

Question

What are Fatty acids?

Answered: 1 week ago