go to previous page   go to home page   go to next page

Answer:

The complete class is given below.


Finished TestCone Program

Here is the complete TestCone. Unfortunately, until you write the code for Cone the program can't be run.

import java.util.Scanner ;

public class TestCone
{
  public static void main( String[] args ) 
  {
    Scanner scan = new Scanner(System.in);

    double radius, height;

    System.out.print("Enter radius: " ); 
    radius = scan.nextDouble();

    System.out.print("Enter height: " ); 
    height = scan.nextDouble();
 
    Cone cone = new Cone( radius, height );

    System.out.println( "Area "  + cone.area() + " Volume: " + cone.volume() );
  }
}

QUESTION 4:

Can a programmer write a definition for the class Cone?


go to previous page   go to home page   go to next page