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
What is a data mining??
Nadusha1986 [10]
Data mining is the process in which large values of raw data are interpreted to extract something useful out of it. With the help of software, finding pattern using these large data is the main point.


Hope my answer would be a great help for you.    If you have more questions feel free to ask here at Brainly.
3 0
3 years ago
Name the contributions of Steve Jobs and Bill Gates, with respect to technology.
Sergio [31]

Answer: Steve Jobs made several contributions towards technology by introducing the range of Apple devices and technologies .he started the Apple Incorporation.The technologies introduced by his company are as follows:-

  • iPod
  • iPhone
  • Apple Lisa
  • iMac
  • iPad etc.

 Bill Gates is the founder of Microsoft incorporation and made a lot of development in that field to create various software for the operating system.the creation of "Microsoft Window" was started by him and some other contributions are as follows:

  • Windows 7
  • Windows 8
  • Vista
  • XP
  • windows 95 etc.
3 0
3 years ago
Gregory Yob is associated with which of these games?
DiKsa [7]

Answer:

Gregory Yob is associated with Hunt the Wumpus.

Explanation:

Hunt the Wumpus was developed in 1973 by Gregory Yob and was one of the first games where the player can move around a series of interconnected controls.

please mark brainliest it really helps :)

3 0
3 years ago
Read 2 more answers
A _____ software system determines the steps needed to produce components and instructs the machines that do the work.
konstantin123 [22]

Answer:

A computer-aided manufacturing or (cam) software system

Explanation:

Hope I could help :)

8 0
2 years ago
C++
Nookie1986 [14]

Answer:

Following are the code to the given question:

#include <iostream>//header file

using namespace std;

class Window //defining a class Window

{

private:

int width, height;//defining integer variable

public:

friend ostream& operator << (ostream& stm, Window& width)//defining a friend function that takes two parameters

{

return stm<<"a ("<<width.width<<" x "<<width.height<<") window"; //use return keyword that return its values

}  

Window(int width, int height): width(width), height(height)//defining parameterized constructor that inherit width and height in its parameters  

{}

};

int main() //Main method

{

Window w(80,90);//calling class constructor

cout<<w;//print object value

return 0;

}

Output:

a (80 x 90) window

Explanation:

In the above code, a class "Window" is defined that uses a friend function "ostream& operator" is declared that uses the "ostrea&" as a data type to hold two-variable "stm and w" in its parameter, and declared the parameterized constructor to hold value by inheriting width and height in its parameters.

Inside the main method, a class object is created that calls the constructor and uses the print method to print object value.

7 0
3 years ago
Other questions:
  • When numbers are changed in cells that are involved in formula is the formulas are automatically
    14·1 answer
  • The two ways to use the help menu is by searching of the contents or searching the _____
    13·2 answers
  • What is Processor to Memory Mismatch problem?
    15·1 answer
  • You are a network security administrator for a bank and you have noticed that an attacker has exploited a flaw in OpenSSL and fo
    9·1 answer
  • Write a program that prompts the user to input five decimal numbers. The program should then add the five decimal numbers, conve
    5·1 answer
  • Calculate the change in RGDP if the MPC is .6 and initial spending is $500,000.
    8·1 answer
  • Two strings, and , are called anagrams if they contain all the same characters in the same frequencies. For example, the anagram
    13·1 answer
  • Using direct mapping, consider a 16-bit memory addresses, and a cache with 64 blocks, where each block is 8 bytes. What is the s
    8·1 answer
  • 7. Type the correct answer in the box. Spell all words correctly.
    8·1 answer
  • What are the main differences between openldap and microsoft's active directory (ad)? check all that apply
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!