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
Arturiano [62]
3 years ago
11

For this question you must write a java class called Rectangle and a client class called RectangleClient. The partial Rectangle

class is given below. (For this assignment, you will have to submit 2 .java files: one for Rectangle class and the other one for RectangleClient class.) // A Rectangle stores an (x, y) coordinate of its top/left corner, its width and height. public class Rectangle { private int x; private int y; private int width; private int height; // constructs a new Rectangle with the given inX, inY and inSideLength public Rectangle(int inX, int inY, int inWidth, int inHeight) // returns the fields' values public int
Engineering
1 answer:
Alex Ar [27]3 years ago
6 0

Answer:

Java program is given below. You can get .class after you execute java programs, You can attach those files along with .java classes given , Those .class files are generated ones.

Explanation:

//Rectangle.java class

public class Rectangle {

private int x;

private int y;

private int width;

private int height;

// constructs a new Rectangle with the given x,y, width, and height

public Rectangle(int x, int y, int w, int h)

{

this.x=x;

this.y=y;

this.width=w;

this.height=h;

}

// returns the fields' values

public int getX()

{

return x;

}

public int getY()

{

return y;

}

public int getWidth()

{

return width;

}

public int getHeight()

{

return height;

}

// returns a string such as “Coordinate is (5,12) and dimension is 4x8” where 4 is width and 8 is height. public String toString()

public String toString()

{

String str="";

//add x coordidate , y-coordinate , width, height and area to str and return

str+="Coordinate is ("+x+","+y+")";

str+=" and dimension is : "+width+"x"+height;

str+=" Area is "+(width*height);

return str;

}

public void changeSize(int w,int h)

{

width=w;

height=h;

}

}

======================

//main.java

class Main {

public static void main(String[] args) {

//System.out.println("Hello world!");

//create an object of class Rectangle

Rectangle rect=new Rectangle(5,12,4,8);

//print info of rect using toString method

System.out.println(rect.toString());

//chamge width and height

rect.changeSize(3,10);

//print info of rect using toString method

System.out.println(rect.toString());

}

}

==========================================================================================

//Output

Coordinate is (5,12) and dimension is : 4x8 Area is 32

Coordinate is (5,12) and dimension is : 3x10 Area is 30

========================================================================================

You might be interested in
Experimental Design Application Production engineers wish to find the optimal process for etching circuit boards quickly. They c
Veseljchak [2.6K]

Answer:

Hello your question is incomplete attached below is the missing part and answer

options :

Effect A

Effect B

Effect C

Effect D

Effect AB

Effect AC

Effect AD

Effect BC

Effect BD

Effect CD

Answer :

A  = significant

 B  = significant

C  = Non-significant

D  = Non-significant

AB  = Non-significant

AC  = significant

AD  = Non-significant

BC  = Non-significant

 BD  = Non-significant

 CD = Non-significant

Explanation:

The dependent variable here is Time

Effect of A  = significant

Effect of B  = significant

Effect of C  = Non-significant

Effect of D  = Non-significant

Effect of AB  = Non-significant

Effect of AC  = significant

Effect of AD  = Non-significant

Effect of BC  = Non-significant

Effect of BD  = Non-significant

Effect of CD = Non-significant

8 0
3 years ago
Select the correct answer.
MAVERICK [17]

Answer:crane and engine I guess

Explanation:

8 0
3 years ago
What is one of the most common ways workers get hurt around machines
-BARSIC- [3]

Answer:

if their body parts stuck in a machine,if machine expl

Explanation:

ode.

4 0
3 years ago
Affect the amount and rate the alcohol reaches the<br> bloodstream.
just olya [345]

Answer:

Answer to the following question is as follows;

Explanation:

The amount of alcohol consumption can be influenced by a variety of things, including food.

The proportion and pace at which alcohol reaches the circulation is affected by drinking rate, body mass, and the size of the beverage. Alcohol enters your system as soon as it reaches that first sip, as per the National Institute on Drug Abuse and Alcoholism. After 10 minutes, the results are noticeable.

6 0
3 years ago
The uniform slender rod has a mass m.
Nikolay [14]

Answer: 3/2mg

Explanation:

Express the moment equation about point B

MB = (M K)B

-mg cosθ (L/6) = m[α(L/6)](L/6) – (1/12mL^2 )α

α = 3g/2L cosθ

express the force equation along n and t axes.

Ft = m (aG)t

mg cosθ – Bt = m [(3g/2L cos) (L/6)]

Bt = ¾ mg cosθ

Fn = m (aG)n

Bn -mgsinθ = m[ω^2 (L/6)]

Bn =1/6 mω^2 L + mgsinθ

Calculate the angular velocity of the rod

ω = √(3g/L sinθ)

when θ = 90°, calculate the values of Bt and Bn

Bt =3/4 mg cos90°

= 0

Bn =1/6m (3g/L)(L) + mg sin (9o°)

= 3/2mg

Hence, the reactive force at A is,

FA = √(02 +(3/2mg)^2

= 3/2 mg

The magnitude of the reactive force exerted on it by pin B when θ = 90° is 3/2mg

6 0
3 years ago
Other questions:
  • 5. Which of these least accurately describes what happens when abnormal combustion raises the temperature and pressure inside th
    8·1 answer
  • Identify each statement as referring to a series or parallel circuit.
    15·1 answer
  • Create a C language program that can be used to construct any arbitrary Deterministic Finite Automaton corresponding to the FDA
    6·1 answer
  • Which metal is used in planes.
    5·2 answers
  • When testing a compressor with an ohm meter, a technician read 2 ohms between the start terminal and the case of the compressor.
    5·1 answer
  • Which of the following can cause a flopping sound at the front of the engine
    14·1 answer
  • The gage pressure measured as 2.2 atm, the absolute pressure of gas is 3.2 bar. Please determine the local atmospheric pressure
    14·1 answer
  • A) Consider an air standard otto cycle that has a heat addition of 2800 kJ/kg of air, a compression ratio of 8 and a pressure an
    7·1 answer
  • Instructions: For each problem, identify the appropriate test statistic to be use (t test or z-test). Then compute z or t value.
    14·1 answer
  • Question 6
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!