Question: Your assignment this week is to make your fractionType class safe by using exception handling. Use exceptions so that your program handles the exceptions division

 Your assignment this week is to make your fractionType class safe

Your assignment this week is to make your fractionType class safe by using exception handling. Use exceptions so that your program handles the exceptions division by zero and invalid input An example of invalid input would be entering a fraction such as TO or 8 a An example of division by zero would be 112 0/3 Use a custom Exception class called fractionException. The cass must inherit from exception (see example in lecture and note the entire class can be implemented in the h file as in the lecture) Test your safe fractionType class with a main method that forces an invalid fraction and a divide by zero. The catch block in the main method must report which kind of error was encountered - i.e. invalid fraction or divide by zero. The following can be used to test an exception: try i fractionTypexine nnl(1,0), fractionType int m(0,3). fractioaTypecint nun3; cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!