Answered step by step
Verified Expert Solution
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 R RSquare L LThe kindergarten places an order with a painting company listing all the required shapeswith a lengthradius and color. The order is finished with the word end:Circle blueCircle redSquare blueSquare greenCircle greenSquare greenSquare blueCircle blueSquare redendDefine an interface named Shape to handle different shapes with two methods:getColor and getAreaThe 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
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