Hi, i am creating a java craps game, and i just need someone to help me compile
ID: 3544379 • Letter: H
Question
Hi, i am creating a java craps game, and i just need someone to help me compile it, and indent it, and create a while loop that
public class Craps {
public static void main(String[] args) {
for(int i=1; i<=10; i++)
System.out.println(rollDie(6));
public static int rollDie(int a){
return(int)(Math.random()*a)+1;
}
public static int rollDice(){
return (rollDie(6) + (rollDie(6)));
}
public static boolean playOneGame(){
int sum = rollDice();
if(sum == 7 || sum == 11){
return true;
}
else if(sum == 2 || sum == 3 || sum == 12 ){
return false;
} else
{
}
}
Explanation / Answer
Please goto this link I have already answered your question:
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.