Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

HELP NEEDED WITH THIS PROGRAM NEED BOTH PARTS A&B DONE IN GOOD JAVA PROGRAMMING STYLE. ASAP !!! LAB ASSIGNMENT 1 Review of CSC162 Concepts Due:

image text in transcribedimage text in transcribed

HELP NEEDED WITH THIS PROGRAM NEED BOTH PARTS A&B DONE IN GOOD JAVA PROGRAMMING STYLE. ASAP !!!

LAB ASSIGNMENT 1 Review of CSC162 Concepts Due: Thursday February 9th by 12:20pm (end of class) Submit each java file and .txt file electronically through Campus Cruiser by the due date. Submit a printout of your source code to the instructor by the due date 1. Write a class that simulates a standard pair of dice. You will later use this class to play the game of Craps. s is a table game which is played in casinos all over the world. Crap A. Create a class called Pat Dice. Objects of this class represent a single pair of six-sided dice a. The attributes of such an object are the face values of the two dice only b. Provide a constructor. di random number c. Provide a roll method that simulates rolling the Use the generator from Gaddis chapter 4 to get the value of each die d. Provide a method that returns the sum of the face values of the dice Provide a toString method that returns a nicely formatted string representing the e. value of each die and the sum of the pair, such as "5 3 8" the class works propcrly. (Your driver should test all class methods.) B. Play the game of Craps. basic bet made by the "shooter" in this game is the pass-line The bet a. To start a pass-line bet, the shooter makes a "come-out" roll. Roll the pair of dice b. If the "come-out" roll is a 2, 3, or 12 that is called "craps" or "crapping out" and the shooter immediately loses c. A "come-out" roll of 7 or 11 is a "natural" and the shooter immediately wins d. The other possible numbers are the point numbers: 4, 5, 6, 8, 9 and 10. If the shooter rolls one of these numbers on the come out roll, this establishes the "point". To win, the point number must be rolled again before a seven (7). So, in the case where a "point" is established the shooter rolls over and over until either the point is rolled (a win) or a seven (7) is rolled (a loss) 100 pass bets e. Using your Pai Dice class write an application that simulates running total of and output the results of each betto an output file. Also, keep a run how many wins and losses. Output those totals at the end of your

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

Students also viewed these Databases questions

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago