This code is in java. Craps.java file is your main file. 1) you need to make a Die.java file This file will have a constructor method that creates a 6-sided die and another method that rolls the die and returns its value. 2) in the Craps.java Ask the user if they want to play the pass line or the don’t pass line. Create your die objects Roll the dice. Find the sum. Print out the dice values and the sum ( 1 + 3 = 4). Determine if the player wins or loses on the first roll (based on pass or don’t pass) or if they rolled the point value. If they win on the first roll print out you won If they lose on the first roll print out you lose Otherwise print out the point value. (for don’t pass, you need to take into account a tie.)
This code is in java.
Craps.java file is your main file.
1) you need to make a Die.java file
This file will have a constructor method that creates a 6-sided die and another method that rolls the die and returns its value.
2) in the Craps.java
Ask the user if they want to play the pass line or the don’t pass line.
Create your die objects
Roll the dice.
Find the sum.
Print out the dice values and the sum ( 1 + 3 = 4).
Determine if the player wins or loses on the first roll (based on pass or don’t pass) or if they rolled the point value.
If they win on the first roll print out you won
If they lose on the first roll print out you lose
Otherwise print out the point value. (for don’t pass, you need to take into account a tie.)
Step by step
Solved in 2 steps with 3 images