{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

iLab3 - class Cylinder cfw public static void main(String...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
class Cylinder { public static void main(String[] args) { System. out . println( "********************************************************* ********" ); System. out . println( "Program Name: Cylinder.java" ); System. out . println( "Programer's Name: Eric Errichiello" ); System. out . println( "Program Description: Shows radius and volume of a Cylinder " ); System. out . println( "********************************************************* **********" );} private double radius ; private double height ; public Cylinder( double radius, double height) { this . radius = radius; this . height = height; } public double getRadius() { return radius ; } public double getHeight() { return height ; } public double volume() { return radius * radius * height *3.1416; } } class CylinderTest { static void main(String[] args){ Cylinder[] myCylinder = new Cylinder[3]; myCylinder [0] = new Cylinder (2,7); myCylinder [1] = new Cylinder (4,14); myCylinder [2] = new Cylinder (6,21); { { System. out . println( "--------" ); System. out . println( "Radius:" + myCylinder[0].getRadius()); System. out . println( "Height:" + myCylinder[0].getHeight()); System. out . println( "Volume:" + myCylinder[0].volume()); System. out . println( "--------" ); } } } } import java.util.Calendar; import java.util.GregorianCalendar;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
public class Date { public static Calendar cal ; public static void
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}