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: If else question/problem

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Posts
    8
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default If else question/problem

    Hi,


    I just created, with the help of this forum , a program that now successfully loops and asks a question that changes each loop,

    eg:
    Loop start> Person 1 do you like apples?? >Loop> Person 2 do you like apples >Loop> Person 3 do you like apples etc..

    My problem now is that at the end I added an else to say you have entered the wrong option please say yes or no. But when you enter the wrong option the program goes to person 2 and if its wrong again it goes to person 3 etc.. What I want is for it to re-ask for person 1 and not affect the loop.


    Thank you very much for the help.

  2. #2
    Junior Member
    Join Date
    Nov 2011
    Posts
    8
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: If else question/problem

    This can be deleted I figured it out!!!
    Last edited by Callcollect; November 22nd, 2011 at 11:17 AM.

Similar Threads

  1. Replies: 3
    Last Post: January 5th, 2012, 01:44 AM
  2. Problem-specific design question
    By olsonpm in forum Object Oriented Programming
    Replies: 6
    Last Post: July 20th, 2011, 02:00 PM