Lab 4
Do problem #2 on p. 194 of your Java textbook.
Read Chapter 4 carefully before beginning.
Plan your program on paper first. This will save you time.
For any credit, use a do..while loop.
Save your code, you will use it again for lab 5.
Hint: Use (char) in.read(); as on p. 179 to read in a
single char. However, do not use 2 reads to
eliminate the enter key from the input stream. Use in.readLine() instead.
In order to get any credit,
you must create a typescript file with your listing, compilation and execution
and email it to your TA.
Click here for help making a
typescript.
Sample Execution
Use the values in the sample execution above.
Your execution should match the one given.
>java abcinput This is a skeleton program that can be used to offer a user a main menu and allow the user to select choices. Please enter A, B, C or Q to quit: A Good job! Please enter A, B, C or Q to quit: b Error in input, try again. Please enter A, B, C or Q to quit: x Error in input, try again. Please enter A, B, C or Q to quit: C Good job! Please enter A, B, C or Q to quit: Q Program Over, Bye!!!