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
Discuss how the Database models effected the business processes and the impact of using the different database models on the bus
JulsSmile [24]

Answer:

The database models depend very much on what will be the use in the business logic of the company will have directly with the database, primarily implying whether or not to use a relational or non-relational database.

Explanation:

In relational databases there is something called normalization, which after the construction of a data model allows me to optimize in a greater way the way in which I will make the queries within this database, that is a fundamental aspect, since one of the fundamental aspects today about the business logic of companies with databases is the capacity to respond when waiting for a query and if it is delayed a lot there will be inconvenience with the expected result.

Currently there are different examples of in which scenario what kind of database is better, distributed, centralized databases, clusters is.. And it is where you need to be very clear about what is my business  and what type of database is adapted more to be.

I hope I could help you.

7 0
4 years ago
Please
levacccp [35]

Answer:

inspect

Explanation:

7 0
3 years ago
1. If Earth's plates are constantly moving, why don't we need to update the locations of -
Dmitriy789 [7]

Answer:

Because the tectonic plates are moving so slowly in such small incraments that it would take a while before there was any noticable change.

Explanation:

4 0
3 years ago
What is the function of a CPU? simple words:D
koban [17]

Answer:

The brains of a computer

4 0
3 years ago
Read 2 more answers
Which of these statements sums up why the computer is the most visible and
Andreyy89

Statement A is true, that is computers are used in all digital technologies.

Explanation:

  • Among the given statement the most appropriate statement to choose the computer as the most visible and pervasive product of the digital age is that computers are used in all digital technologies now.
  • And other statement are false or not valid as computers are not only used in United states
  • Computer is not the only form of communication.
  • And computers are not the only technological devices that we use now.

6 0
4 years ago
Other questions:
  • Which sector provides scope for multimedia designers?
    10·1 answer
  • Typically, what form do most database designers consider a database structure to be normalized?
    15·1 answer
  • Which is the most common drive letter where Windows stores most data and programs? A. A B. B C. C D. E
    12·2 answers
  • What must be done before using ArrayLists?<br><br> (This is Java Programming btw)
    9·1 answer
  • How many different bit strings are there of length 6 that contain the string 0000?
    9·1 answer
  • Which of the following is not a characteristic of a motorcycle?
    6·1 answer
  • • In your response, please include some examples of the three different types of storage.
    11·2 answers
  • A page-ranking algorithm ranks web pages according to
    15·2 answers
  • How does the technology affect you daily living? Give situations where you use technology and how it helped you.​
    5·1 answer
  • Natural language generation is focused on?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!