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]
2 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]2 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
In a natural-language processing (NLP) system, the__________activity involves using the computer to read large amounts of text a
OleMash [197]

Answer:

Analysis is the right suitable word to complete the sentence

Explanation:

It is because, Analysis is a concept, which means to judge any subjects and brings some original concept which is needed to take from the subjects.

Here in the above question the paragraph states about the summarize points taken from a large amount of data and analysis also mean the same and analysis is also the activity used in NLP for the same as above discussed.

7 0
2 years ago
__________ is the electronic transmission of signals for communications, which enables organizations to carry out their processe
Serjik [45]

Telecommunications is the electronic transmission of signals for communications, which enables organizations to carry out their processes and tasks through effective computer networks

4 0
3 years ago
In which of the following situations may you pass on the right
Natasha2012 [34]
In driving your vehicle, it is best to pass on the right after you slow your vehicle down and check for the road whether there is an upcoming vehicle or not. When the road is clear, it is best and safe to pass on the right after making sure that the coast is clear.
3 0
2 years ago
Read 2 more answers
General Hardware Products Your boss, the IT director, wants you to explain FDDs, BPM, DFDs, and UML to a group of company manage
Bas_tet [7]

Answer:

1. FDD is a process and Analysts can use a FDD to create and use business functions and processes. It Requirements models are used when gathering requirements for a new system.

2. BPM is used on an ongoing basis for business process improvement. It is meant to improve order, insight and efficiency of the collective workflows that make up any given business process. BPM is meant to reduce any chaos within those collective workflows that make up a process and eliminate ad hoc workflow management. BPM means Business Process Management.

3. DFDs stands for Data Flow Diagram which will help software developers and designers to understand how they can take their next step to fit into the overall business process. DFDs paly key role for a successful requirements modeling.

4. UML can be used for modeling a system independent of a platform language. UML is a graphical language for visualizing, specifying, constructing, and documenting information about software-intensive systems. UML gives a standard way to write a system model, covering conceptual ideas.

Explanation:

Functional decomposition diagram (FDD) is used to identify functions and define their structure. It is a technique to decompose the complex problem into manageable pieces or individual elements to develop the application or product.

DFDs: It contains a process (shape) that represents the system to model, in this case, the "Food Ordering System". It also shows the participants who will interact with the system, called the external entities. In this example, Supplier, Kitchen, Manager and Customer are the entities who will interact with the system.

Unified Modeling Language (UML): Edraw UML Diagram is the application of choice for many software engineers and designers. The software is fully compatible with 64 and 32-bit Windows platforms from Windows XP to Windows 10.

3 0
3 years ago
What is an example of technology that helps support the idea of continental drift.
docker41 [41]

I don't know technology, but using Satellite images, we are able to see that the continents once fitted into one 'jigsaw'. This shows that the continents must have drifted to its original place. Furthermore, Geothermal stations have pointed out convection currents in the Earth's mantle has caused the movement of crusts.
8 0
2 years ago
Other questions:
  • What are some beginning keyboarding questions?
    10·2 answers
  • Declaring single arrays is done with a0 set(s) of straight brackets.
    10·1 answer
  • The simplest method to copy information is to first select the information you want to copy, and then use the Copy button and th
    11·1 answer
  • Blank is a type of drag and drop code to help beginner
    14·1 answer
  • A ddr4 dimm with a pc rating of pc4-17000 is running at what speed?
    15·1 answer
  • Which of the following languages does not provide built-in-pattern matching operations (the language, although, has pattern matc
    14·1 answer
  • Which of these is an example of collective voice?
    8·2 answers
  • There are two kinds of emotions: positive and negative. True False
    10·2 answers
  • The ________ is the biggest power consumer on a mobile computing device.
    5·1 answer
  • (C) Describe about the different types of computer<br> peripherals and memory devices.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!