Results 1 to 2 of 2
  1. #1
    carman12 is offline Member
    Join Date
    Dec 2010
    Posts
    18
    Rep Power
    0

    Default Questionnaire Using Vector

    I created a file that takes user input sort of like a questionnaire using both a class and an object file. I used vector to store the first entry, is there a way using a do-while loop with a Y/N question to repeat the loop to add another set of input/answer to the vector.

    If so can anyone explain exactly how this is done, i've researched and came across quite a number of examples using vector but none showing anything of this manner.

  2. #2
    mine0926 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    580
    Rep Power
    5

    Default

    I will show you an example of do loop with Y/N question to repeat the loop or not
    Java Code:
    //This will give value to answer same as no answer.
    int answer = JOptionPane.NO_OPTION;
    
    //do not end loop while answer is equals to NO_OPTION;
    while(answer == JOptionPane.NO_OPTION)
    {
        System.out.println("Loop");
        answer = JOptionPane.showConfirmDialog(this, "Print loop again?",
            "QUESTION:", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
    
    }
    This link has an example of vector: Java Vector,Using Vectors in Java,Vector Object in Java,Online Java Vector Example

Similar Threads

  1. Help Vector
    By nikosv in forum New To Java
    Replies: 4
    Last Post: 12-16-2010, 06:27 AM
  2. Vector
    By ŖΫ ỏ Ңόρę in forum New To Java
    Replies: 2
    Last Post: 05-11-2010, 08:23 AM
  3. Vector<vector> loop thru
    By ocean in forum New To Java
    Replies: 11
    Last Post: 11-21-2009, 03:17 PM
  4. Replies: 1
    Last Post: 04-06-2009, 07:45 AM
  5. Java Mashup API - Design Patterns Questionnaire
    By goldeneyeone in forum Reviews / Advertising
    Replies: 0
    Last Post: 02-10-2009, 11:03 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
  •