Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 PrintableStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started