ITEC 120 Back to Assignment index page
   
Assignment 2 - 7, 11, or doubles - due at midnight on Thur, Mar 9 - submit to RU06 folder

Description: 

Design and write a class called PairOfDice, which has 2 six sided dice.

PairOfDice

- face1 : int
- face2 : int

+ PairOfDice()
+ roll() : void
+ points() : int
+ is7_11_Doubles() : boolean

+ toString() : String

Write a driver to play a game called 7, 11, or Doubles. Let the user play against the computer. The user and the computer will each start out with 50 dollars. The user may roll first, and bets 10 dollars. If the user does not roll a 7, 11, or doubles, they lose 10 dollars and give up the dice to the computer. If the user rolls a 7, 11, or doubles, they may take the 10 dollars and give up the dice to the computer, or they may choose to roll again, for double or nothing (20 dollars). The user can continue to double or nothing for as long as they roll a 7, 11, or doubles.

Implement the computer to roll again if the money they would win, added to the money they have, would be equal to or greater than the player's money, or, when they have won three times in a row.

The game ends when either the player or the computer's money drops to 0 or below.

Submit your finished java files (2 of them) to the RU06 folder in your folder on neelix.