Question: give me proper line to line code for the question with output not the code from github or chatgpt i need a genuine code Question
give me proper line to line code for the question with output not the code from github or chatgpt i need a genuine codeQuestion II Design a class named Triangle that extends GeometricObject (as shown below). The class should contain the following three private double data fields: side1, side 2 , side 3 with default values 1.0 to denote three sides of the triangle. In addition, the class should have the following constructors and methods: 1. A no-arg constructor that initializes all three sides to 0 . 2. A constructor that creates a triangle with the specified sidel, side 2 , and side 3 . 3. The setter methods for three data fields. 4. The getter methods for three data fields. 5. A method named getPerimeter() that returns the perimeter of this triangle. 6. A method named toString() that returns a string description for the triangle. Write a test program that does the following tasks: 1. Prompts the user to enter three sides of the triangle. The program creates a Triangle object with these sides. Prompt the user to enter a color and a Boolean value to indicate whether the triangle is filled. Use these two input values to set the data fields color and filled
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
