Answered step by step
Verified Expert Solution
Question
1 Approved Answer
java Create a lava project named Proj9. in this project do the following: 1. Create an interface named as Colorable, this interface contains two methods
java
Create a lava project named Proj9. in this project do the following: 1. Create an interface named as Colorable, this interface contains two methods 2. Create a class named Cirde that implements the Colorable interfce. - Circle class bas an integer data field named radius. 3. Create a class named Rectangle that implements the Colorable interface. - Rectangle class has a two double data fields named width, height. 4. For Circle objects, the getArea() method calculates and returns the area of the circleaccording to the formula (c area= PI radius^ 2 ). 5. For Rectangle objects, the getAreal) method calculates and retums the area of therectangle according to the formula (r areaz width*height) 6. For Circle objects, the howTocolor() method returns a String that colors the Circle according to its area "Hint: using the getArea() method". If the area of the circle is reater than 50 , the return color will be "Red", else the color will be "Yellow". 7. For Rectangle objects, the howToColor[) method returns a String that colors the rectangle according to the width the rectangle. If the width is greater than 50 , the returned color will be "Black", else the color will be "White 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