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
Juliette [100K]
3 years ago
15

Assume the existence of a Window class with a function getWidth that returns the width of the window. Define a derived class Win

dowWithBorder that contains a single additional integer instance variable named borderWidth, and has a constructor that accepts an integer parameter which is used to initialize the instance variable. There is also a function getUseableWidth, that returns the width of the window minus the width of the border.
Computers and Technology
1 answer:
Pepsi [2]3 years ago
5 0

Answer:

Following are the code in the C++ Programming Language.

//define class and inherited the parent class

class WindowWithBorder : public Window

{

//access modifier

private:

//set integer variable

int borderWidth;

//set integer variable

int windowWidth;

//access modifier

public:

//definition of the constructor that accept an integer type argument

WindowWithBorder(int);

//definition of the function

int getUseableWidth();

};

//set constructor outside the class

WindowWithBorder::WindowWithBorder(int y)

{

//initialization in integer variable from function

windowWidth = getWidth();

//initialization in integer variable from the argument list

borderWidth = y;

}

//set function from outside the class

int WindowWithBorder::getUseableWidth()

{

//return output

return windowWidth - borderWidth;

}

Explanation:

Here we define a class "WindowWithBorder" which inherit their parent class "Window", inside the class.

  • Set two integer data type private variables "borderWidth" and "windowWidth".
  • Write the definition of the "windowWidth" class constructor that accept the integer type argument list.
  • Write the definition of the function "getUseableWidth()" which is integer type.

Then, we define constructor outside the class which accept the integer type argument list "y" inside it.

  • we initialize in the variable "windowWidth" from the function "getWidth()".
  • Initialize in the variable "borderWidth" from the argument of the constructor.

Finally, we define function in which we perform the subtraction of the variable "windowWidth" from the variable "borderWidth" and return it.

You might be interested in
What are two types of organizational structures designed to help an organization achieve its goals and objectives?
Fittoniya [83]

The answer is entrepreneurial and bureaucratic. Organizations that are large and small can achieve higher sales and other profit by properly matching their needs with the structure they use to operate.   the structure of an organization can help or hinder its progress toward accomplishing these goals and This are specific set up of organizations and ways to accomplish different goals. 

4 0
3 years ago
Read 2 more answers
Which of the following statements is true regarding ARPANET? Select 3 options. It was a product of Bell Laboratories and was int
vlada-n [284]

Answer:

2. It was created to connect geographically dispersed researchers with high powered research computers.

3. The first message was sent through ARPANET in 1969 and it was decommissioned in 1990.

5. It led to the development of the Internet.

Explanation:

4 0
3 years ago
Which Ribbon contains the paragraph attributes?<br><br> Home<br> Insert<br> Review<br> View
Lemur [1.5K]
The Home ribbon contains the Paragraph attributes
7 0
3 years ago
Read 2 more answers
Ben uses a table that has few columns. He knows about a particular value in the first column and wants to find the corresponding
igor_vitrenko [27]
I'd suggest he uses LOOKUP Function.

You can use the LOOKUP function when you need to look in a single column or row and find a value from the same position in a corresponding column or row. We have a much improved VLOOKUP that can also be used to search one row or column or multiple rows and columns.



4 0
3 years ago
Read 2 more answers
The help desk received a call from a user who cannot get any print jobs to print on the locally shared printer. While questionin
erma4kov [3.2K]

Answer:

a. Power cycle the printer.

Explanation:

Power Cycle: To unplug the printer and restart it, is called power cycling. The peripheral devices often tend to stop working and the cause of this is not always easily figured out. So the first and easiest way that can be done to fix this issue is to run a power cycle. For this, you have to turn off the printer and unplug it. Then wait for a few seconds (at least 30) and plug in the printer again. Turn the printer on. Power cycle helps to resolve many basic issues. It is the easiest step to take before checking the printer cable, reinstalling printer or resetting the print spooler.

4 0
2 years ago
Other questions:
  • What will be the output of “AAAAMMMMMHHHVV” using a file compression technique?
    9·2 answers
  • What types of storage can be used to access your data on another computer?
    6·2 answers
  • An athlete runs every day for five days. Write a program that computes the total distance and average distance ran by the athlet
    10·1 answer
  • (1) Create three files to submit:
    8·1 answer
  • How can injection attacks be prevented? Check all that apply
    6·2 answers
  • Impact of information technology in the society​
    11·1 answer
  • Write a python program that should determine from the range you choose to enter :
    9·1 answer
  • Write a function template that accepts an argument and returns its absolute value. The absolute value of a number is its value w
    11·1 answer
  • What is a cookie? *
    9·2 answers
  • When you type in text in an image in a photo-editing software, where is it created?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!