(This is a version of an exercise from Chapter 5.) Programming Project 2 from Chapter 5 asked you to create a class named Fraction. This class is used to represent a ratio of two integers. It should include mutator functions that allow the user to set the numerator and the denominator along with a method that displays the fraction on the screen as a ratio (e.g., 5/9). Modify the class so that it throws the exception Denominatorls-ZeroException if the denominator is set to zero. Don’t forget to account for the constructors! You will have to create the DenominatorlsZeroException class and it should be derived from Exception.
Write a main method that tests the new Fraction class, attempts to set the denominator to zero, and catches the DenominatorIsZeroException exception.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.