Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Any chance people can give me help with my final Java assignment, I don't even know where to start

  1. #1
    Junior Member
    Join Date
    Dec 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Any chance people can give me help with my final Java assignment, I don't even know where to start

    I'm not asking for all the answers just if someone can help guide me in the right direction here since I have no idea where to even start on this thing.

    I'm taking an intro to Java class and have this final HW assignment that if I botch, well I fail. I was out for a few weeks due to a couple deaths so I have till tonight at 10:30 to get this in.

    Here is some of the question:

    You have to create a program that can compute the Surface Area and Volumes of various containers that are all "Right Prisms". This means that the ends of the container are identical and the sides are perpendicular to the ends.
    Each of your containers has different shapes: Circular, Rectangular, Triangular, and Regular Polygon. All of these containers are derived from a common abstract Container class.

    You will then create a class called ContainerCollection which will contain an array of all of the possible Container classes. This class will provide methods to compute the totalVolume and the totalSurfaceArea of all Containers in the ContainerCollection.

    Link to Gist:
    https://gist.github.com/3b9fb22e72b2a3d86e1b

    Text for those who can't get gist:

    abstract class Container {
    	double height;
    	Container(double height)
    	{
    		this.height = height;
    	}
    	abstract double getTopArea();
    	abstract double getTopPerimeter();
     
    	double getVolume()
    	{
    		return height * getTopArea();
    	}
    	double getSurfaceArea()
    	{
    		return 2*getTopArea() + height * getTopPerimeter();
    	}
    }
     
    class CircularContainer extends Container
    {
            // add appropriate data definitions
    	CircularContainer(double height, double radius)
    	{
    		// Fill in details
    	}
    	// implement required abstract methods
    }
     
    class RectangularContainer extends Container
    {
    	// add appropriate data definitions
    	RectangularContainer(double height, double width, double length)
    	{
    		// Fill in details
    	}
    	// implement required abstract methods
    }


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Any chance people can give me help with my final Java assignment, I don't even know where to start

    When you post code please wrap your code with
    [code=java]
    <YOUR CODE HERE>
    [/code]
    to get highlighting and preserve formatting.

    I have till tonight at 10:30 to get this in.
    Please post the code you have and questions about the problems you are having with it.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Replies: 2
    Last Post: December 26th, 2012, 01:08 PM
  2. Replies: 0
    Last Post: July 2nd, 2012, 09:11 PM
  3. I don't know where to start.
    By fidl7ss in forum What's Wrong With My Code?
    Replies: 4
    Last Post: July 1st, 2012, 04:34 PM
  4. Hello Java People! :D
    By StandbyExplosion in forum Member Introductions
    Replies: 2
    Last Post: August 25th, 2011, 08:33 AM
  5. final class, final <variable> or <data member>
    By chronoz13 in forum Object Oriented Programming
    Replies: 9
    Last Post: September 20th, 2009, 08:19 AM