The while loop reads values from input until an integer is read. Complete the exception handler in the while loop to catch an InputMismatchException exception and: Output "Removed unacceptable input for number of cents". End with a newline. Discard the invalid input. Ex: If the input is 20 60, then the output is: 20 cents = 4 nickels Processed one valid input value Ex: If the input is Aya Tia 20 60, then the output is: New JAVA code can only be added after code given: Removed unacceptable input for number of cents Removed unacceptable input for number of cents 20 cents = 4 nickels Processed one valid input value Note: Each value read from input is on one line. /******************************************************************************************************* New Java Code here: test input: Aya Tia 20 60 **************************************************************************
The while loop reads values from input until an integer is read. Complete the exception handler in the while loop to catch an InputMismatchException exception and:
- Output "Removed unacceptable input for number of cents". End with a newline.
- Discard the invalid input.
Ex: If the input is 20 60, then the output is:
20 cents = 4 nickels Processed one valid input value
Ex: If the input is Aya Tia 20 60, then the output is:
New JAVA code can only be added after code given:
Removed unacceptable input for number of cents Removed unacceptable input for number of cents 20 cents = 4 nickels Processed one valid input value
Note: Each value read from input is on one line.
/******************************************************************************************************* New Java Code here: test input: Aya Tia 20 60
*******************************************************************************************************/
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images