Question: 1. Using Netbeans (or your preferred IDE), create a class called Shape using the following guide: public class Shape { private String name; public Shape(String

 1. Using Netbeans (or your preferred IDE), create a class called

1. Using Netbeans (or your preferred IDE), create a class called Shape using the following guide: public class Shape { private String name; public Shape(String name) { this.name = name; /** returns the name of the shape / public String getName() { return name; /* returns the area of the shape * public double getArea() { return 0.0; public void print Dimensions(){ System.out.println("No dimensions"); 2. Create 4 additional classes as follows: Shape Equateral Triangle 3. For each additional class do the following: 1. Have a constructor that takes a name, which it turn invokes the constructor of its superclass 2. Implement a set Dimensions() method that will take the following parameters: 1. Square: length and height 2. Circle: radius 3. Triangle: 3 sides 4. Equilateral Triangle: 1 side 3. Override the printDimensions() method of the superclass to print the dimensions of the current shape. 4. Override the getArea() method of the superclass to calculate the correct area for each shape. For triangles, use Heron's Formula: area - Vs (s-a) (s-b) (s-c) where a,b, and care the lengths of the sides, and s= the perimeter 5. Create a main class that will create one instance of each class, and prompt the user to enter the dimensions for each object. 6. Once all objects have been created, print the name, dimensions, and area for each object to the screen

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!