Answered step by step
Verified Expert Solution
Link Copied!

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
image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mastering Apache Cassandra 3 X An Expert Guide To Improving Database Scalability And Availability Without Compromising Performance

Authors: Aaron Ploetz ,Tejaswi Malepati ,Nishant Neeraj

3rd Edition

1789131499, 978-1789131499

More Books

Students also viewed these Databases questions

Question

What is your boards committee structure? Is it effective?

Answered: 1 week ago