Wednesday, February 4, 2009

CubeTester

/*Programmer: Norfe Gregorio
 *Programme Name: CubeTester
 *Subject: IT134
 *Instructor: Mr. Dony Dongiapon
 *Date stated: 02/04/09
 *Date end: 02/04/09
 */
import java.util.Scanner;

public class CubeTester{

    public static void main(String args[]){
    Scanner scan=new Scanner(System.in);
    Cube myCube1=new Cube(3,3,3);
    Cube myCube2=new Cube();

System.out.println("The volume and area of a cube with width, height, and length is equal to 3: "+myCube1.displayCube());
System.out.println("Please fill in the following question.");
System.out.print("Enter width value: ");
double w=scan.nextDouble();
System.out.print("Enter height value: ");
double h=scan.nextDouble();
System.out.print("Enter length value: ");
double l=scan.nextDouble();

myCube2.setDimension(w,h,l);
System.out.println("The volume and area of a cube with width, height, and length is being entered by the user are : "+myCube2.displayCube());


}
}


No comments:

Post a Comment