Write a do loop that verifies that the user enters an odd value. You may assume that a Scanner object named input has already been created.

What will be an ideal response?

```
int value;
do {
System.out.print("Please enter an odd value: ");
value = input.nextInt();
if(value%2 != 1)
System.out.println("Error (the number was not odd)");

} while(value%2 != 1);
```

Computer Science & Information Technology

You might also like to view...

A character-based operating system uses all of the following EXCEPT a ________

A) mouse B) hard drive C) keyboard D) monitor

Computer Science & Information Technology

You need to set up a local network to support Windows Vista, Windows 8.1, and OS X computers that will share printers and folders with each other. Which type of network do you need to configure?

a. Homegroup b. Dial-up c. VPN d. Workgroup

Computer Science & Information Technology