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
When an application contains an array and you want to use every element of the array in some task, it is common to perform loops
Elodia [21]

Answer:

 Option A(True) is the correct answer for the above question.

Explanation:

  • An array is used for the collection variables which is of the same type and uses memory in continuous Passion for the storage.
  • When any user wants to use the array then he needs to declare the size and type of the array because array holds the same type of data.
  • For example, int a[5] is an array of integer variable whose name is 'a' and the size is 5 in c language.
  • Anyone can use the array with the help of the index value of the array. The starting index value is 0 and the ending index value is (size-1) for any array.
  • The user can use it by the help of loop, in which the loop variable refers to the index of the array and it starts from 0 and ends in the (size of the array-1).
  • It is because the loop executes the same line multiple times.
  • The above statement also wants to state, which is defined as above. Hence the above statement is true which is referred by option A. Hence option A is the correct answer.
7 0
3 years ago
A compressed file uses a(n) ____ as the last character in the file extension.
rjkz [21]
If it was done with the compress command, capital Z
6 0
3 years ago
Aaron is staying at a hotel that charges $100 per night plus tax for a room. A tax of 8% is applied to the room rate per day and
DerKrebs [107]

Answer:

We use the Python language to implement the code, if you have and IDE, simply copy and paste the code and run it

Note: the cost function is  c=(R+ .08*d)+5

Explanation:

#initialize some variables

T = 0.08 # tax for each day

F = 5.00 # one time fee

R = 100 # room rate

d = int(input("Enter the number of days stayed at the hotel "))

c = 0 # initialize cost variable

if (d > 0):

   c=(R+ .08*d)+5

   print(" the cost for ", d, " days is ", c )

else:

   print(" Invalid entry for days ", d )

7 0
3 years ago
Identify the potential impact to IT security of incorrect configuration of firewall policies and third- party VPNs
yan [13]

Answer:

why is it necessary to fight against social evils and problem

5 0
2 years ago
Why do software developers prefer to use high-level language to author programs? A. It can be used on computers without micropro
aalyn [17]

Answer:

the answer is B.....

Explanation:

4 0
3 years ago
Other questions:
  • To view the contents of a file that was compressed with the bzip2 utility, you must used the ____________________ command.
    9·1 answer
  • Complete the getNumOfCharacters() method, which returns the number of characters in the user's string. We encourage you to use a
    15·1 answer
  • When activated, an Excel object has all the features of an Excel
    8·2 answers
  • "list at least 3 key performance indicators that should be considered prior to initiating a cloud deployment."
    15·1 answer
  • What data unit is encapsulated inside a packet?
    5·2 answers
  • After which stage in the information processing cycle can data be referred for future use?
    7·1 answer
  • What are the major functions of a computer
    7·1 answer
  • Given an integer n and an array a of length n, your task is to apply the following mutation to an: Array a mutates into a new ar
    5·1 answer
  • Which os the following is NOT true about the proof of work concept?
    8·1 answer
  • Declare an ArrayList of Strings. Add eight names to the collection. Output the Strings onto the console using the enhanced for l
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!