Home Answers Viewqa Java-Beginners Craps Game Java Programming Help

 
 


Harvinder
Craps Game Java Programming Help
0 Answer(s)      a year and 7 months ago
Posted in : Java Beginners

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

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 again at this point, he wins his bet 1:1 and play resets to the beginning He throws 7 at this point, he loses his bet, and play stops He throws anything else play continues For 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.

View Answers









Related Pages:
Craps Game Java Programming Help
Craps Game Java Programming Help  Craps is a casino game... playing craps using a simplified set of rules: If the thrower throws the dice... roll. You may wish to print the roll sequence to help you debug. Output
Game
Game  how can create simple game in java . thank u so match ,please help
game
game  Hi thank you for answers.I am devoloping a java game caled Duck Hunt Game in netbeans6.7.1 software and I need help in some codes...,if you have this game's code please post me as soon as possible
game programming
game programming  Hi. i have witten the script and have almost completed developing a social game like mafia wars. can any one plz help me by answering me some of my doubts.. after uploading the game on facebook how tokeep data
Java game Pontoon
Java game Pontoon  Hello. I have trouble with my pontoon code. I ahve done it using simple java programming. It is working BUT it dosent stops when the players hand rises ober 24 points. where in game the player should be bust
Game
Game  How to develop a game using java? give me a total code for any simple game
game
game  How to make 3D game in java Applet
Java Game Pontoon
Java Game Pontoon  Could someone help me create a programme for the game pontoon //play a game of pontoon import java.util.*; public class Pontoon { public static void main (String args[]) { //deal initial hands
XP Bowling Game User input help
XP Bowling Game User input help  I was asked to do the XP Bowling... in a command window. Being new to Java....I have no clue how to out put it to the console... but with no fruitful results. Any help
Create a guessing game - Framework
Create a guessing game  Create a guessing game that picks a random..., too. it is in java but i m not sure about the language, it is like c.print(); c.println(): so,plz, help as soon as possible thanks in advance
java game
java game  Can anyone please give me a game source code
JAVA Game
JAVA Game  I want to make a JAVA game...in dat game...d player has to input a word in 10 secnds...4 dat m running a delay loop... but the problem is not...i am not getting any way...to make that input field(eg: String str
BRICK-BREAKER game concept - Java Beginners
BRICK-BREAKER game concept  I am planning to write a program for BRICK-BREAKER GAME. can any 1 help me any 1 can u plz help me frzzz?? you can also send the mails to poramboku.me@gmai.com
Game and Graphic Books
with the programming aspects of game development. It should be noted, there are other... Game and Graphic Books         Computer Game Developer I've
Java Programming Help
Java Programming Help  Hello ! I m the student of last year and i need your help to complete my java project. I going to make a site like youtube... with controls .. I Just want to use jsp and applet in my project . Please help me
game programming code - Swing AWT
game programming code  write a snake program using swings with step by step explanation?. please send me this source code to my mail id with step by step explanation
Need Help in Java programming
Need Help in Java programming  Hello. Can someone please help me with writing the following program Java program that gives assignment details such as:assignment number,assignment name,due date,submission date,percentage marks
Java Programming Code HELP
Java Programming Code HELP  Hi, sir/madam. I am new here and currently developing a program whereby it can read the Java source file... the expert can help me to solve this problem and pull out the attribute name. Can sir
game Nim - Java Beginners
game Nim  how is the search tree for a game Nim looks like
Need help in java programming
Need help in java programming  Hello. Can someone please help me with writig the following programm. Assignment 20% Presentation 10% Mini Test 10% Exam 60% Java program that accepts the following details: student
Chess Game
Chess Game  How could I make a basic 8x8 chess table with two dimensional arrays and insert the chess pieces in the array?   Please visit the following link: http://roseindia.net/java/example/java/swing/chess
Java programming using ArrayList Help?
Java programming using ArrayList Help?  Hi,can anybody help and guide me on doing this java program? (Largest rows and columns)Write a program... row index : 2 The largest column index : 2,3 Any help would be greatly
Java programming using ArrayList Help?
Java programming using ArrayList Help?  Hi,can anybody help and guide me on doing this java program? (Largest rows and columns)Write a program... The largest row index : 2 The largest column index : 2,3 Any help would be greatly
Java programming help - Java Beginners
Java programming help  Write a program that asks the user for an integer, and if the input is positive, puts stars on the screen - one star on line... for more information. http://www.roseindia.net/java/ Thanks
Open Source Game Engine
Open Source Game Engine Genesis3D Open Source Engine Genesis3D...-featured game engine. It is being developed to fulfill the needs of military training...: A HLA networking component for the Game Manager that support an Agile FOM interface
help
(); } } SFDV2103 â?? Java Programming Fall, 2012 Term Project... on the percentage of cheating. SFDV2103 â?? Java Programming Fall, 2012 Term... based on the percentage of cheating. please help me
Java Programming Need Help ASAP
Java Programming Need Help ASAP  You are required to develop a student menu system that is similar to the bank system covered in class..., their year (you can assume they all start in year 1), their programming mark
help - Java Beginners
, Java : Java is great programming language for the development of enterprise... game consoles and VCRs to communicate .Java is an object-oriented language, and this is very similar to C++. Java Programming Language is simplified
mobile programming - Java Beginners
mobile programming  hai sir i need ur help... i need source code j2me about bike racing game.. coming Wednesday i have to submit the project.. so plzz send me the coding bike racing as soon.... thank you sir
HELP Java as a starter!
HELP Java as a starter!  I feel like my mind is going to blow! I... programming with Java and I cant find a guide that?s neat. In till someone told me to read... then go learn game programming! That will just make me so depressed and will kill my
tetris game code - Swing AWT
tetris game code  To develop a JAVA puzzle game which is a "variation" of the Tetris game
Blackjack game - IDE Questions
Blackjack game  Create a java code for a simple blackjack game for just one hand of Blackjack, it does not need to include money and betting
Java programming
support examples related to each Java programming technology that will help... Java programming       Java programming language is useful for development of enterprise grade
plz help me to write a snake game using swings - Swing AWT
plz help me to write a snake game using swings  write snake game program using swings
Java programming help with files - Java Beginners
Java programming help with files  I want a code or the following program .thanks Write a program that reads employee data into a vector. The data is composed of : - id# - name - nationality - job title the program
How do i slow down the game (othello game)??
How do i slow down the game (othello game)??  Hello, I built an othello game that can be played by 2 humans , human and computer and two computers... with each other the fram doesn't appear until the game is finish. I think it is becase
Java Programming: Section 6.6
is more likely to confuse you than to help you. The state of the game includes... there is to GUI programming. If you're willing to program all the drawing and handle... that a button was pushed. Another aspect of GUI programming is laying out
Java Programming: Solution to Programming Exercise
the BlackjackCanvas class. All the programming for the game is in this class... Solution for Programming Exercise 6.8 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook
Java Programming: Section 5.3
Section 5.3 Programming with Objects THERE ARE SEVERAL WAYS... as objects. On another level, object-oriented programming encourages programmers... of programming projects. Built-in Classes Although the focus of object
About Java Programming Language
About Java Programming Language       Java is an Object oriented application programming language developed by Sun Microsystems. Java is a very powerful general-purpose programming
java programming
java programming  how to count the no. of constants in a user given string?? plzz help
Java Programming
Java Programming  Using Java Frame form, help me develop a GPA calculating device, able to show Grade and points together, and using MySQL database
Java Programming
Java Programming  Using Java Frame form, help me develop a GPA calculating device, able to show Grade and points together, and using MySQL database
Java Programming: Section 5.6
oriented progrmming in Java. Read it now, or just look through it and refer back... programming languages, such as C++, allow a class to extend two or more... inheritance is not allowed in Java. The designers of Java wanted to keep
Java game bulls and cows
Java game bulls and cows In this tutorial, you will learn how to implement bulls and cows game in java. The game bulls and cows is an ancient game...;quit", the user will come out from the game. If the user inputs 4 digit
Java Programming: Section 5.1
programming language such as Java includes a number of features that make... OBJECT-ORIENTED PROGRAMMING (OOP) represents an attempt to make programs more... styles of programming, a programmer who is faced with some problem must identify
Mobile Game Developers
the programming languages in our mobile game developers team...Mobile Game Developers A mobile game is very different from handheld video game that is played on PlayStation portable or with remote on television
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 7.4 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook. Exercise 7.4: In the Blackjack game BlackjackGUI.java from Exercise 6.8
who know full coding of guessing game in java?
who know full coding of guessing game in java?  There is only 1 player. Use JAVA Random toolkit to generate random number between 1 to 10. Once user... again or to exit the game by type 1 to proceed the game and type 2 to end the game
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 7.5 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook... it possible for the user to place bets on the Blackjack game. When the applet starts

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.