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();
}
```

Computer Science & Information Technology

You might also like to view...

What is a key advantage of interpreters over compilers? What is a key disadvantage?

What will be an ideal response?

Computer Science & Information Technology

Both Access and Excel can be used to collect, store, and ________ data

Fill in the blank(s) with correct word

Computer Science & Information Technology

There is no export command to move Access data to ________

Fill in the blank(s) with correct word

Computer Science & Information Technology

____ is the key to setting permissions.

A. Encryption B. Masking C. Granularity D. Synchronization

Computer Science & Information Technology