Create a DataEntryException class whose getMessage() method returns information about invalid integer data. Write a program named

Question:

Create a DataEntryException class whose getMessage() method returns information about invalid integer data. Write a program named GetIDAndAge that continually prompts the user for an ID number and an age until a terminal 0 is entered for both. Throw a DataEntryException if the ID is not in the range of valid ID numbers (0 through 999), or if the age is not in the range of valid ages (0 through 119). 

Catch any DataEntryException or InputMismatchException that is thrown, and display an appropriate message. Save the files as DataEntryException.java and GetIDAndAge.java.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  answer-question

Java Programming

ISBN: 978-1337397070

9th edition

Authors: Joyce Farrell

Question Posted: