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
What type of engineering do you think would help solve this SDG???
OleMash [197]

Answer:

Explanation:

Planning engineering

4 0
3 years ago
Without motorcycle riders are at risk of severe injury in a crash ?
nekit [7.7K]

Answer:

The correct option is;

A. proper protection

Explanation:

Motorcycle riders ride the motorcycle while at some level of speed while  having the entire body exposed to be a major part of any collision.

Injuries sustained from motorcycle accidents are several times more severe than injuries sustained by occupants of a car that is fully protected by the metallic panel in the same and even more serious accident scenarios

Hence, motorcycle riders require adequate protection by putting on available motorcyclist safety gear

Therefore, to reduce the risk of severe injury n a crash, motorcycle riders require proper protection.

5 0
3 years ago
Read 2 more answers
Determine the period of each of the following discrete-time signals (if a signal is not periodic, denote its period by infinity)
sergiy2304 [10]

Answer:

a) it is periodic

N = (20/3)k = 20 { for K =3}

b) it is Non-Periodic.

N = ∞

c) x(n) is periodic

N = LCM ( 5, 20 )

Explanation:

We know that In Discrete time system, complex exponentials and sinusoidal signals are periodic only when ( 2π/w₀) ratio is a rational number.

then the period of the signal is given as

N = ( 2π/w₀)K

k is least integer for which N is also integer

Now, if x(n) = x1(n) + x2(n) and if x1(n) and x2(n) are periodic then x(n) will also be periodic; given N = LCM of N1 and N2

now

a) cos(2π(0.15)n)

w₀ = 2π(0.15)

Now, 2π/w₀ = 2π/2π(0.15) = 1/(0.15) = 1×20 / ( 0.15×20) = 20/3

so, it is periodic

N = (20/3)k = 20 { for K =3}

b) cos(2n);

w₀ = 2

Now, 2π/w₀ = 2π/2) = π

so, it is Non-Periodic.

N = ∞

c)  cos(π0.3n) + cos(π0.4n)

x(n) = x1(n) + x2(n)

x1(n) = cos(π0.3n)

x2(n) =  cos(π0.4n)

so

w₀ = π0.3

2π/w₀  = 2π/π0.3 = 2/0.3 = ( 2×10)/(0.3×10) = 20/3

∴ N1 = 20

AND

w₀ = π0.4

2π/w₀  = 2π/π0. = 2/0.4 = ( 2×10)/(0.4×10) = 20/4 = 5

∴ N² = 5

so, x(n) is periodic

N = LCM ( 5, 20 )

6 0
3 years ago
since your car had a cylinder volume of 275cm what is its engine displacement if the engine had 4 cylinders​
RUDIKE [14]

Answer:

$$\begin{align*}

P(Y−X=m|Y>X)=∑kP(Y−X=m,X=k|Y>X)=∑kP(Y−X=m|X=k,Y>X)P(X=k|Y>X)=∑kP(Y−k=m|Y>k)P(X=k|Y>X).

Explanation:

P(Y−X=m|Y>X)=∑kP(Y−X=m,X=k|Y>X)=∑kP(Y−X=m|X=k,Y>X)P(X=k|Y>X)=∑kP(Y−k=m|Y>k)P(X=k|Y>X).

5 0
3 years ago
In order to determine the mass moment of inertia of a flywheel of radius 600 mm, a 15-kg block is attached to a wire that is wra
swat32

Answer:

Mass moment of inertia of the flywheel = 140.17 kg.m²

Explanation:

Consider the moment equation about the center of the flywheel

∑ M(g) = ∑ [m(g)(effective)]

-m(a) g r + τ = -I’ α – m(A) a(A) r

m(a)gr - τ = I’ a(A)/r + m(A) a(A) r, where m(a)g is weight of the block, r is the radius of the flywheel, α is the angular acceleration, I’α is the coupled, τ is the torsional moment of flywheel, and m(A) a(A) is force acting on block A.

Substitute 15 kg for m(A), 9.81,/s² for g and 0.6m for r

15 x 9.81 x 0.6 – τ = -I’(a(A)/0.6) + 15 x a(A) x 0.6

88.29 – τ = 1.667I’a(A) + 9a(A), equation 1

For the first case, a block of 15 kg weight falls 3 m from rest in 4.6 s.

<u>Determine the acceleration of the block</u>

S = ut + ½ a(A)t²

<u>Substitute 3 m for s, 0 for u and 4.6 s for t </u>

3 = 0 x 4.6 + ½ a(A) x (4.6)²

a(A) = 0.2836m/s²

<u>Substitute in equation 1</u>

88.29 – τ = 1.667I’ x 0.2836 + 9 x 0.2836

τ = 85.7376 - 0.4728I’

For the second case, a block of 30 kg weight falls 3 m in 3.1 s

<u>Substitute 30 kg for m(A), 9.81 m/s² for g, and 0.6 m for r in equation 1</u>

30 x 9.81 x 0.6 – τ = I(a(A)/0.6) + 30 x a(A) x 0.6

176.58 – τ = 1.667I’a(A) + 18a(A), equation 2

<u>Determine acceleration of block</u>

S = ut + ½ a(A)t²

<u>Substitute 3 m for s, 0 for I and 3.1 s for t</u>

3 = 0 x 3.1 + ½ a(A) (3.1)²

a(A) = 0.6243m/s²

<u>Substitute 0.6243m/s² for a(A) in equation 2</u>

176.58 – τ = 1.677I’ x 0.6243 + 18 x 0.6243

τ = 165.3426 - 1.0407I’

<u>Solve both equations for I’</u>

165.3426 – 1.0407I’ = 85.7376 – 0.4728I’

0.56791I’ = 79.605

I’ = 140.1718582 = 140.17 kg.m²

4 0
4 years ago
Other questions:
  • A large plate is fabricated from a steel alloy that has a plane strain fracture toughness of 55 MPa √m (50 ksi √in.). If, during
    5·1 answer
  • Name the important trees of tropical monsoon forest​
    11·1 answer
  • A six-lane freeway (three lanes in each direction) with a 5.5% uphill grade 1.5 miles long has 10-ft lanes and obstructions 5 ft
    6·2 answers
  • Consider a N-channel enhancement MOSFET with VGS = 3V, Vt = 1 V, VDS = 10 V, and lambda =0 (channel length modulation parameter)
    11·1 answer
  • Find the True statement
    9·2 answers
  • which one of the following appliance parts gets the hardest services? A. Heating elementwhich one of the following appliance par
    10·2 answers
  • A 35kg block of mass is subjected to forces F1=100N and F2=75N at agive angle thetha= 20° and 35° respectively.find the distance
    11·1 answer
  • Tensile testing provides engineers with the ability to verify and establish material properties related to a specific material.
    7·1 answer
  • Which state did NOT have people that got sick from the
    10·1 answer
  • The moisture content in air (humidity) is measured by weight and expressed in pounds or ____________________.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!