Sample Run
Return to assignment description
Here is what the original version of the program should look like
when you run it.
myoung@cs:0~/Assignments/A5]java FigureInfo
Sorted Figure Info
------------------
This program reads in the sizes of several shapes then prints out
information about them in order from smallest to largest.
by Mark Young (A00000000) and ....
NOTE: currently INCOMPLETE
Enter the width and height of a rectangle: 20 10
Enter the width and height of an oval: 30 4
Enter the width and height of a triangle: 55 8
Enter the diameter of a circle: 19
Type Width Height Area Perimeter
---------- ----- ------ --------- ---------
Rectangle 20.0 10.0 200.0 60.0
Oval 30.0 4.0 94.2 53.4
Triangle 55.0 8.0 220.0 118.6
Circle 19.0 19.0 283.5 59.7
|
Here is what it should look like when you're done.
myoung@cs:0~/Assignments/A5]java FigureInfo
Sorted Figure Info
------------------
This program reads in the sizes of several shapes then prints out
information about them in order from smallest to largest.
by Mark Young (A00000000) and ....
Enter the width and height of a rectangle: 30 40
Enter the width and height of a rectangle: 10 20
Enter the width and height of a rectangle: 50 60
Enter the width and height of an oval: 10 20
Enter the width and height of an oval: 50 50
Enter the width and height of an oval: 30 40
Enter the width and height of a triangle: 20 50
Enter the width and height of a triangle: 10 30
Enter the width and height of a triangle: 30 40
Enter the diameter of a circle: 50
Enter the diameter of a circle: 700
Enter the diameter of a circle: 20
Type Width Height Area Perimeter
---------- ----- ------ --------- ---------
Triangle 10.0 30.0 150.0 71.6
Oval 10.0 20.0 157.1 47.1
Rectangle 10.0 20.0 200.0 60.0
Circle 20.0 20.0 314.2 62.8
Triangle 20.0 50.0 500.0 123.9
Triangle 30.0 40.0 600.0 120.0
Oval 30.0 40.0 942.5 110.0
Rectangle 30.0 40.0 1200.0 140.0
Oval 50.0 50.0 1963.5 157.1
Circle 50.0 50.0 1963.5 157.1
Rectangle 50.0 60.0 3000.0 220.0
Circle 700.0 700.0 384845.1 2199.1
|
Here is what it looks like when you do input redirection.
myoung@cs:0~/Assignments/A5]java FigureInfo <SomeFigures.txt
Sorted Figure Info
------------------
This program reads in the sizes of several shapes then prints out
information about them in order from smallest to largest.
by Mark Young (A00000000) and ....
Enter the width and height of a rectangle: Enter the width and height of a recta
ngle: Enter the width and height of a rectangle: Enter the width and height of a
n oval: Enter the width and height of an oval: Enter the width and height of an
oval: Enter the width and height of a triangle: Enter the width and height of a
triangle: Enter the width and height of a triangle: Enter the diameter of a circ
le: Enter the diameter of a circle: Enter the diameter of a circle:
Type Width Height Area Perimeter
---------- ----- ------ --------- ---------
Triangle 10.0 30.0 150.0 71.6
Oval 10.0 20.0 157.1 47.1
Rectangle 10.0 20.0 200.0 60.0
Circle 20.0 20.0 314.2 62.8
Triangle 20.0 50.0 500.0 123.9
Triangle 30.0 40.0 600.0 120.0
Oval 30.0 40.0 942.5 110.0
Rectangle 30.0 40.0 1200.0 140.0
Oval 50.0 50.0 1963.5 157.1
Circle 50.0 50.0 1963.5 157.1
Rectangle 50.0 60.0 3000.0 220.0
Circle 700.0 700.0 384845.1 2199.1
|
Return to
course homepage
/
outline page
/
assignment description