Results 1 to 7 of 7
  1. #1
    000
    000 is offline Member
    Join Date
    Feb 2013
    Posts
    4
    Rep Power
    0

    Default How do you make a loop that replays a program 15 times?

    I'm new to java, and I'm making a rock paper scissors program. I can't figure out how to make a loop that runs my program fifteen times and then it stops. I came up with this :

    while(replay <16 (!nextLine.equals("end")){

    But it doesn't work. Help?

  2. #2
    000
    000 is offline Member
    Join Date
    Feb 2013
    Posts
    4
    Rep Power
    0

    Default Re: How do you make a loop that replays a program 15 times?

    Still need help.

  3. #3
    000
    000 is offline Member
    Join Date
    Feb 2013
    Posts
    4
    Rep Power
    0

    Default Re: How do you make a loop that replays a program 15 times?

    Why does everyone ignore this?

  4. #4
    liluma's Avatar
    liluma is offline Member
    Join Date
    May 2011
    Location
    belgium
    Posts
    50
    Rep Power
    0

    Default Re: How do you make a loop that replays a program 15 times?

    you hardly waited an hour...
    you obviously asked this question in the hope of getting a fast awnser, where you have to do very little effort...

    what have you looked up so far?
    what do you know of java programing?

  5. #5
    000
    000 is offline Member
    Join Date
    Feb 2013
    Posts
    4
    Rep Power
    0

    Default Re: How do you make a loop that replays a program 15 times?

    @liluma

    I just started two weeks ago, and I couldn't find anything on google.
    And how does two hours and 14 minuets count as "hardly an hour"?

  6. #6
    liluma's Avatar
    liluma is offline Member
    Join Date
    May 2011
    Location
    belgium
    Posts
    50
    Rep Power
    0

    Default Re: How do you make a loop that replays a program 15 times?

    you should know that nobody is forced to awnser...
    you said after 33 mins that everybody is ignoring your post... <== this doesn't make people want to help you. ;)
    just saying

    and since you just started with java search up the basics. ;)
    learn what is the difference between while, do while, and for loops
    and what exactly they do

    take a look at this site. ;)
    The Really Big Index
    this should have everthing explained, from the basics to the somewhat more advanced stuff.

    grtz liluma

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    18

    Default Re: How do you make a loop that replays a program 15 times?

    "it doesn't work" is not terribly helpful.
    Are you getting compiler errors?
    If so then post the complete text of them.

    Does it compile?
    Then post any exceptions you get when running them (in full), highlighting the line in your code where they occur.

    No exceptions?
    Then explain what your program is doing and what it should be doing, including relevant code.

    When posting code please wrap it in [code] tags [/code] in order to retain the formatting.
    Please do not ask for code as refusal often offends.

Similar Threads

  1. Replies: 4
    Last Post: 11-21-2012, 01:19 PM
  2. Replies: 2
    Last Post: 06-03-2012, 11:20 PM
  3. while loop tries 20 times before giving up
    By JMAsterson in forum New To Java
    Replies: 3
    Last Post: 04-10-2012, 10:02 PM
  4. Replies: 4
    Last Post: 07-23-2011, 08:08 PM
  5. Write a Program that reads two times in military format
    By HPcompaq256 in forum New To Java
    Replies: 10
    Last Post: 02-26-2010, 04:38 AM

Posting Permissions

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