Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java Create a project named Proj8. In this project, do the following: 1. Create a class named Colorable. 2. Create a class named Circle that

java
image text in transcribed
Create a project named Proj8. In this project, do the following: 1. Create a class named Colorable. 2. Create a class named Circle that extends the Colorable class. - In the Circle class, declare a private double data field named radius. 3. Create a class named Rectangle that extends the Colorable class. - In the Rectangle class, declare two private double data fields named widthand height. 4. The Colorable class contains an abstract method getArea() that returns a double area. 5. In the Circle class, implement the method getArea() to calculate the area of a circle. "Hint: area= PI" radius" "radius". 6. In the Rectangle class, implement the method getArea() to calculate the area of a Rectangle. "Hint: area=width" height" 7. In the main method - Create a Circle object with a radius specified by the user. - Print the area of the created circle. - Create a Rectangle object with a width and a height specified by the user. - Print the area of the created rectangle. 9. Modify the Colorable class, by implementing the method howToColor(Colorable). This method takes a Colorable object as an argument and returns a string that describe the color of that object; it returns "Red" for Circle objects, and "Yellow" for Rectangle objects. (Hint: use the instanceof operator). Al-Hlalat Sara Nbu Sa aleck

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 2 Lnai 6322

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

364215882X, 978-3642158827

Students also viewed these Databases questions

Question

(3) f YZ|x(y, z). Does the value depend on x? Pg45

Answered: 1 week ago

Question

Explain the factors influencing wage and salary administration.

Answered: 1 week ago

Question

Examine various types of executive compensation plans.

Answered: 1 week ago

Question

1. What is the meaning and definition of banks ?

Answered: 1 week ago

Question

2. What is the meaning and definition of Banking?

Answered: 1 week ago