Create a class called "Triangle", which is inherited from "TwoDimensionShape" abstract class. The "Triangle" class is used to calculate the Area and the Perimeter of the Equilateral triangle given its Side-length (a), or in contrast, finding the side-length (a) when the Area or the Perimeter is given. The specifications of this class are below.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Topic Video
Question
100%

ues java and show me the output

Task 2.3: Class: Triangle
Create a class called "Triangle", which is inherited from "TwoDimensionShape" abstract class.
The "Triangle" class is used to calculate the Area and the Perimeter of the Equilateral triangle
given its Side-length (a), or in contrast, finding the side-length (a) when the Area or the
Perimeter is given. The specifications of this class are below.
Equilateral Triangle
Area A - a
Data Members (Attributes): All are
private.
• sideLength: the side-Length (a) of the
Equilateral triangle.
Side
Perimeter
P = 3a
> Methods/Operations/Getters/Setters:
• Default Constructor: when creating an object this constructor must set the side-Length
of the Equilateral triangle by calling the method setSideLength(). Moreover, this
constructor should call the findArea(), findPerimeter(), and summaryPrint() methods to
calculate and print all needed information.
User-Defined Constructor: when creating an object this constructor should find
(calculate) the side-length of the Equilateral triangle by passing the Area or the
Perimeter to the method findSideLength(). Finally, this constructor should call the
summaryPrint() method to print all information on the screen
• Method setSideLength(): to set the sideLength of the Equilateral triangle, by the
keyboard. Entered values must be validated, otherwise, repetition occurs (must be re-
entered again).
Method getSideLength (): to get the sideLength of the Equilateral triangle.
Method findArea(): must override the abstract method, findArea(), to calculate the
Equilateral triangle's area.
• Method findPerimeter(): must override the abstract method, findPerimeter(),
calculate the Equilateral triangle's perimeter.
• Method findSideLength (): is used to calculate the sideLength of the Equilateral
triangle. This method must ask the user to enter the area or the Perimeter of the
Equilateral triangle first.
Method summaryPrint(): must override the abstract method, summaryPrint(), to print
all information on the screen.
to
LO
Transcribed Image Text:Task 2.3: Class: Triangle Create a class called "Triangle", which is inherited from "TwoDimensionShape" abstract class. The "Triangle" class is used to calculate the Area and the Perimeter of the Equilateral triangle given its Side-length (a), or in contrast, finding the side-length (a) when the Area or the Perimeter is given. The specifications of this class are below. Equilateral Triangle Area A - a Data Members (Attributes): All are private. • sideLength: the side-Length (a) of the Equilateral triangle. Side Perimeter P = 3a > Methods/Operations/Getters/Setters: • Default Constructor: when creating an object this constructor must set the side-Length of the Equilateral triangle by calling the method setSideLength(). Moreover, this constructor should call the findArea(), findPerimeter(), and summaryPrint() methods to calculate and print all needed information. User-Defined Constructor: when creating an object this constructor should find (calculate) the side-length of the Equilateral triangle by passing the Area or the Perimeter to the method findSideLength(). Finally, this constructor should call the summaryPrint() method to print all information on the screen • Method setSideLength(): to set the sideLength of the Equilateral triangle, by the keyboard. Entered values must be validated, otherwise, repetition occurs (must be re- entered again). Method getSideLength (): to get the sideLength of the Equilateral triangle. Method findArea(): must override the abstract method, findArea(), to calculate the Equilateral triangle's area. • Method findPerimeter(): must override the abstract method, findPerimeter(), calculate the Equilateral triangle's perimeter. • Method findSideLength (): is used to calculate the sideLength of the Equilateral triangle. This method must ask the user to enter the area or the Perimeter of the Equilateral triangle first. Method summaryPrint(): must override the abstract method, summaryPrint(), to print all information on the screen. to LO
Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education