Java 2710Project 1Due May 21, 2002You must do at least one of the projects |
Design and implement a class called RouletteWheel that
models a real European roulette wheel. Your class should provide
services for spinning the roulette wheel, getting the sector that is
currently selected (by number), getting the color of that sector, and
getting a descriptive text string that describes the sector.
You also need to provide a class that tests your RouletteWheel
class; call this class RouletteWheelTester. This tester
class should spin the roulette wheel until three green zeros have been
observed or until the wheel has been spun 10000 times.
Email me the source files RouletteWheel.java and RouletteWheelTester.java
(as an attachment).
Extra Credit: Allow a way for a user of your RouletteWheel
class to create a roulette wheel object that simulates a Las Vegas
roulette wheel. A Las Vegas roulette wheel is similar to a
European roulette wheel except that it has 38 congruent sectors.
The additional sector is called double zero (00), it is green, and it
is adjacent to the single zero (0) sector.
Design and implement a SlotWheel class that has the necessary
attributes and operations (services) to model the behavior for
a slot wheel as described above.
Design and implement a SlotMachine class that has the necessary
attributes and operations (services) to model the behavior for a slot
machine as described above. Your SlotMachine class should
have a method called play that spins the slot wheels,
prints out the symbols (just their names) that show as a result of the
spin, and determines the payout to the user. The payout should be
returned to the user of your method as an int. An object
created from your SlotMachine class is called an
aggregate object because it is made up of other objects (i.e.
slot wheels).
You also need to create a class called SlotMachineTester that
tests your slot machine. To test the slot machine play it a 1000 times
and track how much money you put into the machine ($1 a play) and how
much money you get out of the machine. After playing 1000 times print
out the net amount of money you lost or made. Would you want to play this
slot machine in real life?
Email me the source files SlotWheel.java, SlotMachine.java, SlotMachineTester.java
(as an attachment).