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").

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

Build It For The Real World A Database Workbook

Authors: Wilson, Susan, Hoferek, Mary J.

1st Edition

0073197599, 9780073197593

More Books

Students also viewed these Databases questions

Question

General Purpose of Your Speech Analyzing Your Audience

Answered: 1 week ago

Question

Ethical Speaking: Taking Responsibility for Your Speech?

Answered: 1 week ago