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
Medium-term goals describe what you want your business to achieve (a) in ten years, (b) in terms of market share, (c) in two to
77julia77 [94]

The correct answer to this question is Choice C- in two to five years.

Your medium-term goals may build upon your short term goals. For example, your short term goal may be to save $1,000. Building upon this, your medium-term goal could be to save $5,000.

3 0
3 years ago
How can you use the Address Book to address an email message? Use the drop-down menus to complete the sentences. 1. Type an emai
Delvig [45]

Answer:

1. AutoCorrect

2. Address book

Explanation:

stan bts ?

5 0
3 years ago
Read 2 more answers
From an intraindividual perspective, the causes of aggression in intimate relationships:____________.
OLEGan [10]

Answer:

How partners in a relationship differ in a way that would cause them to contribute differently to the aggression that occurs between them.

Explanation:

Aggression in an intimate relationship is a negative response to environmental stimuli of individual. Two types of aggression are unilateral and bilateral aggression.

Aggression in a relationship can be view from different perspective, namely, interpersonal perspective, intra-individual perspective and sociocultural perspective.

3 0
3 years ago
Can someone please help i have no idea what’s going on in this code
Valentin [98]

Explanation:

The first 3 lines of code tell the user to input a 5 digit number (ex. 72,910) or a 1 digit number (ex. 3). The next 5 lines of code determine if it is a 5/1 digit number or not. If it is, it prints "Success!". The rest of the code just tells that if it's not a 5/1 digit number, and if it's not, it gives errors and tells the user to try again.

Hope this helps!

3 0
3 years ago
Which network device sends data to every device that is connected to it?.
podryga [215]

Answer:

A hub broadcasts all data traffic to all networking devices connected to it's data ports. this is used to interconnect networking devices.

What is Hub?

a device that uses it's ports to connect devices (computer, printers, etc.) together.

5 0
2 years ago
Other questions:
  • Ron is creating building blocks in Word. How can he make the building blocks that he created available?
    11·2 answers
  • Choosing the “Quick Print” button will ____________.
    14·1 answer
  • Provide an example of a time in your personal or work life when you used the household measuring system and measured out an exac
    6·1 answer
  • How is a recession determined?
    10·1 answer
  • In its simplest form, the __________ has two columns: the first column lists every computer and device in the network, while the
    15·1 answer
  • Write the definition of a function named printstarbucks that receives a non-negative integer n and prints a line consisting of n
    6·1 answer
  • What is the main component of the EV3 Lego Robot called?​
    6·1 answer
  • What software maintain and increase the efficiency of a computer system?
    12·1 answer
  • A ___________ variable is used to add up a set of values. fill in the blank
    8·1 answer
  • Meats ages hair and feathers all contain this monomer
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!