Question: Add error handling to Exercise E3.11. If the user does not enter a number when expected, or provides an invalid unit for the altitude, print

Add error handling to Exercise E3.11. If the user does not enter a number when expected, or provides an invalid unit for the altitude, print an error message and end the program.


Data from Exercise E3.11. 

The boiling point of water drops by about one degree centigrade for every 300 meters (or 1,000 feet) of altitude. Improve the program of Exercise E3.10 to allow the user to supply the altitude in meters or feet.

Step by Step Solution

3.35 Rating (173 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To add error handling to Exercise E311 you can use a trycatch block to handle any exceptions that ma... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Concepts Late Objects Questions!