Create a fractionexception class the class contains a


You have been developing a Fraction class for Teacher's Pet Software. Each Fraction contains a numerator, denominator, a whole number portion, and has access to several functions you have developed, including overloaded operators. Complete these tasks:

a. Create a FractionException class. The class contains a Fraction object and a string message explaining the reason for the exception. Include a constructor that requires values for the Fraction and the message. Also include a function that displays the message.

b. Modify each Fraction class constructor and data entry function so that it throws a FractionException whenever a client attempts to instantiate a Fraction with a zero denominator.

c. Write a main()function that asks the user to enter values for four Fractions. If the user attempts to create a Fraction with a zero denominator, catch the exception, display a message, and force the Fraction to 0 / 1. Display the four Fraction objects. Save the file as FractionException1.cpp.

d. Write a main()function that asks the user to enter values for four Fractions. If the user attempts to create a Fraction with a zero denominator, catch the exception, display a message, and force the user to reenter the Fraction values. Display the four Fraction objects. Save the file as FractionException2.cpp.

e. Write a main()function that asks the user to enter values for four Fractions. If the user attempts to create a Fraction with a zero denominator, catch the exception, display a message, and terminate the program. Save the file as FractionException3.cpp.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Create a fractionexception class the class contains a
Reference No:- TGS02192688

Expected delivery within 24 Hours