Rewrite PRG-2 with the DivByZero class inherited from the standard exception class invalid argument, which is an appropriate class for this purpose. When we divide two integers, we are calling the...


Rewrite PRG-2 with the DivByZero class inherited from the standard exception class invalid argument, which is an appropriate class for this purpose. When we divide two integers, we are calling the library operator (/), in that the second argument is an integer which should not be zero.


PRG-2


Rewrite PRG-1, but define a constructor and a member function what() for the class DivByZero.


PRG-1


Instead of using fundamental data types as the type of exception to be thrown, we can use objects of a class type. Rewrite Program 14.5, and use a class named DivByZero to throw an exception object instead of an integer. The class does not need any data member or member functions.


Program 14.5

Nov 17, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here