Write a while loop that verifies that the user enters a positive integer value.

What will be an ideal response?

```
Scanner scan = new Scanner(System.in);
System.out.print("Enter a positive integer: ");
number = scan.nextInt();
while (number <= 0)
{
System.out.print("That number was not positive.");
System.out.print("Enter a positive integer: ");
number = scan.nextInt();
}

```

Computer Science & Information Technology

You might also like to view...

Which of the following is NOT a formula auditing tool?

A) Trace Precedents B) Trace Dependents C) Watch Window D) Calculation Options

Computer Science & Information Technology

Which method sets the text that's displayed when the user hovers over a JLabel?

a. setHover b. setHoverText c. setToolTip d. setToolTipText

Computer Science & Information Technology