Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 Create your own IllegalDivisorException class. Make it a checked exception. Throw it from a divide ( int numerator, int denominator ) method from

Question 1
Create your own IllegalDivisorException class. Make it a checked exception. Throw it from
a divide(int numerator, int denominator) method from a Math class. From a main() method
in the same class, divide 5 by 2 and print the result "5 divided by 2 is 2.5" by using your
divide method. Also from the main() method call divide(5,0) and see the error displayed.
Question 2
Write a class Main with the main() method, which writes the command line arguments (all of
them) to a file named "data.txt". Then read the file and print all the data to the console, in
uppercase.
Question 3
Type in the Quiz
Question 4
Create your OWN jUnit test cases, for all positive and negative scenarios, and then write code
to pass it. A test case should test just one scenario.
Here are the requirements:
Class Name has two instance variables: first and last. The constructor throws
IllegalArgumentExceptions if either is null. The getName() method returns the first and last
names in Title Case, concatenated with a space between ("tiger", "woods" becomes "Tiger
Woods"). Test all this. Pass your own tests.
Submission
Zip up the code and upload to Assignments->Quiz3
Make sure you answer Question3 and submit the quiz. Leave empty the 3 coding questions.
Create 3 packages Question1, Question2 and Question4. Do not add any other packages like
ca.bc..... Under Question4 add a separate package for the unit tests.

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

Step: 3

blur-text-image

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

Modern Database Management

Authors: Fred R. McFadden, Jeffrey Slater, Mary B. Prescott

5th Edition

0805360549, 978-0805360547

More Books

Students also viewed these Databases questions

Question

1. What are your creative strengths?

Answered: 1 week ago

Question

What metaphors might describe how we work together?

Answered: 1 week ago