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.
By default, if you do not implement a constructor, the compiler will use an empty constructor (no parameters and no code). The following code will create an instance of the MyObject class using the default constructor. The object will have the default vauesfor all the attributes since no parameters were given.
MyObject obj = new MyObject();
Another type of constructor is one with no parameters (no-arg constructor). It is similar to the default, except you actually create this constructor. The contents of the the constructor may include anything. To call a no-arg constructor, use the same line of code as above. The constructor can look like the one below:
public MyObject() {
System.out.println("This is a no-arg constructor");
}
Lastly there is the parameterized constructor. This type of constructor takes in parameters as inputs to assign to values in the newly created object. You call a parameterized constructor as follows:
MyObject obj = new MyObject("Bob", 20);
The constructor will look like this:
public MyObject(String name, int age) {
this.name = name;
this.age = age;
}
In the constructor, the keyword "this" refers to the object, so this.name is a private global variable that is being set equal to the inputted value for name, in this case "Bob".
Hope this helps!
Web design is awesome! Alright, so -
If you want to call some attention to text, you need to focus on the basic essentials.
You want your text to be brief and split up. If someone goes on your site and see's walls of text, they'll be overwhelmed and leave.
So, to call attention - make it brief, and split it up into nice paragraphs.
Another way to call attention to text is to have a <em>really </em>good colour scheme. Having text easy on the eyes attracts the reader more, and encourages them to dive deeper.
If your text is unattractive and hard to look at it, it'll certainly get their attention - but not the attention you want.
Finally, another way to call attention is with visual adjustments such as making text bold, making it <em>italicised, </em>making it ALL CAPS, <em>or just GOING CRAZY WITH UNNECESSARY TEXT ATTENTION ATTRACTING POWER!!!!!!!
</em>Ahem... Anyways, these are just a few ways to get their attention. =) If you need any other help, private message me because I love web development! =)<em>
</em>
<h3>What is a Finite automata?</h3>
A finite state machine (FSM) or finite state automaton (FSA), or simply a state machine, is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number of states at any given time. The FSM may change from one state to another in response to some input; the change from one state to another is called a transition. An FSM is defined by a list of its states, its initial state, and the inputs that trigger each transition. Finite-state machines are of two types - deterministic finite-state machines and non-deterministic finite-state machines. A deterministic finite-state machine can be constructed equivalent to any non-deterministic machine.
With that being said, the DFA is equivalent to the expression 10(0+11)0*1 The expression that you've specified requires at least three 1 to be accepted. Breaking it down into parts.
<h3>Writting the automata:</h3>
<em>S0: 1 => S1 ; 1 </em>
<em>S0: 0 => error ; 0 </em>
<em>S1: 0 => S1 ; 10+ </em>
<em>S1: 0 => S2 ; 10(0 </em>
<em>S2: 0 => S2 </em>
<em>S2: 1 => S3 </em>
<em>S3: 1 => S4 </em>
<em>S4: 0 => S4 </em>
<em>S4: 1 => S5 </em>
<em>S5: 1 => S6 (final state) </em>
See more about automata at brainly.com/question/14937298
#SPJ1