Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Need help making a Java roulette simulator.

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need help making a Java roulette simulator.

    Hi everyone, first post here.

    I'm having a little trouble with my assignment where im required to write a code that simulates a roulette wheel spinning 10,000 times. The assignment is as follows:

    Write a program that will simulate the spin of a roulette wheel and the landing of a ball in a slot.
    When the wheel is spun a ball is released and eventually comes to land in one of many possible slots.
    Our roulette wheel will have 38 slots.
    Two of these are green and numbered 0 and 00.
    The remaining 36 slots are numbered 1 through 36.
    Of these 36:
    In the number ranges from 1 to 10 and 19 to 28, odd numbers are red and even are black.
    In the ranges from 11 to 18 and 29 to 36, odd numbers are black and even are red.
    You could visit various web pages to see the actual layout of a roulette wheel (e.g. wikipedia) to
    become more familiar with the game.
    Your program must simulate 10,000 spins of the roulette wheel (begin with a seed value of
    987654321). For the first 20 spins you must display where the ball has landed:
     The number of the slot (this is one of: 0, 00, 1, 2, …36)
     The colour of the slot (this is one of: green, red, black)
    After simulating 10,000 spins your program must display the following 7 statistics regarding the slot
    where the ball has landed
     the number of times the ball landed on a Green slot
     the number of times the ball landed on a Red slot
     the number of times the ball landed on a Black slot
     the number of times the ball landed on an odd numbered slot
     the number of times the ball landed on an even numbered slot

    thanks for any help.


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Need help making a Java roulette simulator.

    Which part of this are you stuck on? What have you tried so far?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Java Parked Simulator HELP PLEASE!
    By patrickpogi5087 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: September 30th, 2012, 09:15 PM
  2. Need some help with my Roulette game please.
    By iDizzle in forum Object Oriented Programming
    Replies: 4
    Last Post: April 15th, 2012, 05:35 PM
  3. Java TreeMap Simulator
    By giga97 in forum Collections and Generics
    Replies: 2
    Last Post: October 18th, 2011, 09:46 AM
  4. [SOLVED] Java Noob: Coin Toss Simulator (no GUI)
    By bgroenks96 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: June 4th, 2011, 10:28 PM
  5. JAVA simulator
    By YAS218 in forum Java Theory & Questions
    Replies: 8
    Last Post: July 20th, 2009, 09:57 AM