Homework #2 -- sample code

The instructor's version of homework #2 is given in the following source files.

Homework02.java -- main program
Shape.java -- abstract base class
Rectangle.java
Circle.java
Line.java
Ellipse.java

Here is a sample compile, javadoc, and run of the program.

D:\Teaching\CIS370\code>javac -d classes -sourcepath sources ^
	sources\com\bozoid\cis370\hw02\*.java

D:\Teaching\CIS370\code>javadoc -sourcepath sources -d docs/hw02 ^
	com.bozoid.cis370.hw02
Loading source files for package com.bozoid.cis370.hw02...
Constructing Javadoc information...
Standard Doclet version 1.4.1

Generating docs/hw02\constant-values.html...
Building tree for all the packages and classes...
Building index for all the packages and classes...
Generating docs/hw02\overview-tree.html...
Generating docs/hw02\index-all.html...
Generating docs/hw02\deprecated-list.html...
Building index for all classes...
Generating docs/hw02\allclasses-frame.html...
Generating docs/hw02\allclasses-noframe.html...
Generating docs/hw02\index.html...
Generating docs/hw02\packages.html...
Generating docs/hw02\com\bozoid\cis370\hw02\package-frame.html...
Generating docs/hw02\com\bozoid\cis370\hw02\package-summary.html...
Generating docs/hw02\com\bozoid\cis370\hw02\package-tree.html...
Generating docs/hw02\com\bozoid\cis370\hw02\Circle.html...
Generating docs/hw02\com\bozoid\cis370\hw02\Ellipse.html...
Generating docs/hw02\com\bozoid\cis370\hw02\Homework02.html...
Generating docs/hw02\com\bozoid\cis370\hw02\Line.html...
Generating docs/hw02\com\bozoid\cis370\hw02\Rectangle.html...
Generating docs/hw02\com\bozoid\cis370\hw02\Shape.html...
Generating docs/hw02\package-list...
Generating docs/hw02\help-doc.html...
Generating docs/hw02\stylesheet.css...

D:\Teaching\CIS370\code>java -cp classes com.bozoid.cis370.hw02.Homework02
com.bozoid.cis370.hw02.Circle[x=48,y=2,r=14]
com.bozoid.cis370.hw02.Circle[x=21,y=7,r=7]
com.bozoid.cis370.hw02.Rectangle[x=1,y=17,w=28,h=4]
com.bozoid.cis370.hw02.Ellipse[x=19,y=9,w=20,h=5]
com.bozoid.cis370.hw02.Rectangle[x=54,y=21,w=18,h=6]
com.bozoid.cis370.hw02.Circle[x=34,y=1,r=35]
com.bozoid.cis370.hw02.Line[x1=64,y1=2,x2=96,y2=19]
com.bozoid.cis370.hw02.Circle[x=14,y=20,r=7]
com.bozoid.cis370.hw02.Line[x1=58,y1=7,x2=80,y2=9]
com.bozoid.cis370.hw02.Circle[x=11,y=19,r=0]
com.bozoid.cis370.hw02.Line[x1=16,y1=14,x2=17,y2=29]
com.bozoid.cis370.hw02.Rectangle[x=61,y=19,w=8,h=14]
com.bozoid.cis370.hw02.Line[x1=17,y1=21,x2=22,y2=23]
com.bozoid.cis370.hw02.Circle[x=4,y=6,r=21]
com.bozoid.cis370.hw02.Circle[x=26,y=3,r=12]
com.bozoid.cis370.hw02.Line[x1=2,y1=12,x2=7,y2=27]
com.bozoid.cis370.hw02.Ellipse[x=19,y=3,w=32,h=6]
com.bozoid.cis370.hw02.Circle[x=22,y=13,r=25]
com.bozoid.cis370.hw02.Circle[x=64,y=4,r=16]
com.bozoid.cis370.hw02.Rectangle[x=70,y=8,w=28,h=9]

D:\Teaching\CIS370\code>