Write the definition of a class WeatherForecast that provides the following beha
ID: 3698327 • Letter: W
Question
Write the definition of a class WeatherForecast that provides the following behavior (methods): A method called set_skies that has one parameter, a String. A method called set_high that has one parameter, an int. A method called set_low that has one parameter, an int. A method called get_skies that has no parameters and that returns the value that was last used as an argument in set_skies. A method called get_high that has no parameters and that returns the value that was last used as an argument in set_high. A method called get_low that has no parameters and that returns the value that was last used as an argument in set_low. No constructor need be defined. Be sure to define instance variables as needed by your "get"/"set" methods.
In python please
Explanation / Answer
class WeatherForecast(object): def __init__ (self): self.skies = "" def get_skies(): return self.set_skies def set_skies(self, value) self.skies = value def get_high(): return self.set_high def set_high(self, value): self.high = value def get_low(): return self.set_low def set_low(self): self.low = value
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.