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
Which one of these are a valid IPv4 address?
Harman [31]

Answer:

1.1.1.1, 54.45.43.54, and 255.255.255.0

3 0
1 year ago
How can touch typing quickly but accurately improve your earnings (the money you can make)
AnnyKZ [126]

Doing so would not only increase your productivity potential / but also increase your productivity STANDARDS for certain jobs (e.g. data entry; secretarial work), which is a direct skill that is valuable to employers.  Furthermore, if you work in a a secretarial job, this would allow you to accomplish tasks such as "touch typing" a lot faster (without sacrificing quality) —  allowing you more time to accomplish other tasks, making you more efficient and even promotable in terms of pay raise and in terms of promotable to other positions with higher earnings — and even teach new staff members.

_____________________________


7 0
3 years ago
Read 2 more answers
Joe always misspelled the word calendar what function corrects the word
Lostsunrise [7]

Answer: Auto correct

6 0
3 years ago
Read 2 more answers
Which of the following is NOT a possible combination of values of the variables in this program when it finishes running?
Nady [450]

Answer:

Definitely D

Explanation:

When you flip a coin it’s a 50/50 chance. Meaning it’s equal.

7 0
3 years ago
Read 2 more answers
Create an java application that will process 3-digit numbers as follows:
alisha [4.7K]

Answer:

I dont not not the frsidjkbzxc.n bzl,b vbsv,gcjdvc,

Explanation:

5 0
3 years ago
Other questions:
  • Your dad just purchased a new desktop with Windows 8 Professional. He is calling you, informing you that he is unable to remote
    9·1 answer
  • What is a data mining??
    5·1 answer
  • You work in a customer call center. Martin is on the phone asking about the difference between solid-state drives (SSDs), hybrid
    6·1 answer
  • *FREE POINTS* If you comment and follow me this will give up lot of points :p seriously I will follow u back if u do it :p​
    11·2 answers
  • Identify and explain the three tiers of web-based applications.
    15·1 answer
  • An enterprise system is a packaged software application that helps integrate various ___________ in a company.
    15·2 answers
  • What was bill gates first operating system he created?
    7·1 answer
  • Nuclear batteries use devices called thermocouples, which convert the ____ of a nuclear reaction into electricity.
    9·1 answer
  • CALLING ALL DEKUS UWU
    15·2 answers
  • Question 5 / 15
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!