![]() ![]() |
Home |
How it works |
Projects archive |
Contact Us Air Compressor Bot |
|
| The Career Path of Freelance Programming Jobs |
Roulette Game |
![]() |
Bidding Time: |
21/05/2006 21:50 - 23/05/2006 00:00 |
Budget: |
$30-100 |
Status: |
Closed |
|
|
|
Job Type: |
|
Description: |
this could be done easily First, the user is prompted for how many spins of the wheel that will be bet on. The application should use the Math.random method as the basis for computing the number that would be spun on the wheel. It should then compare this number to the various bets and keeps track of how many times each bet would have one. This is continued until the number of spins have been reached. 3 classes Spin.java -two attributes, the min # that can be generated and the max# that can be generated - a constructor with two method parameters which are the min number and the max number, both are int. Verify's that the min is >= 0 and that the max is > the min. If not default values of 1 and the min+10 will be used for the min and max. -an axxessor method for each attribute -a mutator method for each attribute. the mutator for the minimum will return a boolean value of true if the value of the method parameter is greater than or equal to 0, otherwise returns false. same for the mutator for the max number -public method named spinWheel with no method parameters that returns a randomly generated integer within the range defined by the values of the attrubites for the min and max values RouletteTable.java A non-default constructor method accepts an integer parameter for the number of spins. You can use either 3 one-dimensional arrays (one for each column) or 1 two- dimensional array to represent the table. Make sure you account for how to keep track of the 0. You must have a loop to initialize the array(s) with zeroes, representing that each spot on the table starts with a value of 0. This array(s) will be used to keep track of how many times each number was selected. You may want to create duplicate arrays of whichever one you choose to keep track of the number at that location to make keep track of the results easier. You need another 1 or 2 arrays to keep track of red/black numbers. You dont need a loop to initialize the array(s) but can initialize when you instantiate them. Create a method that will spin the wheel the number of times stored in the attribute storing the number of spins. This method will call the method described next to store the results of each spin. Create a private method that will keep count of the number of times each number has been selected by a spin of the wheel. This method accepts the number that was spun. Create a method that examines(traverses) the array(s) representing the table to calculate and return the results of the spins in an array with the results of each individual number (0 to 36) expressed as a fraction of the number of spins (ie. take the number of times a number was spun and divide that by the total number of spins and put that result in the array that is returned by the method). Define accessors and mutators as needed in the program. Define any additional methods as needed. TestWheelSpin.java Prompt the user for the number of spins of the wheel. Create the table (only the first time through, after that use the mutator(s) to change the total number of spins and initialize the results to zero), spin the wheel that number of times and print the results of each type of bet by calling the appropriate two methods of the RouletteTable class object (the one to spin and the one to get the results). Only display the results for a particular number (or other bet if doing extra credit) if that result is > 0. You will repeat this process until the user enters any value less than 1. Where I am having problems is the RouletteTable.java.. maybe it is just the wording but I am so confused with the Arrays!! Any Help would be soooo appreciated!! STOPzilla! Anti-Spyware Software
This project is the proprietary information of .
Click here to remove this project from OUR database.
|
Operating System: |
MS Windows |
Database System: |
(None) |
| <<< back |
|
| Home | Projects archive | RSS | Resources | Links | Contact Us | © 2004-2009 ProjectsList.biz /0.088 |