Write a code fragment that reads and prints integer values entered by a user until a particular sentinel value (stored in SENTINEL) is entered. Do not print the sentinel value.
What will be an ideal response?
```
Scanner scan = new Scanner(System.in);
System.out.print("Enter some integers (" + SENTINEL +
" to quit): ");
number = scan.nextInt();
while (number != SENTINEL)
{
System.out.println(number);
number = scan.nextInt();
}
```
You might also like to view...
Expand the acronym LAN.
What will be an ideal response?
Ken Thompson and Dennis Ritchie designed the high-level language ¬¬________ specifically to implement the UNIX operating system.
a) Java b) C c) Visual Basic d) C++
If a comment does not close when an empty cell is clicked, the ________ /Hide Comments feature might be turned on
Fill in the blank(s) with correct word
When the MessageBox action is executed, the macro is paused so a message can be displayed. Click ________ in order for the macro to continue
A) OK B) Cancel C) Go D) Continue