Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions