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 4 of 4

Thread: java programming exam

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

    Default java programming exam

    I am currently in a basic Java Programming Class. This was given to me as a take home lab to count as an exam grade. I'm not asking for you to just give me the answer unless you want to, I just have no idea where to start and would like some guidance, or just help walking through this lab. Thanks here is the question.



    Create a new project called <yourlastname>Lab8.

    Design a slot machine that takes a nickel to play. Once the nickel is inserted, the player hits enter to start. Three wheels will turn - each wheel has on it the 18 varsity sports at JCU listed below. Then the wheels stop, with one random pick from each wheel. Use JOptionPane techniques for input and output. You can use either one class or separate classes.

    Scoring:

    Three of a kind = jackpot (all the money in the machine).
    Three of the same season = all the money in the machine up to $1.00
    Three of the same gender = all the money in the machine up to $0.50
    Anything else = you lose.

    You must keep track of the amount of money in the machine ($0.00 at the start, adding $0.05 for each play, minus any payouts).

    After each spin, ask the player if they want to play again. If yes, take their money and spin again. If not, say goodbye and display the amount of money still in the machine.



    ggg.JPG


  2. #2
    Member
    Join Date
    Mar 2012
    Location
    United States
    Posts
    109
    My Mood
    Inspired
    Thanks
    1
    Thanked 32 Times in 30 Posts

    Default Re: java programming exam

    Hello JamesFlowers14,
    I would suggest creating a class diagram to try and figure out everything that you may need. If you don't know what that is check this out:
    Class diagram - Wikipedia, the free encyclopedia ....It is Wikipedia, but it does the trick. Just write down the variables you think will be needed and the names of functions you can think of using. From there just flesh things out as best you can.

  3. #3
    Junior Member
    Join Date
    Dec 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: java programming exam

    I am still stuck working on this code, does anyone have a solution they would like to share?

  4. #4
    Super Moderator curmudgeon's Avatar
    Join Date
    Aug 2012
    Posts
    1,130
    My Mood
    Cynical
    Thanks
    64
    Thanked 139 Times in 134 Posts

    Default Re: java programming exam

    Quote Originally Posted by JamesFlowers14 View Post
    I am currently in a basic Java Programming Class. This was given to me as a take home lab to count as an exam grade. I'm not asking for you to just give me the answer unless you want to, I just have no idea where to start and would like some guidance, or just help walking through this lab. Thanks here is the question.



    Create a new project called <yourlastname>Lab8.

    Design a slot machine that takes a nickel to play. Once the nickel is inserted, the player hits enter to start. Three wheels will turn - each wheel has on it the 18 varsity sports at JCU listed below. Then the wheels stop, with one random pick from each wheel. Use JOptionPane techniques for input and output. You can use either one class or separate classes.

    Scoring:

    Three of a kind = jackpot (all the money in the machine).
    Three of the same season = all the money in the machine up to $1.00
    Three of the same gender = all the money in the machine up to $0.50
    Anything else = you lose.

    You must keep track of the amount of money in the machine ($0.00 at the start, adding $0.05 for each play, minus any payouts).

    After each spin, ask the player if they want to play again. If yes, take their money and spin again. If not, say goodbye and display the amount of money still in the machine.



    ggg.JPG
    Come on now. This is a flippin' take home exam -- meaning you need to do this yourself, else you'll be cheating. Locking this question.

Similar Threads

  1. Exam study review question
    By michael305rodri in forum Object Oriented Programming
    Replies: 3
    Last Post: October 17th, 2012, 06:10 PM
  2. android programming vs game programming using java
    By vgoel38 in forum Android Development
    Replies: 4
    Last Post: September 8th, 2012, 05:48 PM
  3. Java exam paper
    By javanoobie in forum Java Theory & Questions
    Replies: 0
    Last Post: May 3rd, 2012, 12:24 PM
  4. Java Final Exam - Help needed
    By JavaBeginner12 in forum Java Theory & Questions
    Replies: 1
    Last Post: March 16th, 2012, 07:54 PM
  5. Good examples for exam practice?
    By Twoacross in forum Java Theory & Questions
    Replies: 2
    Last Post: December 28th, 2011, 12:48 AM