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 companies would employ in mechanics engineering​
Alex73 [517]
What do y’all do when ya girl go eat lunch and eat it and eat
3 0
3 years ago
Using an "AND" and an "OR", list all information (Equipment Number, Equipment Type, Seat Capacity, Fuel Capacity, and Miles per
Tomtit [17]

Answer:

Explanation :

The given  information to be listed can are Equipment Number, Equipment Type, Seat Capacity, Fuel Capacity, and Miles per Gallon.

Check the attached document for the solution.

5 0
3 years ago
A road has a crest curve, where the PVI station is a 71 35. The road transitions from a 2.1% grade to a -3.4% grade. The highest
sveticcg [70]

Answer:

Stat PVC = Stat(82+98.5)

Stat PVT = Stat(59+71.5)

Explanation

PVI = 71 + 35

Let G1 = Grade 1; G2 = Grade 2

G1 = +2.1% ; G2 = -3.4%

Highest point of curve at station = 74 + 10

General equation of a curve:

y = ax^{2} +bx+c\\dy/dx=2ax+b\\

At highest point of the curve dy/dx=o

2ax+b=0\\x=-b/2a\\x=G1L/(G2-G1)\\x=L/2 +(stat 74+10)-(stat 71+35)\\x=L/2 + 275

-G1L/(G2-G1) = (L/2 + 275)/100\\L = -2327 ft\\Station PVC = Stat(71+35)+(-2327/2)\\\\Stat PVC = 7135-1163.5\\Stat PVC = Stat(82+98.5)\\

Station PVT

Station PVT = Stat PVI + (L/2)\\Station PVT = Stat(71+35)+(-2327/2)\\Station PVT = 7135-1163.5\\Stat PVT = Stat(59+71.5)

3 0
3 years ago
Please help <br> please i need to turn this in
grigory [225]

Answer:  101 means "introductory something". The allusion is to a college course with the course code 101, which in the American system and probably others indicates an introductory course, often with no prerequisites.

Explanation:

The name Topher means Christ Bearer and is of American origin. Topher is a name that's been used primarily by parents who are considering baby names for boys. Short form of Christopher.

I am not sure but if this is a trick question then the answer lies with his name, so this is the best I got. Hope it helps!

5 0
4 years ago
When checking for a no-star concern, you notice that an engine has no spark Technician A says to turn on the ignition engine (en
lbvjy [14]

Answer:

Technician B

Explanation:

Technician B is correct in his argument. This is because according to what he said, as the computer pulses stimuli the coil will turn on and off, promoting an increase in the voltage that will cause the fluctuation. Technician A is incorrect because the procedure he indicated imposes that the voltage is checked at the negative terminal and not at the positive.

5 0
3 years ago
Other questions:
  • A thermal energy storage unit consists of a large rectangular channel, which is well insulated on its outer surface and encloses
    7·1 answer
  • Given the unity feedback system
    5·1 answer
  • A 6cm OD, 2cm thick copper hollow sphere [k=386W/m.C] is uniformly heated at the inner surface at a rate of 150W/m2. The outside
    6·1 answer
  • A converging - diverging frictionless nozzle is used to accelerate an airstream emanating from a large chamber. The nozzle has a
    15·2 answers
  • Are you able to text without looking at your phone?
    10·1 answer
  • Whats is the purpose of the stator winding​
    13·1 answer
  • The ________________ attraction between the Earth and the moon is ______________ on the side of the Earth that happens to be ___
    5·1 answer
  • Which of these are an ethical issue
    14·1 answer
  • PLLLLLEEESSSEEE IIII NEED ASAP
    12·2 answers
  • What person at the construction worksite keeps workers safe from asbestos exposure?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!