Created
April 27, 2013 13:48
-
-
Save anonymous/5473189 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Roulette; | |
public class Bet { | |
public int amountBet; | |
public Outcome outcome; | |
public Bet(int amount, Outcome outcome){ | |
this.outcome = outcome; | |
this.amountBet = amount; | |
} | |
public int winAmount(){ | |
int winAmount = this.outcome.odds * this.amountBet; | |
return winAmount + this.amountBet; | |
} | |
public int loseAmount(){ | |
int loseAmount = this.amountBet; | |
return loseAmount; | |
} | |
public String toString(){ | |
return this.amountBet+" on "+"["+this.outcome.toString()+"]"; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment