1. Engineering
  2. Computer Science
  3. go points implement a class storm that is a subelass...

Question: go points implement a class storm that is a subelass...

Question details

(Go points) Implement a class Storm (that is a subelass of the object class) supporting the following methods: 1. a. init 0 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 0 - which returns the wind speed (mph) of the Storm as an int. c. set WindSpeedO- set the win speed as an int. d. getRainFall0-get the amount of rain (inches per hour) as int. e. setRainFall0- set the amount of rain per hour as an int. f. get Year0 get the year the storm was recorded g. setYear) set the year the storm was recorded h. repr0 which returns the canonical representation of the Storm. i. str 0 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:
>s1-Storm() >>print (s1) I am Storm with peak winds of 0 mph, peak rain fall of 0 inches per hour in the year 1900 s2-Storm (5) >> S2.getRainFa11 () >>>S2.getYear() 1900 >> print (s2) I am Storm with peak winds of o mph, peak rain fall of s inches per hour in the year 1900 > 93-5torm (3,40,2011) >>> print (s3) I am Storm with peak winds of s0 mph, peak rain fall of 3 inches per hour in th e year 2011 > s3.getYear ) 2011 Storm (3, 40 2011)
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution