Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8989383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:14:44+00:00 2026-06-15T22:14:44+00:00

I’m not asking for all the answers just if someone can help guide me

  • 0

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.

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

} 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T22:14:45+00:00Added an answer on June 15, 2026 at 10:14 pm

    Use an ide like eclipse for coding in java, that makes life a lot easier.

    I see the skeleton code of your assignment is already present. You just need to over-ride these 4 methods in each of the child classes that extend the Container class

    double getTopArea()
    
    double getTopPerimeter()
    
    double getVolume()
    
    double getSurfaceArea()
    

    and then return the proper values that can be calculated using the specific formula’s for each shape.

    Example

    class RectangularContainer extends Container {
        double height, width, length;
    
        RectangularContainer(double height, double width, double length) {
             this.height = height;
             this.width = width;
             this.length = length;
        }
    
        double getTopArea() {
             return height*width;
        }
    
        double getTopPerimeter() {
             return 2*(height+width);
        }
    
        double getVolume() {
             return height*width*height;
        }
    
        double getSurfaceArea() {
             // ooh I can't remember this one... try to figure out this :)
        }
    
    } 
    

    You should also try to enhance this code by adding proper access modifiers to the methods and variables.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have a text area in my form which accepts all possible characters from
Let's say I'm outputting a post title and in our database, it's Hello Y’all
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a small JavaScript validation script that validates inputs based on Regex. I
I have this code to decode numeric html entities to the UTF8 equivalent character.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.