Question: There are five categories in wind speed, write a python code as following direction. Category 1: 74-95 Mph Category 2: 96-110 mph Category 3: 111-129
There are five categories in wind speed, write a python code as following direction.
Category 1: 74-95 Mph
Category 2: 96-110 mph
Category 3: 111-129 mph
Category 4: 130-156 mph
Category 5: 157 or higher
We need two classes base class and derived class from base class. The Hurricane will be a base and the Derived one is group class. In the group class, the category of hurricane needs to be set up by speed of winds.
Define a class named Hurricane, with two instance attributes Name and Speed. The __init__ method, Constructor, is required to set up initial state of the new instance. There are three methods to set Name(set_Name), set Speed (set_Speed),get Name(get_Speed) and a display method requires to display Name and Speed.
Other Derived class additionally required Named Group derived from the Hurricane class. An instance attribute, named Category is needed and a method to setup category depend on speed of winds.
Task1: Instantiate a Class, Hurricane and set name, and speed. Display all values.
Task2: Invoke(instantiate) a Group Class, and set Hurricane and set name,speed and call set category to setup category.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
