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]
4 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]4 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
A DSS8440 server is equipped with one power supply that is failing and requires replacement. What is the correct sequence of ste
Alisiya [41]

Answer:

ICICI oxidized sicken o'clock o'clock succinct

6 0
3 years ago
What type of devices are the keyboard and the mouse?
Angelina_Jolie [31]
 A keyboard is the primary device to enter text that consists of alphabet keys, numeric keys and other specialized keys. a mouse may include one or more buttons and a scroll wheel and works by moving across a smooth surface to signal movement of the pointer. Both are plug and play( PnP).
6 0
3 years ago
Read 2 more answers
_____ consists of computer programs that govern the operation of a computer.
telo118 [61]
Hello <span>Siyujiang8092</span>

Answer: Software<span> consists of computer programs that govern the operation of a computer.

Hope that helps
-Chris</span>
6 0
4 years ago
Which of the following translates packets so that the node can understand them once they enter through a port?
FinnZ [79.3K]
A cluster compute server includes nodes coupled in a network ... Each VNIC typically is assigned its own MAC address by the VMM or VM, ... translation or mapping storage at the NIC of each node in the cluster ...... a wired or wireless network (e.g., network accessible storage (NAS)). .... Google Translate ...
5 0
4 years ago
Read 2 more answers
In cell a10 enter a formula using or to display true if net profit before tax in 2019 (cell b5) are greater than 750000(seven hu
mina [271]

The OR Excel function is a function that is used to test several conditions in one statement.

The Excel formula to display true based on the conditions in cell A10 is =OR(B5>750000,C5>750000)

From the question, we have:

  • Cell B5 represents the net profit before tax in 2019
  • Cell C5 represents the net profit before tax in 2020

The syntax of the OR logical function is: =OR([conditions])

So, the Excel formula to display true based on the conditions in cell A10 is =OR(B5>750000,C5>750000)

Read more about Excel formulas at:

brainly.com/question/14820723

4 0
3 years ago
Other questions:
  • Which statement correctly describe the FAFSA
    5·2 answers
  • Which View option allows you to view your document as it would appear when posted online?
    8·1 answer
  • If we are using an 4-character password that contains only lowercase English alphabetic characters (26 different characters), ho
    15·2 answers
  • You are building a gaming computer and you want to install a dedicated graphics card that has a fast GPU and 1GB of memory onboa
    6·1 answer
  • What are the three primary separation of concerns on the client-side of a dynamic web application? (Check all that apply)
    13·1 answer
  • You are troubleshooting a mobile device with no sound output from the headset or external speakers.
    6·1 answer
  • For this scenario related to turtle drawing, indicate whether it is better to write a loop or a function (or a set of functions)
    13·1 answer
  • UserInp = input("Did you like the story?")
    7·1 answer
  • Write function that ask for input from a user. Use this input as input for the countdown function that we wrote using the while
    6·1 answer
  • In critical thinking, an argument is:
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!