I'm trying to create some kind of loop that will allow the user to input more paragraphs. It will prompt the user "Would you like to add another paragraph (yes/no)" I'm really not sure how to do this. I've tried the do while loops and I don't know how to use the for loop. Can anyone help? CODE: //Text of webpage System.out.println("Please enter your text of your section:"); String f; f = in.nextLine(); //Closing statement System.out.println("Your webpage is now generated and is saved as output.html - have a wonderful day," + x); }
while (true) { System.out.print ("Would you like to add another paragraph (yes/no) "); String ans = in.next (); if (ans.equalsIgnoreCase ("no")) break; }