java.lang.Object RouletteGame
public class RouletteGame
Class that simulates betting on a roulette wheel.
Constructor Summary | |
---|---|
RouletteGame()
Constructor of objects of class RouletteGame. |
Method Summary | |
---|---|
void |
addCredits(int numCredits)
Adds a number of credits to the player's account (assuming the number is positive). |
int |
checkCredits()
Determines the current number of credits in the player's account. |
java.lang.String |
makeBet(int betAmount,
java.lang.String betType)
Makes a bet and simulates the spin, updating the credits accordingly (1-to-1 payoff for color or parity, 35-to-1 payoff for a specific number). |
Methods inherited from class |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RouletteGame()
Method Detail |
---|
public void addCredits(int numCredits)
numCredits
- the number of credits to addpublic int checkCredits()
public java.lang.String makeBet(int betAmount, java.lang.String betType)
betAmount
- the number of credits being betbetType
- the type of bet ("red", "black", "odd", "even", or "1"..."36")