Write an inheritance hierarchy of three-dimensional shapes

Assignment Help Computer Engineering
Reference no: EM132200474

Write an inheritance hierarchy of three-dimensional shapes.

First, you should create an abstract class that represents all ThreeDimensionalShapes and has methods for finding the volume and surface area of the shapes.

Then, you should create three subclasses that inherit from the original class : Sphere, Cube, and Tetrahedron.

Each class should have an instance variable representing the dimensions of the shape (for example, the Sphere class should have an instance variable representing its radius), and each class should properly implement the methods to find surface area and volume.

(Assume the Tetrahedron class represents a regular Tetrahedron.)

Test your classes in a program that asks the user which shape they'd like to create, and what dimensions they'd like to give it.

The program should print the surface area and volume of the shape (rounded to two decimal places) before terminating.

Reference no: EM132200474

Questions Cloud

What is net neutrality : Access to Cable, Broadcast TV, Broad-band Internet, and cellular service in your home county or country 10 years ago.
Write a gui application for the webbuy company : The "Message:" area should allow multiple lines of input and be able to scroll if necessary to accommodate a long message.
Record the name of the person and their score : Write the guessing game (1-1000). AND: Record the name of the person and their score # guesses taken) in a database.
What annual cash flow is needed to make the plant profitable : At a 7 percent discount rate, what annual cash flow is needed to make the 500-megawatt plant profitable? What about using NG at half the cost of coal?
Write an inheritance hierarchy of three-dimensional shapes : Create an abstract class that represents all ThreeDimensionalShapes and has methods for finding the volume and surface area of the shapes.
Write a java program which validates that the entry : Write a java program which Validates that the entry is a positive integer and Outputs the digits in reverse order with a space separating the digits.
How might you measure the direct output of the state : How might you measure the direct output of the state? How might that differ from the consumer output that citizens experience?
Encapsulates statistics for summer job salaries for a group : Write a java class (and a client class to test it) that encapsulates statistics for summer job salaries for a group of people over several years.
Calculate the wavelength for the electronic transition : Calculate the wavelength (in nm) for the electronic transition from n = 3 to n = 5 in the hydrogen atom.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Identify specific cyber laws and ethics regulations

Identify specific cyber laws and ethics regulations that pertain to the organization and its computing operations in the scenario

  Create a preliminary design for a possible two-table

Create a preliminary design for a possible two-table database for this scenario locating the fields in the most appropriate tables.

  Prepare an html document that describes an ordered list

Prepare and test an HTML document that describes an ordered list with the following contents: The highest level should be the names of your parents.

  Write the xhtml and css code for an embedded style sheet

Write the XHTML and CSS code for an embedded style sheet that configures links without underlines; background color of white and text color of black.

  Write a function that takes as input a start time

Write a function that takes as input a start time and an end time represented as an int, using military notation.

  Most operating systems employ a virtual memory manager vmm

most operating systems use a virtual memory manager vmm whose responsibility is to manage the relationship between the

  Creation of process mapping descriptions

INF80028 – Business Process Management - Swinburne University of Technology - Creation of process mapping descriptions using Business Process Modelling Notation

  What are the primary functions of the ir policy

What are the primary functions of the IR Policy? What characteristics must be present if an adverse event is to be considered an incident?

  Compute factorial function either with a loop or recursively

compute the factorial function either with a loop, using definition that n! = 1 × 2 × . . . × n, or recursively, using definition that 0!=1 and n! = (n-1)!xn.

  What can you find out regarding the cryptosystems and

1. go to a popular online electronic commerce site like amazon.com. places several items in your shopping cart and

  Write a function day name that consumes a parameter

Write a function day Name that consumes a parameter, day, containing the numerical value of a day in December 2011.

  Find growth of cloud computing

There are others that are considering moving most of their IT operations to an applications management service provider that does not use the cloud.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd