Help! making a simulation of a Roulette game

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 don�t 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!!

What is your question exactly? How to define arrays? Very easy:
int[] ai = new int[ 100 ];
int[][] aai = new int[ 100 ][ 100 ];How to use arrays? Very easy as well:
ai[ 10 ] = 10;
aai[ 10 ][ 10 ] = 100;Something else?

Similar Messages

  • If i reset my ipad can i install paye games for free if i sign back into my apple ID. Please i need help because i need to update my games but i need to put in this billing thing and i want to get rid of it so then i cant buy games with my credit card

    If i reset my ipad can i install paye games for free if i sign back into my apple ID. Please i need help because i need to update my games but i need to put in this billing thing and i want to get rid of it so then i cant buy games with my credit card

    Hello,
    As frustrating as it seems, your best to post any frustrations about the iPhone in the  iPhone discussion here:
    https://discussions.apple.com/community/iphone/using_iphone
    As this discussion is for iBook laptops.
    Best of Luck.

  • Help making a Install USB of os x 10.4.6. for my Macbook 1.8ghz

    Hi,
    I need help making the USB install of os Tiger.
    The drive is having trouble reading the install disc I own so I am trying to make a USB install of it.
    I wantto install from the usb not install to it to be clear.
    Things I have!
    X1 8gig sandisk flash drive
    1 Macbook white 1.8 ghz Intel
    1 Pc with Macdrive 7
    1 Install disc that seems to have trouble being read in the drive > few marks on the disc and the mac DVD drive make lots of noise reading it but
    It will go to Disk utilities.
    Seems to be a bug in Tiger and restore doesn’t seem to work as in I can’t drag and drop a source to the restore the DVD to the flash drive.
    I already tried only 1 time to copy the DVD to the formatted flash drive using Macdrive and it read it as a bootable drive but the apple simple came up
    And then I got a the error (Can’t find driver for this platform error APCH or something like that.
    I have a torrent download of OS x 10.4.6 as well just in case some files are corrupted > I own the disk so it’s not illegal.
    I am new to mac but long time user of PC.

    Ok ..you need another Mac to make this work!
    you just use another mac even a old one like g4 to make a restore to a flash drive that you have formatted and verified.
    Bye
    Sam

  • I need help making Adobe Edge animation appear correctly on iphones, ipads and android phones.

    I need help making Adobe Edge animation appear correctly on iphones, ipads and android phones. It currently looks fine on desktops and androids. I am using wordpress with a responsive theme (Canvas). I will need you to document The url is http://adamhtc.org.s183459.gridserver.com.

    Thanks George, interesting thought.  I looked on Adobe's site and they "advertise" fillable forms for the iPhone and Android markets, but on the Windows Phone tab, that is mysteriously missing.  lol    Maybe it will come later?   Meanwhile, I'll google to see if there are any PDF viewers that can handle it now.   Thanks for the reply.  :-)

  • Help making a logon page

    I need help making a simple logon page in Dreamweaver MX. I
    have tried Visual Basic. and several other methods to no avail. If
    someone could help me it would be greatly appreciated
    Ron Hansen

    Hi Ron
    The proceedure is pretty much the same in
    PHP/Coldfusion/JSP/ASP.
    There is a very easy to follow example in the Dreamweaver
    Help File.
    Just go to Help-->Developing Applications Rapidly -->
    Building pages that restrict access to your site (ColdFusion, ASP,
    JSP, PHP) --> Building a login page
    I don't think it can get much easier. But remember that you
    will need to have a database table of user details in place to
    complete the process.
    Good luck.

  • HT204266 I am trying to download Tap Tap Revenge on my new Ipad air..however..i searched for it in the App Store but there are none...help please..i really love this game! Is there something wrong with my App Store or my ipad??

    I am trying to download Tap Tap Revenge on my new Ipad air..however..i searched for it in the App Store but there are none...help please..i really love this game! Is there something wrong with my App Store or my ipad??

    It looks like the app is not currently in the App Store, I can't find it in the UK nor US stores.
    If you had previously downloaded it then do you have a copy on your computer's iTunes so that you can sync it to your iPad ?

  • Need Help making a Screencast for IPHONE

    Hello there
    I need some serious help making a screencast for a client - for it's Iphone Apps -
    something similare to this
    http://www.newsluxe.com/chaumet-et-iphone.php
    but more sexy, with a animated background and a different type of cursor.
    Anyideas ?
    I really don't know where to start - I found leads however :
    Camtasia Studio , screenflow, ,
    Maybe you could help me filling the gaps.
    Thanks for your help !

    does anyone know how apple made these forums?
    I think they use Jive:
    http://www.jivesoftware.com/products/forums/
    The Apple way for users to add photos is the .Mac web gallery:
    http://www.apple.com/ilife/iphoto/#webgallery

  • The volume icon sticks on my screen making it hard to read emails, games and such. Also ads feeeze adn I have to continually shut my iphone off and turn it back on to be able to move from advertisement to another screen

    The volume icon stucks on my screen making it hard to read emails, games, etc....also advertisements freeze on my screen so I have to turn the phone off then back on to move to a different screen....any suggestions??

    Try:                                               
    - iOS: Not responding or does not turn on           
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try another cable                     
    - Try on another computer                                                       
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar
    The missing apps could have been done by setting the Restrictions that can hid those apps. If the backup was made with those retrictions set the the Restrictions are also restored.
    Thus, if you get it to work restore to factory settings/new iPod, not from backup                               
    You can redownload most iTunes purchases by:        
      Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • My grandma is a new apple user and she needs help making an apple account.

    my grandma is a new apple user and she needs help making an apple account.

    She should call Apple support or visit the Genius Bar at an Apple store (make an appointment first at http://apple.com/retail). They will walk her through the process.

  • Help making a clock

    Hey,
    I was hoping to get some help making a clock update for me, but I don't want just to show the actual date, I know how to do that. What I want is to be able to set a time, and then the clock start running from then. For instance, after I enter Jan 3rd, 2005 at 3:43 as my time and date, I want the clock to start from there and update every second. Does that make sense?
    Could someone help me out where to look to get this to happen? Thanks!

    I think the OP wants to be able to set a time OTHER
    than the current time. He doesn't want to wait
    untill the time you entered to have the clock tick,
    he wants to have it tick immediately from the "fake"
    time that you've entered.
    At least that's how I understood him. The offset is
    the difference between the real time and the fake
    time entered by the user.
    If he just wants to display the current time, but not
    stat doing that untill some point in the future then
    yeah TimerTask is the simplest way to do it, but I
    don' think that's what he's trying to do.thanks for the replies guys. I appreciate it. Sorry if I was a bit unclear. Norweed was right in saying that I want to set the time and start updating immediately, not wait until the time reaches my entered time and then count. Sorry for the confusion.
    I was thinking that a offset would work, thanks for recommending that. I'm wondering if the time will get off after a while, I need this program to run probably arounnd 2-3 hours. Hopefully it won't drift very much over that time.
    Thanks all for the recommendations and I will check all that out.

  • Help Making a Ringtone!

    Hi,
    I can't seem to make any ringtones for more than the first 15 seconds of a song in garageband. I know the songs I am trying to use are unprotected because they are recordings of me playing jazz and we didn't protect them, they are in mp3 format. But I can't get mp3 mp4a or AAc format to play more than the first 15 secs. I tried tuneclone, mp3 converter and everything. All i want to do is create a ringtone of a song. please help.

    harriettfromjacksonville wrote:
    Purchased a ringtone and need help making it my ringtone for my new Iphone.  Help.
    You have to create the ringtone.
    There are many free ways to do this.  Google will find them.

  • FCE helps making better quality videos than imovie?

    I have been using iMovie HD and it looks like its corrupted and cannot re-install it since I lost the disk image.
    I am thinking of going to FCE over upgrading to iLife 09.
    Does FCE helps making better quality videos than imovie?

    Eswar M wrote:
    ... Does FCE helps making better quality videos than imovie?
    if your source is miniDV/Standard - yes.
    if your source is 720p or iFrame - no.
    in terms of speed and simplicity - iM09 is 'better'.
    in terms of options and feature - FCE is by far superior.
    note: iM09 is no 'upgrade' of your version, but a from ground off new app.
    another note: FCE has a very steem learning curve, but after managing that is a fantastic tool!

  • Hi i qanted to get help pg how can i download a game but they want me to verify my age but ansrewing the security question but iforgot

    Hi i qanted to get help pg how can i download a game but they want me to verify my age but ansrewing the security question but iforgot

    Click here for information. If the option to have the answers emailed to you isn't available or doesn't work(the email may take a few hours to arrive), contact the iTunes Store staff via the link in the 'Additional Information' section of that article.
    (90361)

  • Dear Apple,please help me.the glitch and lags on games made me sad beause i am too love with my 4s. Why iOS 7 really made me sad...please help me.im beg for you.

    Dear Apple,please help me.the glitch and lags on games made me sad beause i am too love with my 4s. Why iOS 7 really made me sad...please help me.im beg for you.

    www.apple.com/feedback/iphone.html
    No one from Apple is listening on these forums.

  • Help Making a Game Like Pokémon Trading Card Game.

    Hello! Im kinda new into making games in flash. And im trying hard to make a Game like the Pokemon TCG and i can't find anything on the internet that helps, so can't someone teach me how to do a game like that. Thanks!

    Well, it's not much. But i will studdy and become great!
    Thanks for your answer!

Maybe you are looking for