1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
WARRIOR [948]
3 years ago
13

Write the definition of a class WeatherForecast that provides the following behavior (methods): A method called set_skies that h

as 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.
Computers and Technology
1 answer:
Ann [662]3 years ago
5 0

Answer:

class WeatherForecast(object):

 

skies = ""

min = 0

max = 0

 

def get_skies(self):

return self.skies

def set_skies(self, value):

self.skies = value

def get_max(self):

return self.max

 

def set_max(self, value):

self.max = value

 

def get_min(self):

return self.min

def set_min(self, value):

self.min = value

def main():

obj1 = WeatherForecast()

obj1.set_skies("Skies1")

obj1.set_max(2)

obj1.set_min(0)

print("Calling get_skies(): ", obj1.get_skies())

print("Calling get_max(): ", obj1.get_max())

print("Calling get_min(): ", obj1.get_min())

main()

Explanation:

  • Inside the WeatherForecast class, initialize variables for skies, minimum and maximum.
  • Define the getter and setter method for the necessary variables inside the WeatherForecast class.
  • Create an object of the class WeatherForecast.
  • Call the getter functions of  the class and display the results.
  • Finally call the main function to test the program.
You might be interested in
Convert 578.2 into hexadecimal​
siniylev [52]
The answer is 243. Hope it helps
5 0
3 years ago
Match the limits of the user with an appropriate design response. 1. severe arthritis, unable to type or use a mouse on a reliab
ololo11 [35]
Idk........................
4 0
3 years ago
The ________ is the biggest power consumer on a mobile computing device. display CPU memory module hard drive
user100 [1]

Answer:

CPU (Central Processing Unit)

6 0
3 years ago
The process of executing a program is also called ________.
irga5000 [103]
It is also called running it.  Hope this helps!!!
5 0
3 years ago
Which of the following file formats allows you to share and save documents
mariarad [96]
OPTION A would be the answer
7 0
2 years ago
Other questions:
  • The area on your screen where you can access the tab and menu options for word is called what?
    8·2 answers
  • Technician A says that if you add pre-lube to a sealing lip of an axle seal, it will cause the seal to leak causing the bearings
    8·1 answer
  • Which key you should you press to leave the cell as it orginally was
    14·2 answers
  • Theodor is researching computer programming. He thinks that this career has a great employment outlook, so he'd like to learn if
    9·2 answers
  • , 13 dB correspond to a power ratio of ....?
    14·1 answer
  • JPG is considered a lossy file format. What does this mean?
    15·2 answers
  • What should you do if your computer is running slower
    12·1 answer
  • What is the school wifi password trying to do my class work in school on different devices.
    9·1 answer
  • Which of the following is an example of machine learning?
    5·1 answer
  • Which internet explorer security feature restricts the browsing session information that can be tracked by external third-party
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!