Craps Test Java

2021年4月7日
Register here: http://gg.gg/oy83u
*Craps Test Java Questions
*Verify Java
Craps is a casino game that involves the throwing of a pair of dice. Based on the throw, the thrower either gets to continue throw (and win money), or stops throwing (and loses money). Write your solution in a file called Craps.java
JAVA: MUST BE DONE IN JAVA. Assignment: Write algorithms and programs to play “non-betting” Craps.Craps is a game played with a pair of dice. In the game, the shooter (the player with the dice) rolls a pair of dice and the number of spots showing on the two upward faces are added up. This 25-minute video shows how to write a Craps program in Java with using a main method and a single Die class.
*Submit your finished application. Make sure you compile and test your code. / - I’ll write free-form comments when assessing students.
*AP Computer Science Programming Project - Craps ASSIGNMENT OVERVIEW In this assignment you’ll be creating a main program called Craps.java, which will allow the user to play the game of craps on the computer. The program will make use of at least one helper class, Die.java.
We wish to write a program that simulates playing craps using a simplified set of rules:
If the thrower throws the dice and the sum is either 7 or 11, the thrower wins his bet - 1:1 , and continues to throw. If the thrower throws a 2,3,12 he loses his bet, and will replace his bet with the equivalent of his first bet; he continues to throw.If the player throws anything (a roll we’ll call X) other than 2,3,7,11,12, X becomes ’On’ and he continues to throw as follows:He throws X againat this point, he wins his bet 1:1 and play resets to the beginningHe throws 7at this point, he loses his bet, and play stopsHe throws anything elseplay continuesFor the purposes of this exercise assume that the thrower always replaces a lost bet with the equivalent of his initial bet and that every time he wins, he pockets his winnings and leaves is initial bet out. You will be given a module called Dice that has the following operation: roll(). roll() returns an integer value that represents the value of the roll of one dice. You should call roll() twice - once for each dice roll. You may wish to print the roll sequence to help you debug. Output will be ignored by the grading program. Your result should be outputted using the appropriate IO operation.
Ask the user for the following information:
An initial bet amount.Compute the winnings of the thrower, and the number of rolls in the thrower’s turn. Output them in that order. Losses are indicated by negative winnings.Craps Test Java Questions
What I’m trying to do is create a Craps game based on the following instructions :
Roll two dice. Each die has six faces representing values 1-6, respectively. Check the sum of the two dice. If the sum is 2, 3, or 12 (called craps), you lose; if the sum is 7 or 11 (called natural), you win; if the sum is another value (i.e., 4, 5, 6, 8, 9, or 10), a point is established. Continue to roll the dice until either a 7 or the same point value is rolled. If 7 is rolled, you lose. Otherwise, you win. The program should act as a single player.
It seems as if my program never runs the public static int points(int sum) method along with the public static boolean youWin(int sum, int points) method??
for instance, when a 7 is initially rolled I was trying to make it prompt :Verify Java
{FULL PROJECT BELOW | What I have written}
Register here: http://gg.gg/oy83u

https://diarynote.indered.space

コメント

お気に入り日記の更新

テーマ別日記一覧

まだテーマがありません

この日記について

日記内を検索