Write a java program to test the class tornadoexception


Assignment

1. Define the exception class called TornadoException. The class should have two constructors including one default constructor. If the exception is thrown with the default constructor, the method getMessage should return

"Tornado: Take cover immediately!"

The other constructor has a single parameter, m, of int type. If the exception is thrown with this constructor, the getMessage should return
"Tornado: m miles away; and approaching!"

Write a Java program to test the class TornadoException

2. Suppose that you have the following vector objects:

studentLastName = ["Smith", "Shue", "Cox", "Jordan"]
studentFirstName = ["James", "Sherly", "Chris", "Eliot"]

a. Write a Java statement that outputs the first name of the third student

b. Write a Java statement that outputs the last name of the second student

c. Write a Java statement that outputs the first name followed by the last name separated by a single blank space of the first student

d. Write the necessary Java statements so that the first name and last name of Eliot Jordan are interchanged.

e. Write a Java statement that changes the names James Smith and SherlyShue to Sherly Smith and James Shue

By changing the vector object studentLastName
By changing the vector studentFirstName

f. Write a for loop that prints all the students" names.

3. Write Java statements that will Create an UnorderedLinkedList

Given List: 75 48 78 45 30 18 4 32 36 19.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write a java program to test the class tornadoexception
Reference No:- TGS02634982

Now Priced at $35 (50% Discount)

Recommended (90%)

Rated (4.3/5)