Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This assignment helps you understand Inheritance. We want to create a superclass

ID: 3742714 • Letter: T

Question

This assignment helps you understand Inheritance. We want to create a superclass or parent class called Shape. This shape class will have just one method to setBorderColor. Now we need 3 subclasses that extend the Shape class, Circle, Square and Rectangle. In these classes we will need to compute the area of each of the shapes and print it to the console using System.out.println You will need to take in an additional parameter in each of these subclasses -- side for Square, length and breadth for rectangle and radius for the circle. Finally create a new class called App. You will need to have a main method in this App class that will construct the different shapes and call the computeArea method of each of the shapes to print out the area and call the getBorderColor to print out the border color of each shape. This assignment helps you understand Inheritance. We want to create a superclass or parent class called Shape. This shape class will have just one method to setBorderColor. Now we need 3 subclasses that extend the Shape class, Circle, Square and Rectangle. In these classes we will need to compute the area of each of the shapes and print it to the console using System.out.println You will need to take in an additional parameter in each of these subclasses -- side for Square, length and breadth for rectangle and radius for the circle. Finally create a new class called App. You will need to have a main method in this App class that will construct the different shapes and call the computeArea method of each of the shapes to print out the area and call the getBorderColor to print out the border color of each shape. This assignment helps you understand Inheritance. We want to create a superclass or parent class called Shape. This shape class will have just one method to setBorderColor. Now we need 3 subclasses that extend the Shape class, Circle, Square and Rectangle. In these classes we will need to compute the area of each of the shapes and print it to the console using System.out.println You will need to take in an additional parameter in each of these subclasses -- side for Square, length and breadth for rectangle and radius for the circle. Finally create a new class called App. You will need to have a main method in this App class that will construct the different shapes and call the computeArea method of each of the shapes to print out the area and call the getBorderColor to print out the border color of each shape.

Explanation / Answer

This ques is quite unsatisfied it actually don't tell about what the setbordercolor function has to do .

I mostly tried to look at the ques it demands for area of the triangle ,rectangle,circle using subclass unit which i tried to define in the code above by using comments too.