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
Velma is graduating from Ashford at the end of next year. After she completes her final class, she will reward herself for her h
motikmotik

This question is incomplete because the options are missing; here are the options for this question:

Which of the following is the most effective way for Velma to save money each month?

A. Automatically reroute a portion of her paycheck to her savings account.

B. Manually deposit 10% of her paycheck in her savings account.

C. Pay all of her bills and then place the remaining money in her savings account.

D. Pay all of her bills and then place the remaining money in her piggy bank.

The correct answer to this question is A. Automatically reroute a portion of her paycheck to her savings account.

Explanation:

In this case, Velma needs to consistently save money for her vacation as this guarantees she will have the money for the trip. This means it is ideal every month she contributes consistently to her savings for the vacation.

This can be better be achieved by automatically rerouting a part of her paycheck for this purpose (Option A) because in this way, every month the money for the vacations will increase and the amount of money will be consistent, which means Velma will know beforehand the money she will have for the vacation. Moreover, options such as using a piggy bank or paying the bills and using the rest for her savings, do not guarantee she will contribute to the savings every month, or she will have the money she needs at the end.

5 0
3 years ago
Which of the following correctly describes the syntax of an If statement?
Ber [7]

if(Expression to be tested) {

code to execute

} else if(Expression to be tested) {

code to execute

}


you can have as many else ifs as you want. But that's what it looks like.

8 0
3 years ago
Computer networks make setting appointments easier by _____.
Sunny_sXe [5.5K]

Probably providing a common calendar

5 0
3 years ago
Read 2 more answers
Que es un algoritmos
marin [14]
Algorithms: rules to follow when problem-solving
5 0
3 years ago
Read 2 more answers
Importance of word processing application​
alina1380 [7]

Answer:

Some of the functions of word processing software include: Creating, editing, saving and printing documents. Copying, pasting, moving and deleting text within a document. Formatting text, such as font type, bolding, underlining or italicizing.

Explanation:

8 0
3 years ago
Other questions:
  • What can a folder on a computer contain?
    13·2 answers
  • In a word processor, Tariq chooses Options from the Tools menu and then selects the Track Changes tab. Which of the following ta
    14·1 answer
  • Ethics issues are significant in the area of online privacy because laws have not kept pace with the growth of the Internet and
    12·1 answer
  • What fields of engineering are in Biomedical
    7·1 answer
  • An organization is trying to decide which type of access control is most appropriate for the network. The current access control
    12·1 answer
  • 15 points. Please give an actual answer and not some random thing. this is not just free points. Correct answer will receive bra
    12·2 answers
  • Hyperlink is a term used to refer to the specific manner of specifying the address of a website. Write reason for true or false.
    10·1 answer
  • How Powerpoint is useful in education aspect?
    5·2 answers
  • To set up scenarios, you need to first use ______ to set up a list, then ______ to set up the reference cell. Last you need to u
    7·1 answer
  • 8) how many nanoseconds does it take for a computer to perform one calculation if it performs 6.7 x 107 calculations per second?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!