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
The Universal Containers research lab is publishing its latest research into knowledge articles assigned to the data category "C
Olenka [21]

Answer:

Option C is correct.

Explanation:

The following research laboratory publishes their new work concerning articles of information allocated to the better standards container classification of information. The community manager needs to ensure all of those posts appear across the Tips and Methods subject field for Community users.

Thus, set up an automatic subject assignment and map the list of Tips and Techniques to the Container good practices group.

8 0
3 years ago
What does the abbreviation BBC stands for?
kati45 [8]

Answer:

British Broadcasting Corporation Microcomputer System

Explanation:

The British Broadcasting Corporation Microcomputer System, or BBC Micro, is a series of microcomputers and associated peripherals designed and built by the Acorn Computer company in the 1980s for the BBC Computer Literacy Project.

4 0
3 years ago
Read 2 more answers
WILL GIVE BRAINLIEST TO WHOEVER CAN HELP!!!!!!!!!!!!!!
Ne4ueva [31]
You might have to get one of these i use it at home for many things like this. You can use it for any type of speaker or audio plug in.

https://www.google.com/search?q=3.55+mm+jack&rlz=1C1GGRV_enUS758US758&tbm=isch&source=iu&ictx=1&fir=...:

7 0
4 years ago
Although there are three well-known operating systems, the most common are Microsoft Windows and Mac OS. Discuss the similaritie
tiny-mole [99]

Answer:

There are very few similarities beyond some convergent features of their respective user interfaces. Their internal architecture is very different, differing from kernel models to shell integration to executable formats. A comprehensive list of similarities is neither possible nor useful, because it would consist mostly of obvious statements like "They are both operating systems" or "They both have graphical user interfaces, "They both include

Explanation:

How's that?

7 0
3 years ago
Setting up a home network using wireless connections is creating a _____.
Olin [163]
The answer to setting up a home network using wireless connections is creating a (C) WAN
3 0
3 years ago
Other questions:
  • The term composite would be used to describe an image that was altered by the Crop tool.
    15·1 answer
  • Word processing programs have different view options that you can use depending on the tasks you’re performing. Which option hel
    11·1 answer
  • Which of the following refers to the data analysis software and interactive software that allow managers to conduct analyses and
    6·1 answer
  • Although highly accurate navigational information from the GPS constellation is exploitable by adversary forces, it is unlikely
    5·1 answer
  • Como funciona la televisión
    7·1 answer
  • What is the purpose of a poster frame?
    5·2 answers
  • What materials can I find at home and make a cell phone tower​
    11·1 answer
  • Write the complete class declaration for the class Advance. Include all necessary instance variables and implementations of its
    11·1 answer
  • What is computer system ?​
    9·2 answers
  • Communication between a computer and a keyboard involves ______________ transmission.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!