Question
-I need to chegg expert to follow the instructions of the homework exactly so that I can confidently learn the material
-The code needs to be written in Java.
-thanks in advance for your help. I really appreciate it !
Learning Objectives: Create an interface Implement an interface Demonstrate polymorphic behavior of interfaces Use the instanceof operator Develop algorithms (print methods) Description: This assignment demonstrates the use of interfaces and how they can be used in combination with inheritance Use the four shapes that you implemented in Assignment Inheritance as a starting point. I recommend creating a copy before you implement any changes. In this assignment you will create 2 interfaces: Shape and Printable and you will modify the classes Rectangle, Square, IsoscelesRightTriangle, and Circle so that they implement one or both of the interfaces In addition you will create a class called InterfaceApp (different from InheritanceApp). This class includes the main method and demonstrates the polymorphic behavior of interfaces. Declare the interfaces according to the UML diagrams: ad interface Shape: aInterface» Sha perimeter.. returns the perimeter of the shape perimeter): double area(): dcuble area.. returns the area of the shape ad interface Printable: print.. prints the outline of the shape with stars) «Interface Printable within a line the stars are always separated by a single space (blank) The rectangle is printed with the length on the x-axis (more wide than high) In case of the triangle the right angle is on the bottom left ( see output) The output produced by the print method needs to reflect the actual field values print) Modify the four shape classes Rectangle, Square, IsoscelesRightTriangle, and Circle so that . all of them implement Shape . all except Circle implement Printable
Explanation / Answer
Square.java
Rectangle.java
IsoscelesRightTriangle.java
InterfaceApp.java
Shape.java
Printable.java
circle.java