Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

public class Lab 2 pm { public static void main ( String [ ] args ) { GeoShape [ ] shapes = new GeoShape [

public class Lab2pm
{
public static void main(String[] args)
{
GeoShape[] shapes = new GeoShape[3];
shapes[0]= new Circle("red", "circle", 5.0);
shapes[1]= new Rectangle("blue", "rectangle", 4.0,6.0);
shapes[2]= new Hexagon("pink","hexagon", 7.2);
// replace my name with your name
System.out.println("Programmer is Dr. Johnson
");
// NOTE: output for first shape should be:
// Shape: circle
// Color: red
// Area: 78.53981633974483
// Perimeter: 31.41592653589793
//--------------------
int i=0;
for (i=0; i

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

Databases In Networked Information Systems 6th International Workshop Dnis 2010 Aizu Wakamatsu Japan March 2010 Proceedings Lncs 5999

Authors: Shinji Kikuchi ,Shelly Sachdeva ,Subhash Bhalla

2010th Edition

3642120377, 978-3642120374

More Books

Students also viewed these Databases questions

Question

how can an auditor support ethical practices

Answered: 1 week ago

Question

How to solve maths problems with examples

Answered: 1 week ago

Question

b. What groups were most represented? Why do you think this is so?

Answered: 1 week ago