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.
class WeatherForecast(object):
def __init__ (self, skies, value):
self.skies = ""
value = 0
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, value):
self.low = value
class WeatherForecast():
skies = "Clear"
high = 80
low = 20
def set_skies(self, skies)
self.skies = skies
def get_skies(self):
return self.skies
def set_high(self, high):
self.high = high
def get_high(self):
return self.high
def set_low(self, value):
self.low = value
def get_low(self):
return self.low