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
Solnce55 [7]
4 years ago
7

Assume the existence of a Window class with a constructor that accepts two integer parameters containing the width and height of

the window (in that order). Assume a subclass TitledWindow has been defined that has two instance variables: a string named text for the text of the title and, an integer, titleBarHeight for the height of the title bar. Write a constructor for TitledWindow that accepts four parameters: two integers containing the width and height (which are passed up to the Window constructor), and, a string and integer which are used to initialize the TitledWindow instance variables. The height of the title bar should be 'clamped' by the constructor to one half the height of the window-- i.e., if the height of the title bar passed into the constructor is greater than one half the specified height of the window, it should be set to one half the height of the window.
Computers and Technology
1 answer:
zysi [14]4 years ago
8 0

Answer:

The answer to the following question:  

TitledWindow(int titleBarHeight, int height, int width, String text)  //define subclass and pass an argument of four variable  

{

//define constructor and pass an argument of two variable

super(height, width);  

this.text = text;  

//set if condition

if (titleBarHeight > height / 2)  

titleBarHeight = height / 2;  

this.titleBarHeight = titleBarHeight;

}

Explanation:

Here, we have define a subclass of the "Window" class i.e., "TitledWindow" and pass four variable in the argument.

Then, define constructor and pass two variable in the argument.

Then, set if condition and pass the condition "titleBarHeight > height / 2".

You might be interested in
Add a clause for identifying the sibling relationship. The predicate on the left handside of the rule should be sibling(X, Y), s
jolli1 [7]

Answer:

following are the solution to this question:

Explanation:

For Siblings (X,Y);

Alice(X),

Edward(Y),

parent(Edward,Victoria,Albert) //Albert is the father F

parent(Alice,Victoria,Albert)  //Victoria is the Mother M

Therefore,

X is siblings of Y when;

X is the mother M and father is F, and  Y is the same mother and father as X does, and satisfing the given condition.

It can be written as the following prolog rule:

Siblings_of(X,Y):

parents(X,M,F)

parents(Y,M,F)

Siblings_of(X,Y): parents(X,M,F), parents(Y,M,F)

|? - sibling_of(alice,edward).

yes

|? - Sibling_of(alice,X).

X=Edward

|? - Sibling_of(alice,alice).

yes

5 0
3 years ago
Wireless networks usually use ____ signals to send data.
barxatty [35]
<span>Wireless networks usually use radio (b) signals to send data. </span>
6 0
3 years ago
Read 2 more answers
Who designed the apple i computer in 1976?
guajiro [1.7K]

Steve jobs designed the first apple computer


6 0
3 years ago
Read 2 more answers
Which functions are available in a Word table? Check all that apply.
dexar [7]
All of them are available
3 0
3 years ago
why does this site force you to make an account to get literally anything at all i want to pass the 9th grade not watch 5 ads pe
cricket20 [7]

Answer:

They do anything for money sis

Explanation:

4 0
4 years ago
Other questions:
  • Which loan type requires you to make loan payments while you’re attending school?
    7·1 answer
  • A must decode this code. I guess is not a Cesar. The last line is a email adress.
    15·1 answer
  • Dallas is an analyst at an online retailer. He is great at creating representative diagrams showing the relationships between cu
    12·1 answer
  • A manger wants to hire a new technician for the desk that typically assists clients with simple computer problems over the phone
    9·1 answer
  • How do you compare text on different pages of a document?
    14·1 answer
  • The Institute of Electrical and Electronics Engineers (IEEE) is an organization that researches and institutes electrical standa
    15·2 answers
  • I will give brainliest !!
    15·1 answer
  • The Carolina International School is more Earth-friendly than typical schools because
    7·1 answer
  • the actual use and implementation of computer started after third generation justify this statement in your own words.​
    6·1 answer
  • if we try to use tail-recursive rules to implement non-tail-recursive rules, it will normally result in rules that are
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!