Last active
August 7, 2018 00:02
-
-
Save Gzoref/90268d3ee98fbeb7d3cb7c4e8c556b25 to your computer and use it in GitHub Desktop.
This file contains 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
import java.util.*; | |
/* | |
* Name: | |
* Date: 4/21/2018 | |
* Project: CoinToss | |
*/ | |
public class Coin { | |
String sideUp; | |
public Coin() { | |
toss(); | |
} | |
public void toss() { | |
Random randomNum = new Random(); | |
int randomNumber; | |
randomNumber = randomNum.nextInt(2); | |
if (randomNumber == 0) { | |
sideUp = "tails"; | |
} else { | |
sideUp = "heads"; | |
} | |
} | |
public String getSideUp() { | |
return sideUp; | |
} | |
} | |
/** | |
Create an Array field for Coin Toss, this will show if the toss was Heads or tails. | |
Create an Array field to show what the value was for that toss, .25, or .10 or .5 | |
Create an Array field to keep track of was that an add or a minus value. | |
Note: | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment