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
I want pizzzzzzzaaaaaaaaaaa
hjlf
Sameeeeeeeeeeeeeeeeeeeee
8 0
3 years ago
Which of the following is the BEST reason to use cash for making purchases? everfi
alexgriva [62]

Answer: knowing what you spend".

Explanation:

The reason to use cash for making purchases is to know how much one has spent.

When we use cash rather than using credit card, it's easier for one to know how much that has been spent. Also, one can easily know when he or she need to stop spending. Therefore, the correct answer is "knowing what you spend".

8 0
3 years ago
Is the cell phone changing our views about polite and impolite behavior? For example,
Otrada [13]

a cell phone is changing our views in both polite and unpolite ways because these days I see people at dinner tables on their phones taxting and not actually socializing with the people around them but at the same time people who like other people posts on instagram and wright good comments are being very polite to the person who posts it.

4 0
3 years ago
Read 2 more answers
Which do web servers host?<br> Websites<br> Networks<br> Firewalls<br> Zones
bixtya [17]

Answer:

Websites

Explanation:

A web server host websites, individuals or corporate websites, this helps us to show our websites in the World Wide Web, there are several companies offers this service, even we can get a free host, but a corporate website or a social media needs a lot of host recourses, these hosts are expensive than other, we could pay a web host monthly or per year.

6 0
3 years ago
How many times is the function wordScramble() called in the given program? public class WordScramble { public static void wordSc
Ainat [17]

Answer:

The answer is "2"

Explanation:

  • In the given java program code, a class WordScramble is declared, inside the class, a static method wordScramble is declared, that accepts two string parameter that is "rem and scr".
  • Inside the method a conditional statement is used in the if the block it checks rem variable value is empty so, it will add rem and scr value.  Otherwise, it will go to else block in this a loop is defined, which calls the method, which calculates rem length that is 2, and this method call two times to rearrange the values.
  • In the next step main method is defined that calls wordScramble method, which passes only one argument "ab" in its first parameter.
  • This method accepts one string value, in which there are two numbers   "a and b" that's why the method will run two times.  
6 0
3 years ago
Other questions:
  • A network administrator is implementing dhcpv6 for the company. the administrator configures a router to send ra messages with m
    6·1 answer
  • Define the missing function. licenseNum is created as: (100000 * customID) + licenseYear. Sample output:
    10·2 answers
  • On the Picture Tools Layout tab, you can preview results of the numerous styles, borders, effects, and layouts by _______ comman
    7·2 answers
  • The document responsible for describing the type of data stored in the database is called the:
    5·1 answer
  • In the Dynamic Partitioning technique of memory management, the placement algorithm that scans memory from the location of the l
    11·1 answer
  • 14. Which of the following statements is true? A. The most secure email message authenticity and confidentiality isprovided by s
    11·1 answer
  • When two or more tables share the same number of columns, and when their corresponding columns share the same or compatible doma
    12·1 answer
  • Write a program to enter length of a square and print area of square.<br>(class 8)​
    9·2 answers
  • Excerpt from "How Prepared Are Students for College Level Reading? Applying a Lexile-Based Approach."
    6·1 answer
  • What is the base of a number system?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!