Main purpose of this task is to calculate volumes and surface areas of three dimensional geometric shapes like, cylinders, cones.

Posted by Csc_Girl_Geek on Stack Overflow See other posts from Stack Overflow or by Csc_Girl_Geek
Published on 2011-02-22T03:06:14Z Indexed on 2011/02/24 15:25 UTC
Read the original article Hit count: 136

Filed under:
|

In Java Language

Design your classes as below introducing:

  • an Interface named “GeometricShapes”
  • an abstract class named “ThreeDShapes”
  • two child classes of ThreeDShapes: Cylinders and Cones.
  • One test class names “TestShapes”

Get the output for volumes and surface areas of cylinders and cones along with respective values of their appropriate input variables. Try to use toString() method and array. Your classes should be designed with methods that are required for Object-Oriented programming.

So Far I Have:

package Assignment2;  

    public interface GeometricShapes {

      public void render();
      public int[] getPosition();
      public void setPosition(int x, int y);

    }

   package Assignment2;

   public abstract class ThreeDShapes implements GeometricShapes
   {

      public int[] position;
      public int[] size;

      public ThreeDShapes()
      {

      }

      public int[] getPosition()
      {
         return position;
      }

      public void setPosition(int x, int y)
      {

         position[0] = x;
         position[1] = y;

      }

   }

   package Assignment2;

   public class Cylinders extends ThreeDShapes
   {

      public Cylinder()
      {
      }

      public void render()
      {
      }


   }

I don't think this is right and I do not know how to fix it. :( Please help.

© Stack Overflow or respective owner

Related posts about java

Related posts about homework