Aqua Phoenix
     >>  Lectures >>  Java 2  
 

Navigator
   
 
       
   

2.9 Homework 2 Solutions

  HW2.java  
  Shape.java  
  Rectangle.java  
  Ellipse.java  
  Triangle.java  
  Square.java  
  Circle.java  
Example output:

> java HW2
Triangle:  Position 84,47; Color magenta; Side 93
Triangle:  Position 1,54; Color yellow; Side 90
Ellipse:  Position 89,89; Color yellow; Short Axis 38; Long Axis 72
Circle:    Position 6,10; Color blue; Radius 87
Ellipse:  Position 35,31; Color cyan; Short Axis 30; Long Axis 91
Ellipse:  Position 82,57; Color yellow; Short Axis 1; Long Axis 93
Circle:    Position 66,20; Color yellow; Radius 28
Triangle:  Position 17,67; Color cyan; Side 37
Circle:    Position 46,84; Color cyan; Radius 16
Circle:    Position 33,18; Color yellow; Radius 0
Circle:    Position 40,14; Color yellow; Radius 59
Rectangle: Position 3,60; Color cyan; Width 47; Height 19
Triangle:  Position 31,70; Color cyan; Side 5
Circle:    Position 44,50; Color yellow; Radius 73
Rectangle: Position 53,18; Color green; Width 67; Height 30
Ellipse:  Position 59,2; Color red; Short Axis 47; Long Axis 70
Circle:    Position 78,5; Color yellow; Radius 56
Square:    Position 53,96; Color red; Side 20
Triangle:  Position 44,83; Color red; Side 71
Ellipse:  Position 23,11; Color cyan; Short Axis 77; Long Axis 3