Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am doing this in Eclipse Java IDE and if possible please write comments omn the code sections explaining what each part does. Thank you!
I am doing this in Eclipse Java IDE and if possible please write comments omn the code sections explaining what each part does. Thank you!
For this assignment you create the game of the CRAPS in ONE file only. Crapsjava
This program has TWO methods ONLY: main and RollDice.
Create a static method RollDice This method rolls two dice and return their sum and
will be called from the main method.
Use ENUMS for the status of the game. Example : enum Status CONTINUE, WON,
LOST
DO NOT use constants static final variables in this assignment.
DO NOT use switch statement in this assignment.
Basic rules for the dice game Craps:
You roll two dice.
If the sum is or on the first throw, you win.
If the sum is or on the first throw called "craps" you lose ie the "house"
wins
If the sum is or on the first throw, that sum becomes your "point." To win,
you must continue rolling the dice until you "make your point" ie roll that same point
value You lose by rolling a before making your point.
Sample Output:
Player rolled
Point
Player rolled
Player rolled
Player wins
Player rolled
Point
Player rolled
Player rolled
Player rolled
Player loses
Fig. Craps class simulates the dice game craps. Part of
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started