The objective of this assignment is to create and use exception handling
using user defined objects. You are to create a class for this assignment
and throw objects of the created class.
You are to write a C++ input program to read and verify keyboard input using these
very stringent restrictions. The user will enter space delimited data and you
are to determine whether each item is a valid identifier, valid integer,
or valid decimal number. You MUST read the input character by character.
You are to report the errors and the valid input.
For example:
20 points
Due: May 1st at 11:59pm
NOTE: you are to process an entire line of input
You must define a class and use an object to handle the error handling.
The class should include a string with the error message and an
associated integer code.
Recall the sample code that used
a user defined class to handle exceptions
Input Output
x ID
1238 integer
0.4089 decimal
2134.9 decimal
x-db Invalid ID. - found
xy78 Invalid ID. 7 found
456. Invalid decimal. Missing digit
. Invalid decimal. Missing digit
.3 Invalid decimal. Missing digit
x y 8 9.4 ID ID integer decimal
Start with this code
do { try { next = ... cout ... analyze ... } catch ( ... { cout ... } } while ( ...
To hand in this assignment:
Place the code and sample output in the Exceptions Dropbox on D2L