Question
Need code for what is below using java eclipes. I'm working out of the book Intro to Java programming by Liang 10th edition. (Triangle class)
Need code for what is below using java eclipes. I'm working out of the book Intro to Java programming by Liang 10th edition.
(Triangle class) Design a new Triangle class that extends the abstract GeometricObject class. Write a test program that prompts the user to enter three sides of the triangle, a color, and a Boolean value to indicate whether the triangle is filled. The program should create a Triangle object with these sides and set the color and filled properties using the input. The program should display the area, perimeter, color, and true or false to indicate whether it is filled or not. (Enable GeometricObject comparable) Modify the GeometricObject class to implement the Comparable interface, and define a static max method in the GeometricObject class for finding the larger of two GeometricObject objects. Write a test program that uses the max method to find the larger of two circles and the larger of two rectangles. . (The Colorable interface) Design an interface named Colorable with a void method names howToColor(). Every class of a colorable object must implement the Colorable interface. Design a class names Square that extends GeometricObject and implements Colorable. Implement howToColor to display the message Color all four sides. Write a test program that creates an array of five GeometricObjects. For each object in the array, display its area and invoke its howToColor method if it is colorable.
Step 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