Question: Add an exception for divide by zero to your fraction class. Write a program to test it. Example Output: --------------------Configuration: -------------------- Please enter the numerator:

Add an exception for divide by zero to your fraction class. Write a program to test it.

Example Output:

--------------------Configuration: --------------------

Please enter the numerator: 1

Please enter the denominator: 0

Denominator cannot be zero.

Please enter the numerator:

Note, this must be handled by DenominatorIsZeroException.java.

__________________________

Write a program that reads and writes from binary or text files.

Example Output:

--------------------Configuration: --------------------

Enter the file name: kenb

Choose binary or text file(b/t): b

Choose read or write(r/w): w

Enter a line of information to write to the file:

lasdklj

Would you like to enter another line? Y/N only

n

Continue? (y/n)y

Enter the file name: kenb

Choose binary or text file(b/t): b

Choose read or write(r/w): r

File contains:

lasdklj

Continue? (y/n)y

Enter the file name: kent

Choose binary or text file(b/t): t

Choose read or write(r/w): w

Enter a line of information to write to the file:

OOP

Would you like to enter another line? Y/N only

Y

Enter a line of information to write to the file:

Java, C++ not C.

Would you like to enter another line? Y/N only

n

Continue? (y/n)y

Enter the file name: kent

Choose binary or text file(b/t): t

Choose read or write(r/w):r

File contains:

OOP

Java, C++ not C.

Continue? (y/n)n

Process completed.

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!