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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started