You are to develop a program to play another variation on a famous game of chanc
ID: 3647745 • Letter: Y
Question
You are to develop a program to play another variation on a famous game of chance called Roulette.Game Description:
There is a Player, who starts with 500 $1 chips.
The Player first decides what size (N) of Roulette wheel they wish to play (the number of slots notched around the spinning disk). The numbers on the wheel are 1 through N. Note: this determines the "odds" - you have a one in n chance of picking the correct number, when there are n numbers to choose from.
A Dealer asks the Player to place their bet(s):
A bet is: The Player picks a particular number and commits one to as many chips as they have to that number.
The player is allowed to place a bet on as many particular numbers as they wish.
The total bet must be one to as many chips as they have.
The Dealer then spins the disk in one direction and sends the ball traveling in the opposite direction (in its track). As the ball slows, it eventually falls out of its track and onto the spinning disk. After rolling and bouncing about the ball, comes to rest in one of the twelve slots on the disks perimeter. The number of this slot is considered the result of the spin.
For each number that the Player bet on a determination is then made as to whether the Player has won or lost as such:
If the Player has a bet on the particular number which was the result of the spin then the player has won and gets their original bet back plus an additional n - 1 times their bet number of chips - where n is the number of slots on the disk they chose to play.
In all other cases the Player has lost and their bet is collected by the Dealer.
This process repeats as long as the Player still has any chips and wishes to play.
Rules and Requirements:
The rules of the game - described above - must be adhered to strictly.
All user input must be validated to be in its appropriate range.
A spin report must be displayed after each spin, stating the result of the spin (how much won, how much lost)
You must keep track of how many spins the Player plays.
You must keep track of how many bets the Player won on.
You must keep track of how many bets the Player lost on.
You must keep track of the number of times each number occurs as the result of a spin.
You must write and use a statistics report method which displays:
How many spins the Player played.
How many bets the Player won.
How many bets the Player lost.
For each number that was the result of a spin, how many times that number was the result of a spin (frequency). This list is sorted in descending order of requency.
The net winnings (or net losings) of the Player - Based off of starting with 500 chips.
Sample Run
Enter wheel size: 3
You have 500 chips.
Place bet (b) or quit (q): b
Amount of bet (1
Explanation / Answer
required sample code: //Roulette_Wheel void roulette_wheel(int fitness [population], char chromosome[population][chromelength], char parent[population][chromelength]) { int i; int j; int k; int max_fitness; int random; int running_total[population]; int current_total; //int chromosome[population]; //int parent[population]; current_total = 0; for (i=0; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.