Question: Implement a NotAnInteger Exception that handles the error that occurs when trying to store anything that isn't an integer in an integer variable. You should

Implement a NotAnInteger Exception that handles the error that occurs when trying to store anything that isn't an integer in an integer variable. You should take the user input as a string and then ensure it is made up only of digits. If it is, convert it to an integer using the string::stoi(). If it does contain anything that is not a digit, throw the custom exception. Also write a main function with the proper try-catch blocks
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
