1. Revise the following code so that it uses a while loop instead of a dowhile
loop:
Scanner keyboard = new Scanner(System.in);
int number;
do
{
System.out.println("Enter a whole number:");
number = keyboard.nextInt();
System.out.println("You entered " + number);
} while (number > 0);
System.out.println("number after loop = " + number);
2. What output is produced by the following code?
int count = 0;
while (count
System.out.println(count);
count;
}
System.out.println("count after loop = " + count);
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here