Answer:
<u>Window.java</u>
- public class Window {
- int width;
- int height;
-
- public Window(int width, int height){
- this.width = width;
- this.height = height;
- }
- public int getWidth(){
- return width;
- }
- public int getHeight(){
- return height;
- }
-
- public int getClientAreaHeight(){
- return getHeight();
- }
- }
<u>Main.java</u>
- public class Main {
- public static void main (String [] args) {
- Window win1 = new Window(12, 15);
- System.out.println(win1.getClientAreaHeight());
- }
- }
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.
#First we define the variables to house the temperatures
#temp is an empty array that will be used to store the temperature
Temp = []
#The months is defined as stated below
months = 12
#Ask the user for the temperature input and unit if possible
print("Kindly enter the temperature here")
#the program enter loop to get the temperatures.
for x in range(months):
InitTemp = str(input("Kindly add the unit behind the number .eg C for celcius"))
Temp.append(InitTemp)
j=0
for x in range(len(Temp)):
j=j+1
print("The Temperature is", " ", Temp[x], "for the ", j, "Month" )
#there is an attached photo for the flowchart
False. You should have little text and lots of pictures, because you are the one who should be doing the explaining, not the presentation.
Answer:
It is bit { measurement used to quantify computer data. }
twitter
they will allow you to share comments about any topic you want