Question: 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
java Create a lava project named Proj9. in this project do the

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

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!