Question: 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

 Description: This assignment demonstrates the use of interfaces and how theycan be used in combination with inheritance Use the four shapes that

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 Shape 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 . all of them are a Shape . all except Circle are a Printable

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!