Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!