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
Tomtit [17]
3 years ago
9

python There is a reference variable office_a_c of type AirConditioner. Create a new object of type AirConditioner using the off

ice_a_c reference variable. After that, turn the air conditioner on using the reference to the new object.
Computers and Technology
1 answer:
Kay [80]3 years ago
8 0

Answer:

  1. class AirConditioner:
  2.  def __init__(self, a_c=False):
  3.    self.office_a_c = a_c  
  4. ac = AirConditioner()
  5. ac.office_a_c = True

Explanation:

Firstly, create a class and name it as AirConditioner (Line 1).

Next in the class constructor, create the reference variable office_a_c (Line 3). Please note the reference variable shall be preceded with a self keyword. Besides, the reference variable is set to False by default.

Create an AirConditioner object (Line 6) and then use the dot syntax (.) to set the object reference variable office_a_c to True.

You might be interested in
what is A/An called for a series of instructions or commands that a computer follows used to create software
Aleonysh [2.5K]
A Computer Program is a series of instructions or commands that a computer follows to create a software..
5 0
3 years ago
Class Product {
blagie [28]

Answer:

D. Compilation Fails

Explanation:

There is an error in the program, which if not correct will hinder the successful compilation of the program and will give a compilation error

The error is at doucble newPrice = 100;

The data type has to be spelt correctly to ensure the program is executed successfully

To declare variable newPrice of type double and also initialize it to 100, the right syntax is double newPrice = 100;

After correcting the error, the program will run correctly and produce the following result:

400.0 : 100.0

At line 2 of the main method, an instance of class Product is declared "Product prt = new Product();"

This allows values to be passed between the main method and the class

In class Test

price takes its value from newPrice (in the main method)

So, when newPrice is 100.0

price = 100.0 * 2

price = 200.0

After which product.price is calculated

product.price takes its value from prt.price (in the main method)

So, when prt.price is 200.0

product.price=product.price + price (Recall that price is 200.0; as illustrated above)

product.price = 200.0 + 200.0

product.price = 400.0

At line 5 of the main method, an instance of class Test is declared "Test t = new Test ();"

The next line t.updatePrice ( prt, newPrice);  assigns the calculated values to prt and newPrice respectively

prt = 400.0

newPrice = 100.0

The output is done on the next line: System.out.println(prt.price + " : " + newPrice);

prt.Price = prt = 400.0 and newPrice = 100.0

Hence, the output will be done in the following order 400.0 : 100.0

5 0
3 years ago
Read 2 more answers
Write a program that gives simple math quizzes. The program should display two random numbers that are to be added, such as:
cestrela7 [59]

Answer:

6

Explanation:

8 0
3 years ago
Read 2 more answers
Which of these colors is most likely to be outside the CMYK gamut?
erma4kov [3.2K]
CMYK does not include a white color because it is assumed that it will be printed on a white paper and depending on the percentage of each color that is used, the white from the paper will be used to fill the space, therefore making the shades appear lighter. If it's something that will only be seen digitally, use RGB.
3 0
3 years ago
What type of diagram does the following image depict?
ryzh [129]

Answer:

i may be able to help you how long ago did you ask this

Explanation:

3 0
3 years ago
Other questions:
  • When you are shopping online and finalizing your order, you usually fill in forms for your name, address, email, and payment met
    6·1 answer
  • According to the text, the judicious use of elements such as bullets, numbers, boldface, italics, and capitalization in document
    7·1 answer
  • I'd like to edit a picture so that I can remove the background behind an object and have it replaced with a transparent backgrou
    13·2 answers
  • Write a date transformer program using an if/elif/else statement to transform a numeric date in month/day format to an expanded
    14·1 answer
  • All of the following are aspects of the search process except
    8·1 answer
  • Write a C function (NOT A COMPLETE PROGRAM) which uses the RETURNstatement to calculate and return the total cost for purchasing
    7·1 answer
  • 40 points to answer ALL
    9·2 answers
  • Truck drivers probably can't see your vehicle if ______________.
    11·2 answers
  • Write a filter that reads in a sequence of integers and prints the integers, removing repeated values that appear consecutively.
    5·2 answers
  • What are the advantages of customer relationship managment​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!