http://www.math.ucla.edu/~dinov/10b.1.011/ |

- (
**HW_6_1.cpp/exe**) Write a program that defines a class**DivideByZeroException**to be used in exception handling for throwing an exception on a division by zero. You need to provide a default and a non-trivial (string parameter) constructor for**DivideByZeroException**, as well as a private member*message*and public**set(string)**and**what()**member functions which allow the end user to manipulate the message reported. Inside your driver**main()**have a function call to a method**quotient**which throws an exception (object) of type**DivideByZeroException**upon attempt to compute the quotient, when the divisor is equal to zero. The user is prompted to enter a pair of numbers, until an exit (Q/X) is requested, and the quotient of the two numbers is reported provided it's well defined (divisor!=0). Note,**quotient**should be a template function accepting all primitive types of numbers.

**Sample Run:**

%> This program illustrates generating, throwing and catching an exception of type**DivideByZeroException**.

%> Enter two numbers and we'll report the quotient, (Q/X) to exit:

%> 100.0 10

%> The quotient is: 10.0

%> Enter two numbers and we'll report the quotient, (Q/X) to exit:

%> 100.0 0

%>**Exception occurred: attempted to divide by zero ...**

%> Enter two numbers and we'll report the quotient, (Q/X) to exit:

%> 33 9

%> The quotient is: 3.66667

%> Enter two numbers and we'll report the quotient, (Q/X) to exit:

%> x

%> Bye!