Question: How do you acomplish this assignment? I cant get the output right. Assignment Interface CSIS-1410 Learning Objectives: Create an interface Implement an interface Demonstrate polymorphic


How do you acomplish this assignment? I cant get the output right.
Assignment Interface CSIS-1410 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 Interface Shape Interface Sha perimeter): double area(): double perimeter.. returns the perimeter of the shape area .. returns the area of the shape Interface Printable: print .. prints the outline of the shape with small circles (see output) 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 e all of them are a Shape all except Circle are a Printable
Step by Step Solution
There are 3 Steps involved in it
To accomplish this assignment youll create two interfaces Shape and Printable modify the four shape ... View full answer
Get step-by-step solutions from verified subject matter experts
