Craps Game Java Programming Help

Craps Game Java Programming Help

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 Tutorials/Questions & Answers:
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 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
Advertisements
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
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
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
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
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 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
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
Urgent java programming question.Pls help
Urgent java programming question.Pls help  Q1. Generate 10 thousand random integers with values in the range between 1 to 100. Q2. Store each randomly generated number into a node and then attach the node to a linked list
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
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
java game
java game  Can anyone please give me a game source code
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
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
Game
Game  how can create simple game in java . thank u so match ,please help
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
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
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
hi need help with C++ programming!
hi need help with C++ programming!  how do i : b. Store numbers / characters into the file (output) c. Retrieve numbers / characters from the file (input thanks!   b) #include <iostream> #include <
Game
Game  How to develop a game using java? give me a total code for any simple game
Programming Help URGENT - JSP-Servlet
Programming Help URGENT  Respected Sir/Madam, I am R.Ragavendran. I am in urgent need of the coding. My requirement is as follows: Beside... TO ROSEINDIA TEAM< IF I GET THIS HELP IN TIME.... Thanks/Regards
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 make 3D game in java Applet
game Nim - Java Beginners
game Nim  how is the search tree for a game Nim looks like
Java File Programming
Java File Programming articles and example code In this section we will teach you about file programming in your Java applications. Java File Programming... program. Java programming language provides many API for easy file management. Java
Java program for connectfour game
Java program for connectfour game  Hello, my program is about connectFour game. I need help with resolving the logic for this problem. I appreciate your help very much. **Client:** package FourPack; import javax.swing.
Java Programming
Java Programming  Hi, What is Java Programming? How I can learn Java Programming in one month? Thanks
Create a Swamp Game in Java
Create a Swamp Game in Java  You are to create a game called â??Get Out of My Swampâ??. In this game an ogre, called â??Hekâ??, wanders around his... two ogre enemies in the same place they kill the ogre and the game ends. Full
Programming help Very Urgent - JSP-Servlet
Programming help Very Urgent  Respected Sir/Madam, Actually my code shows the following output: There is a combo box which contains all the ID's present in the database.. When I click or select any of the ID,it automatically
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
Java programming
Java programming       Java programming language is useful for development of enterprise grade... and VCRs to communicate. Java as programming language was first slated to appear
Learn Java Programming for beginners
Java programming tutorials for beginners for learning Core Java, Advanced... programming language for beginners which teaches you Java programming language. Java programming language is very popular language and its on high demand
Programming problem - Java Beginners
Programming problem  Good afternoon Ma'am/Sir, Can you help me... it difficult to learn java programming? Based on my survey it seems that java programming is the hardest part of their studies.. I also want to know
java programming
java programming  how to count the no. of constants in a user given string?? plzz help
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 [email protected]
Learning Java programming for Beginners
Learning Java programming is not a difficult task as it has been hyped... queries will be answered. Now online learning of Java programming is becoming.... Reasons behind it are many. Learning Java programming online is free
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
java programming   Companies and people often buy and sell stocks... in question Implement the program described above using the Java programming language... programming method you want to accomplish this task. Both your stack and queue
java programming
java programming   Companies and people often buy and sell stocks... in question Implement the program described above using the Java programming language... programming method you want to accomplish this task. Both your stack and queue
programming - Java Beginners
programming for java beginners  How to start programming for java beginners
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
programming - Java Beginners
Start programming in Java  Programming in Java - Can any one please suggest how to start programming in Java
Java Programming
Java Programming  Write a Java program that prompt user to input a number of students in a class. Then, prompt user to input the studentÃ?¢ââ??‰â??¢s programming mark. Determine how many student get A+ and A for their grade
java programming
java programming  Write a Java program that prompt user to input a number of students in a class. Then, prompt user to input the studentâ??s programming mark. Determine how many student get A+ and A for their grade and how many
Java programming
Java programming  What is the Role of OOP in java
Java programming
Java programming  What is the Role of OOP in java
java programming
java programming  how to write a coding for simple login form in netbeans

Ads