Convert the do-while loop in the following code to a while loop: Scanner keyboard = new Scanner(System.in);

Question:

Convert the do-while loop in the following code to a while loop: 

Scanner keyboard = new Scanner(System.in);
String input;
char sure;
do
{
 System.out.print("Are you sure you want to quit? ");
 input = keyboard.next();
 sure = input.charAt(0);
} while (sure != 'Y' && sure != 'N');

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: