Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A kindergarten management wishes to decorate their classes by painting differentshapes on the walls in three different colors: red, green and blue. The shapes arecircles

A kindergarten management wishes to decorate their classes by painting differentshapes on the walls in three different colors: red, green and blue. The shapes arecircles and squares that can vary in size determined by their side length L or radiuses Rin meters. The area of a shape is calculated through the following formulas:Circle =3.14* R * RSquare = L * LThe kindergarten places an order with a painting company listing all the required shapeswith a length/radius and color. The order is finished with the word end:Circle 0.5 blueCircle 0.2 redSquare 1 blueSquare 1.5 greenCircle 1 greenSquare 1 greenSquare 2 blueCircle 1 blueSquare 0.5 redendDefine an interface named Shape to handle different shapes with two methods:getColor() and getArea().The program will read the order, calculate the total area of all red, green and blueshapes using the Shape interface and print out the results.

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

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions

Question

Evaluate the importance of diversity in the workforce.

Answered: 1 week ago

Question

Identify the legal standards of the recruitment process.

Answered: 1 week ago