0

Write down all the shapes you can think of–both two-dimensional and three-dimensional– and form those shapes into a shape hierarchy. Your hierarchy should have superclass Shape, from which class TwoDimensionalShape and class ThreeDimensionalShape are derived. Once you have developed the hierarchy, define each of the classes in the hierarchy. We will use this hierarchy in the exercises to process all shapes as objects of superclass Shape.

i hAVE DONE THIS SO FAR BUT NOW I AM REALLY LOST

public class Shapes {
	int width;
	int length;
	int name;
	int numberOfSides;
	public void displayShape(int x){
		system.out.println("Shapes of diffent dimension")
	}
	public class TwoDimShape extends Shapes{
			public void displayShape(int x) {
			System.out.println("Two dimensional shapes");
				}
	public class ThreeDimShape extends Shapes {
		int height;
		public void displayShape(int x)
			System.out.println("Three dimensional shapes");
	}
		
    public class quadlateral extends TwoDimShape {
    	public void displayshape(x);
    		System.out.println("Quadlateral shapes");
    }
    public class sphere extends ThreeDimShape {
    	public void displayshape(x);
    		System.out.println("Sphere");
    }
    public static void main(String[] args) {
    	
    	Scanner input = new Scanner( System.in );
    	
    }
}

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by Aviras
2

Make a list of the programs requirements:
1) do this
2) do that
etc

and then say which ones you have completed and which ones you are working on.

Please edit your code and wrap it in code tags. Use the [code] icon above the input box.

Votes + Comments
Good advice to newbies on how to get started on a problem.
0

Make a sort of family tree. Just do it on paper. Basicly just do what the assignment says, just don't start coding right away if you haven't fully figured out what you want to do. It saves a lot of time recoding and bug squashing.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.