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
A large institution, such as a bank, may have thousands of transactions to process in which no user interaction is required; whi
White raven [17]

Answer:

Mainframe Computer System

Explanation:

Mainframe systems or simply mainframes are computers used for critical application, bulk processing and transaction processing.

They are larger than the basic computers we find around. They are advantageous as they are able to process large data faster. For this reason, large institutions like banks tend to use them for processing of data because of the thousands of transactions they engage in.

They are capable of handling and processing very large amount of data quickly.

Examples of other large institutions that uses mainframe computers apart from Bank stated in the question are

1. Stock brokerage firms

2. Government agencies

3. Insurance agencies

4. Fortune 500 companies and so on.

6 0
3 years ago
Read 2 more answers
What is the benefit of making an archive folder visible in the Outlook folder list?
Rufina [12.5K]

Answer:

a

Explanation:

5 0
2 years ago
What are 2 ways to access the vendor credit screen in quickbooks online?
kiruha [24]

Answer:

First by

Clicking

New Button (+) THEN click Vendor THEN click Credit

Secondly

Click Expenses Center then click New Transaction then finally click Vendor Credit

4 0
3 years ago
PLS HELP!! 50 Points! Will mark correct answer brainliest!!
Illusion [34]

Answer: C

Explanation:

That way she can have slides for her advance class and leave out slides that her normal class doesn’t need

5 0
3 years ago
Read 2 more answers
Which activity uses a feature of a word processor?
Anvisha [2.4K]
The activity that uses a feature of a word processor is the last given answer. Recreating the same document multiple times to print multiple copies. Although some word processors have all the features stated above now a days. Word processors are helpful in composing, editing and printing text documents.
3 0
3 years ago
Read 2 more answers
Other questions:
  • In Microsoft Word you can access the _______ command from the "Mini toolbar".
    9·1 answer
  • Which security control is most helpful in protecting against eavesdropping on wireless LAN (WLAN) data transmissions that would
    6·1 answer
  • What is the description of a computer ram?
    7·1 answer
  • what you can do to increase your chances of getting employed with changes to your current digital footprint​
    6·1 answer
  • How many constructors are there in the following class declaration?class CashRegister { public: CashRegister(); CashRegister(int
    8·1 answer
  • What is the main fuction of command interpreter​
    11·1 answer
  • Unconformities develop when new sedimentary layers accumulate atop old, eroded layers, resulting in a geologic hiatus. Which of
    9·1 answer
  • MR. Tom asked her students could they plant a flower and bring it to class. Sarah brought his flower and said it was a rose. Jam
    6·1 answer
  • Group of programs are software <br>​
    11·1 answer
  • Tinh T = a1*a2*a3*...an<br><br> Giúp em với
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!