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
ozzi
3 years ago
15

The 'client area' of a window is the area used to display the contents of the window (thus a title bar or border would lie outsi

de the client area). For the Window class, the client area is nothing more than the entire window, and thus the height of the client area is nothing more than the value of the height instance variable. Assuming the existence of a Window class with existing methods, getWidth and getHeight, add the method getClientAreaHeight that returns the height (an integer) of the client area of the window.
Computers and Technology
1 answer:
Lady_Fox [76]3 years ago
4 0

Answer:

<u>Window.java</u>

  1. public class Window {
  2.    int width;
  3.    int height;
  4.    public Window(int width, int height){
  5.        this.width = width;
  6.        this.height = height;
  7.    }
  8.    public int getWidth(){
  9.        return width;
  10.    }
  11.    public int getHeight(){
  12.        return height;
  13.    }
  14.    public int getClientAreaHeight(){
  15.        return getHeight();
  16.    }
  17. }

<u>Main.java</u>

  1. public class Main {
  2.    public static void main (String [] args) {
  3.        Window win1 = new Window(12, 15);
  4.        System.out.println(win1.getClientAreaHeight());
  5.    }
  6. }

Explanation:

<u>Window.java</u>

There is a Window class with two int type attributes, width and height (Line 1 - 3).

The constructor of this class will take two inputs, width and height and set these input to its attributes (Line 5 - 8). There are two methods getWidth and getHeight which will return the value of attributes width and height, respectively (Line 10 - 16).

The required new method getClientAreaHeight is defined in line 18 -20. This method will call the getHeight method to return the height value of the window (Line 19).

<u>Main.java</u>

We test the Window class by creating one Window instance and call the getClientAreaHeight method and print the return output (Line 1 -6).

We shall see 15 is printed.

You might be interested in
Adding Calculator Write a program that simulates an adding machine. Input to the program will be integers, submitted one per lin
Marysya12 [62]

Answer:

This is really hard. I tried doing this problem but of was a real pain. I honestly can't help. I tried. sorry mate.

7 0
3 years ago
A junior network administrator tells you that he can ping a DNS server successfully using its IP address, but he has not tested
Darya [45]

Answer:

nslookup is the correct answer to the following question.

Explanation:

The following answer is correct because It is the tool or the utility of the command line by which an administrator to query a DNS(Domain Name System) for finding the domain name or the Internet Protocol address or many other records.

<u>Steps to use nslookup:</u>

  • Firstly, you have to press the window key + R to open run.
  • Then, you have to type cmd in it and press enter.
  • Then, cmd will appear after that, you have to type the command 'nslookup' and then press enter.
  • Then, it shows the default server name and ip address after that, you have to type an ip address of DNS server.
  • Then, you have to type 'set' then type q=M X and then press enter
  • Then, you have to type the name of your domain then, press enter key.

7 0
3 years ago
A good reference point for determining the position of a line or curb in front of you is your __________ . A. Hood ornament B. L
Hatshy [7]
I am pretty sure it’s A
5 0
3 years ago
7+9 help me pleas i dont know help now
natali 33 [55]

Answer:

16

Explanation:

because it is

4 0
2 years ago
Read 2 more answers
Calculate the total and average number from 1 to 100<br>​
Vikentia [17]

Answer:

Thus, 50.5 is an average of numbers from 1 to 100.

Explanation:

getcalc.com's average calculator to find what is the mean or average of natural numbers upto 100.

50.5 is an average of numbers from 1 to 100 mentioned in the below table, by substituting the total sum and count of numbers in the below formula. The corresponding formulas, chart, examples & workout may help students, teachers or professionals to learn, teach or practice the average of natural numbers upto 100.

Address the formula, input parameters & values.

Formula: Average = Total Sum of Numbers / Total Count of Numbers

Input parameters & values:

The numbers from 1 to 100 are

1, 2, 3, 4, . . . . , 98, 99, 100

Total Count of Numbers = 100

step 2 Find the sum of numbers from 1 to 100.

sum = 1 + 2 + 3 + . . . . + 99 + 100

= 5050

step 3 Divide the sum by 100 Average = 5050/100 = 50.5

Thus, 50.5 is an average of numbers from 1 to 100.

4 0
3 years ago
Other questions:
  • Secure Hashing Algorithm (SHA) is an algorithm for generating cryptographically secure one-way hash, published by the National I
    6·1 answer
  • What do you think is the meaning of the saying "Sticks and stones may break my bones, but words can never hurt me"? Do think tha
    5·1 answer
  • Sally needs to copy data from the first worksheet to the fifth worksheet in her workbook. Which combination of keys will she use
    11·2 answers
  • When you need to move data over long distances using the internet, for instance across countries or continents to your amazon s3
    5·2 answers
  • Consider the classes below:
    13·1 answer
  • What reason best explains why complementary colors are important to web page design?
    5·2 answers
  • A certain social media Web site allows users to post messages and to comment on other messages that have been posted. When a use
    7·1 answer
  • Which online article citation is correctly formatted according to MLA standards?
    15·2 answers
  • PLEASE HELP! :)
    14·1 answer
  • Which of the following is the best way to remember the points you want to make during the presentation of your slide show?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!