Question: python2.7 1. (30 points) Implement a class Storm (that is a subclass of the object class) supporting the following methods: a. init () which takes

python2.7
1. (30 points) Implement a class Storm (that is a subclass of the object class) supporting the following methods:
a. init () which takes a string representing rainfall amount, wind speed and year storm was recorded as integers. If the parameter is not specified it sets wind speed and rain fall amount as 0 and year as 1900.
b. getWindSpeed () - which returns the wind speed (mph) of the Storm as an int.
c. setWindSpeed() set the win speed as an int.
d. getRainFall() get the amount of rain ( inches per hour) as int.
e. setRainFall() set the amount of rain per hour as an int.
f. getYear() get the year the storm was recorded
g. setYear() set the year the storm was recorded
h. repr () which returns the canonical representation of the Storm.
i. str () which returns a nicely formatted version of the Storm, an example of which can be seen below.
j. The following shows how the Storm class and its methods could be used:
 python2.7 1. (30 points) Implement a class Storm (that is a

>>Sl-Storm() >>>print (sl) I am Storm with peak winds of 0 mph, peak rain fall of 0 inches per hour in the year 1900 >>s2-Storm (5) >>2.getRainFall () >>s2.getYear ) 1900 >>>print (s2) I am Storm with peak winds of 0 mph, peak rain fall of 5 inches per hour in the year 1900 >>S3-Storm (3, 40,2011) >>>print (s3) I am Storm with peak winds of 40 mph, peak rain fall of 3 inches per hour in th e year 2011 >>3.getYear ) 2011 Storm (3, 40 ,2011)

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!