Results 1 to 3 of 3
  1. #1
    koryvandell is offline Member
    Join Date
    Apr 2011
    Posts
    4
    Rep Power
    0

    Default Help with Reverse Guessing Game Code

    I'm new to java, and need to write a program where the program asks the user to think of a number between 1 and 10, and then the programs generates random guesses until the user confirms with y that the number is correct, and then displays the results, including number of attempts.

    I'm using a counter, I know how to print introduction and results. I'm having a problem though. I need to create a method that takes a prompt String and a Scanner as input and returns a char. If kb was the scanner object, the call would be:
    char ans = promptYN("Do you want to play against", kb)

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,788
    Rep Power
    7

    Default

    This is not a code generation site. It is your homework so you must write it. Make an attempt, post your code here, post any error message(s) and ask a specific question.

  3. #3
    ojn
    ojn is offline Senior Member
    Join Date
    Aug 2008
    Location
    Stockholm, Sweden
    Posts
    119
    Rep Power
    0

    Default

    Thank you for telling us what you assignment is. But did you have an actual question?

Similar Threads

  1. guessing game
    By MrM in forum New To Java
    Replies: 1
    Last Post: 02-02-2011, 07:51 PM
  2. Need help in Guessing Game
    By rose in forum Java Gaming
    Replies: 4
    Last Post: 10-27-2010, 10:43 PM
  3. Guessing Game
    By rose in forum Java Gaming
    Replies: 4
    Last Post: 10-27-2010, 08:00 PM
  4. guessing game help
    By yasmin k in forum AWT / Swing
    Replies: 4
    Last Post: 10-31-2009, 05:37 PM
  5. guessing game using GUI
    By yasmin k in forum New To Java
    Replies: 1
    Last Post: 10-26-2009, 12:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •