Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Jave please. The given program reads a list of single - word first names and ages ( ending with - 1 ) , and outputs
Jave please. The given program reads a list of singleword first names and ages ending with and outputs that list with the age incremented. The program fails and throws an exception if the second input on a line is a String rather than an Integer. At FIXME in the code, add a trycatch statement to catch java.util.InputMismatchException, and output for the age. Ex: If the input is: Lee Lua Mary Beth Stu then the output is: Lee Lua Mary Stu
Jave please.
The given program reads a list of singleword first names and ages ending with and outputs that list with the age incremented. The program fails and throws an exception if the second input on a line is a String rather than an Integer. At FIXME in the code, add a trycatch statement to catch java.util.InputMismatchException, and output for the age.
Ex: If the input is:
Lee
Lua
Mary Beth
Stu
then the output is:
Lee
Lua
Mary
Stu
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started