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

  • Home
  • SEARCH
  • 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 165589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:56:52+00:00 2026-05-11T11:56:52+00:00

We’ve gotten a homework assignment in Java, which relates to inheritance. I don’t have

  • 0

We’ve gotten a homework assignment in Java, which relates to inheritance. I don’t have a problem with the programming in itself, but I’m a bit unsure about some of the math, and would like confirmation/corrections from someone a bit more knowledgable.

The assignment starts with a abstract class, GeometricObject, which is extended into three two-dimensional objects. A rectangle, a circle and a triangle. Those three are then extended into a cuboid for the rectangle, a cylinder and a sphere for the circle, and the triangle into a triangular prism.

Each of these three-dimensional objects are hollow, and has a defined thickness and is made of a special metal, so we are to calculate their weight. And herein lies the problem, since I’m a bit unsure as to how I find the ‘inner volume’ on some of them.

  • Cuboid: Here I assume that I can just subtract 2 * thickness from the width, height and depth, and then everything looks fine.
  • Cylinder: Subtract thickness from the radius making up the base, and 2*thickness from the height
  • Sphere: Subtract thickness from the radius
  • Prism: This is where I’m a bit stuck. Each object gets passed a baseline, height of the triangle, and the height for the entire prism. How can I use this in order to find the ‘inner prism’ representing the inner volume?

Update: Forgot to mention that when creating the object, we specify the outmost sizes, and the hollow part is inside of this. The other way around is not allowed.

Update again: The triangle is an isosceles triangle.

Update yet again: Mixed up radius and diameter for the circular. Corrected now.

  • 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. 2026-05-11T11:56:52+00:00Added an answer on May 11, 2026 at 11:56 am

    I think you cannot get this result from the data you have (baseline length & triangle height). You have to get other information, like location of the points or the angles at the baseline.

    Edit: since the triangle is isosceles:

    As AnthonyWJones already pointed out, the inner triangle is similar to the outer triangle. Therefore, the only thing you need is find the ratio between the two.

    sketch http://img76.imageshack.us/img76/4164/g2654.png

    You can find it easily from the height. Since triangles CQP and ACS are similar

    h2 : |PQ| = |AC| : |AS| 

    where

    |PQ| = h1 (= the thickness of the metal) |AC| = sqrt(base^2/4+height^2) |AS| = base/2 

    Then, you compute h2 and the ratio r = (height - h1 - h2)/height is the ratio between the two triangles. The area of the inner triangle is then r^2 * area of the outer triangle.

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

Sidebar

Ask A Question

Stats

  • Questions 115k
  • Answers 115k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Alex, Note my most recent edit. The issue has to… May 11, 2026 at 10:29 pm
  • Editorial Team
    Editorial Team added an answer So the answer here, at least for the services I'm… May 11, 2026 at 10:29 pm
  • Editorial Team
    Editorial Team added an answer Yes, I care about code aesthetics.. Code that is aestheticly… May 11, 2026 at 10:29 pm

Related Questions

We are developing a little application that given a directory with PDF files creates
We have been using CruiseControl for quite a while with NUnit and NAnt. For
We have a requirement in project to store all the revisions(Change History) for the
We have a remoting singleton server running in a separate windows service (let's call
We have an SVN repository running on a Windows server, and I want to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.