Question: 1. (50 points) Develop two classes. TropicalStorm which is a subclass of Storm and Hurricane as a subclass of TropicalStorm. The class TropicalStorm defines these

1. (50 points) Develop two classes. TropicalStorm which is a subclass of Storm and
Hurricane as a subclass of TropicalStorm.
The class TropicalStorm defines these methods:
a. An overloaded constructor init () which takes all the properties of a TropicalStorm in addition to a name of the storm.
b. getName retrieves the name of the storm
c. setName sets the name of the storm The class Hurricane defines two methods:
a. An overloaded constructor init () that takes the hurricanes category in addition to all the other properties of Storm and TropicalStorm. It should set the category of the Hurricane (0-5), which is an instance variable in the Hurricane class, to the specified parameter but should call the constructor for the TropicalStorm class to set the other attributes. If category is less than 0 the category is 0 and if it is greater than 5 then it should be set to 5. Default is 0.
b. getCategory() which returns the category of the Hurricane.
c. setCategory() which sets the category of the Hurricane.
The following shows how the Storm, TropicalStorm and Hurricane classes and methods could be used:
 1. (50 points) Develop two classes. TropicalStorm which is a subclass

>>>sl-TropicalStorm () >S1 Tropicalstorm(0, 0,1900, default) >>>s2-TropicalStorm (20,80,2007, Bob') >s2 TropicalStorm (20, 80 ,2007,Bob) >>S2.getName ) Bob' >>>s2.getYear () 2007 >>33-Hurricane () >>S3 Hurricane (, 0,1900, default,o) >>>print (s3) I am category 0 Hurricane named default. I have peak winds of 0 mph, peak rain fall of 0 inches per hour in the year 1900 >>> s4=Hurricane (12, 200, 2017,' Irma ' , 5) >>>34.getCategory () >>>4.getWindSpeed () 200 >>>print (s4) I am category 5 Hurricane named Irma. I have peak winds of 200 mph, peak rain f all of 12 inches per hour in the year 2017 >>>s5-TropicalStorm (20,20,2012, 'Tony') >>print (s5) I am Tropical Storm named Tony. I have peak winds of 20 mph, peak rain fall of 20 inches per hour in the year 2012

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!