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
solong [7]
3 years ago
8

Suppose there is a class AirConditioner. The class supports the following behaviors: turning the air conditioner on and off. The

following methods are provided for these behaviors: turn_on and turn_off. Both methods accept no arguments and return no value. There is a reference variable office_a_c of type AirConditioner. Create a new object of type AirConditioner using the office_a_c reference variable. After that, turn the air conditioner on using the reference to the new object.
Computers and Technology
1 answer:
Sunny_sXe [5.5K]3 years ago
8 0

Answer:

The code is given in the explanation section

Explanation:

//Class Airconditioner

public class AirConditioner {

   private boolean turnOnOff;

//The Constructor

   public AirConditioner(boolean turnOnOff) {

       this.turnOnOff = turnOnOff;

   }

//method turn_on

   public void turn_on(){

       this.turnOnOff = true;

   }

//method turn_off

   public void turn_off( ){

       this.turnOnOff = false;

   }

}

// A new class to test the airconditional class

class AircondionTest{

   public static void main(String[] args) {

//Creating an object of the Aircondional class

       AirConditioner office_a_c = new AirConditioner(false);

//Using the reference varible to call method turn_on      

office_a_c.turn_on();

   }

}

You might be interested in
1 what elements of composition are under your control in photoshop
inn [45]
Tone
Sharpness
Scale
Arrangement
7 0
3 years ago
Create a cell reference in a format by typing in the cell name or
Neko [114]

Answer:

D. Create a cell reference in a formula by typing in the cell name or clicking the cell.

Further Explanation:

To create a cell reference in a formula the following procedure is used:

First, click on the cell where you want to add formula.

After that, in the formula bar assign the equal (=) sign.

Now, you have two options to reference one or more cells. Select a cell or range of cells that you want to reference. You can color code the cell references and borders to make it easier to work with it. Here, you can expand the cell selection or corner of the border.

Again, now define the name by typing in the cell and press F3 key to select the paste name box.

Finally, create a reference in any formula by pressing Ctrl+Shift+Enter.

6 0
2 years ago
You would like the user of a program to enter a customer’s last name. Write a statement thaUse the variables k, d, and s so that
mojhsa [17]

Answer:

1st question:

Use the variables k, d, and s so that they can read three different values from standard input an integer, a float, and a string respectively. On one line, print these variables in reverse order with exactly one space in between each. On a second line, print them in the original order with one space in between them.

Solution:

In Python:

k = input()  #prompts user to input value of k i.e. integer value

d = input()  #prompts user to input value of d i.e. float value

s = input()  #prompts user to input value of s i.e. a string

print (s, d, k)  #displays these variable values in reverse order

print (k, d, s)#displays these variable values in original order

In C++:

#include <iostream>    // to use input output functions

using namespace std;   //to identify objects like cin cout

int main() {    //start of main function

  int k;   //declare int type variable to store an integer value

  float d; //  declare float type variable to store a float value

  string s;   //  declare string type variable to store an integer value

  cin >> k >> d >> s;    //reads the value of k, d and s

  cout << s << " " << d << " " << k << endl;     //displays these variables values in reverse order

  cout << k << " " << d << " " << s << endl;   } // displays these variable values in original order

Explanation:

2nd question:

You would like the user of a program to enter a customer’s last name. Write a statement that asks user "Last Name:" and assigns input to a string variable called last_name.

Solution:

In Python:

last_name = input("Last Name:")

# input function is used to accept input from user and assign the input value to last_name variable

In C++:

string last_name;  //declares a string type variable named last_name

cout<<"Last Name: ";  // prompts user to enter last name by displaying this message Last Name:

cin>>last_name; // reads and assigns the input value to string variable last_name

The programs alongwith their outputs are attached.

6 0
3 years ago
Part1) Given 3 integers, output their average and their product, using integer arithmetic.
Mrac [35]

Answer:

The program is as follows:

#include <iostream>

#include <iomanip>

using namespace std;

int main(){

   int num1, num2, num3;

   cin>>num1>>num2>>num3;

   cout << fixed << setprecision(2);

   cout<<(num1 + num2 + num3)/3<<" ";

   cout<<num1 * num2 * num3<<" ";

   return 0;

}

Explanation:

This declares three integer variables

   int num1, num2, num3;

This gets input for the three integers

   cin>>num1>>num2>>num3;

This is used to set the precision to 2

   cout << fixed << setprecision(2);

This prints the average

   cout<<(num1 + num2 + num3)/3<<" ";

This prints the product

   cout<<num1 * num2 * num3<<" ";

6 0
3 years ago
Which section of a personal narritive requires the most development?
Naily [24]
A characters introduction because a personal narrative is a thing written about a person/charector
4 0
2 years ago
Other questions:
  • Structured walk-throughs take place throughout the SDLC and are called _____ reviews, depending on the phase in which they occur
    9·1 answer
  • Pros and cons of access to a wide range of online services when it comes to an individual's safety?
    14·1 answer
  • If you filmed a clip in 120fps, how many frames are in a seconds of video.
    13·1 answer
  • Which character goes at the end of a line of code that starts with if?
    8·1 answer
  • #Write a function called alter_list. alter_list should have#two parameters: a list of strings and a list of integers.##The list
    11·1 answer
  • The purpose of a software design is to enable programmers to implement the requirements by designating the projected parts of th
    14·1 answer
  • What name is given to the method used to copy a file onto a CD
    11·1 answer
  • Please help! I tried this by myself. But I am not sure if this is right.
    8·2 answers
  • What is problem scoping
    14·1 answer
  • Write a logical expression using only and, or and not that is equivalent to the Exclusive NOR (XNOR) gate on 2 inputs, called in
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!