Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Craps Game Java Programming Help
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Harvinder
Craps Game Java Programming Help
0 Answer(s)      3 years and 3 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.


Advertisement
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 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
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
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
Game
Game  how can create simple game in java . thank u so match ,please help
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
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
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
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
Game
Game  How to develop a game using java? give me a total code for any simple game
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
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 Nim - Java Beginners
game Nim  how is the search tree for a game Nim looks like
game
game  How to make 3D game in java Applet
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 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.
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
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
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
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
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
genaral snake game in java - Java Beginners
genaral snake game in java  can u please send code for fallowing write a snake game program using swings?  Hi This is the source code of Snake game in swing Snake.java file import javax.swing.JFrame
Java Programming
Java Programming  Hi, What is Java Programming? How I can learn Java Programming in one month? Thanks
Advertisements
 

 

 

DMCA.com