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
Nat2105 [25]
3 years ago
14

Write an inheritance hierarchy for classes Quadrilateral, Trapezoid, Parallelogram, Rectangle and Square. Use Quadrilateral as t

he superclass of the hierarchy. Create and use a Point class to represent the points in each shape. Make the hierarchy as deep (i.e., as many levels) as possible. Specify the instance variables and methods for each class. The private instance variables of Quadrilateral should be the x-y coordinate pairs for the four endpoints of the Quadrilateral. Write a program that instantiates objects of your classes and outputs each object‟s area (except Quadrilateral​
Computers and Technology
1 answer:
Ymorist [56]3 years ago
7 0

Answer:

CODE:

public class QuadrilateralTest {

public static void main(String[] args) {

// NOTE: All coordinates are assumed to form the proper shapes

// A quadrilateral is a four-sided polygon

Quadrilateral quadrilateral =

new Quadrilateral(1.1, 1.2, 6.6, 2.8, 6.2, 9.9, 2.2, 7.4);

// A parallelogram is a quadrilateral with opposite sides parallel

Parallelogram parallelogram =

new Parallelogram(5.0, 5.0, 11.0, 5.0, 12.0, 20.0, 6.0, 20.0);

// A rectangle is an equiangular parallelogram

Rectangle rectangle =

new Rectangle(17.0, 14.0, 30.0, 14.0, 30.0, 28.0, 17.0, 28.0);

// A square is an equiangular and equilateral parallelogram

Square square =

new Square(4.0, 0.0, 8.0, 0.0, 8.0, 4.0, 4.0, 4.0);

System.out.printf(

"%s %s %s %s\n", quadrilateral, parallelogram,

rectangle, square);

}

}

RESULT:

Coordinates of Quadrilateral are:

2 (1.1, 1.2), (6.6, 2.8), (6.2, 9.9), (2.2, 7.4)

3  

4 Coordinates of Parallelogram are:

5 (5.0, 5.0), (11.0, 5.0), (12.0, 20.0), (6.0, 20.0)

6 Width is: 6.0

7 Height is: 15.0

8 Area is: 90.0

9  

10 Coordinates of Rectangle are:

11 (17.0, 14.0), (30.0, 14.0), (30.0, 28.0), (17.0, 28.0)

12 Width is: 13.0

13 Height is: 14.0

14 Area is: 182.0

15  

16 Coordinates of Square are:

17 (4.0, 0.0), (8.0, 0.0), (8.0, 4.0), (4.0, 4.0)

18 Side is: 4.0

19 Area is: 16.0

Explanation:

You might be interested in
What are the uses of plotters​
PilotLPTM [1.2K]

Answer:

  • Plotters are use to produce the hard copy of schematics and other similar applications
  • They are mainly used for CAE applications.
  • They can print on a wide variety of flat materials

Hope it helps :)❤

5 0
2 years ago
Read 2 more answers
Write the steps for displaying multiple subtotal functions in excel.
Sloan [31]

We can display multiple subtotal functions in excel using the following steps.

<u>Explanation</u>:

Step1: Enter the data you want to add in the excel sheet.

Step2: Select the cell containing the data you want to add.

Step3: Click the Data Tab

Step 4: Now select the SUBTOTAL command in the outline group.

Step 5: An option called ATEACHCHANGEIN will be available.

Step 6: Now select the drop-down menu under that option.

Step 7: After selecting the drop-down menu to select the columns you want to use for the first level subtotals.

By following these steps, we can display multiple subtotal functions in excel.

3 0
3 years ago
Web and mobile applications are created for users to only read information. True False
SIZIF [17.4K]
I think it's false. It's not created just for reading.
4 0
3 years ago
Read 2 more answers
(Game Design) Which of the following is NOT a name of a popular digital sculpting application?
Savatey [412]

Claymation option A

Because Claymation is not the game design application.it is also called clay animation.

7 0
3 years ago
16.
dimaraw [331]
  • Answer:

<em>r = 15 cm</em>

  • Explanation:

<em>formula</em>

<em>V = πr²×h/3</em>

<em>replace</em>

<em>4950 = 22/7×r²×21/3</em>

<em>4950 = 22/7×r²×7</em>

<em>4950 = 22×r²</em>

<em>r² = 4950/22</em>

<em>r² = 225</em>

<em>r = √225</em>

<em>r = √15²</em>

<em>r = 15 cm</em>

3 0
2 years ago
Other questions:
  • Put the following five steps in the order in which you would perform them to use the Paste Special function: ____. 1. Select and
    5·1 answer
  • An employee who interacts with customers regarding the nature of their car problems, rather than actually working on the vehicle
    12·2 answers
  • Once you select select a crop boundary, you can no
    15·1 answer
  • Encyclopedia.com is considered to be
    15·1 answer
  • Encryption Using Rotate Operations Write a procedure that performs simple encryption by rotating each plaintext byte a varying n
    10·1 answer
  • What is the first step to apply the line and page breaks options to groups of paragraphs in a Word document?
    10·2 answers
  • Write any four difference between email and effects​
    14·1 answer
  • Part 1: For this assignment, call it assign0 Implement the following library and driver program under assign0: Your library will
    5·1 answer
  • How can i setup a mesage room and also want to hangout ??????
    10·1 answer
  • Write a method to add/subtract two matrices. The header of the method is as follows:
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!