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 threats for which a matching vulnerability exists

The Assignment Using the NIST Special Publication 800-30, complete a Risk Assessment to identify potential threats for which a matching vulnerability exists in the above described environment.

  Make a computer systems to control sections of rail track

A large corporation used to make computer systems to control sections of rail track. The designers of these systems were not permitted to use interrupts.

  Determining the spped of a computer

determining the spped of a computer

  Describe technology products that are affected by regulation

Examine and describe in your own words possible conflicts between government regulation for cybersecurity and technology innovation.

  Write procedure that get a specified number of float values

Write a procedure that will get a specified number of Float values from the keyboard and return their average.

  What are some of the changes to technology

How has this technology impacted the development of new software? Even if the technology change is hardware related, software development can be impacted.

  Backgroundjulia and robert have made progress in the

backgroundjulia and robert have made progress in the development of a strategic plan for kahuna cleaning supply. robert

  Describe the two site examples which have images or

what are two site examples that have images or multimedia that are used effectively on the site? why do you think they

  Questionconsider a simplified tcps aimd algorithm where

questionconsider a simplified tcps aimd algorithm where congestion window size is measured in number of segments not in

  Create a flash movie that animates two figures

Create a Flash movie that animates two figures, one from the top to the bottom of the left side of the stage and the other on the right side of the stage.

  When is off-line programming normally used

Timers and counters use words of memory, but contacts, coils, and branch start instructions do not.

  Write a monitor to coordinate access to the file

The process priority number must be greater than or equal to the priority numbers all of the other processes that are currently accessing the file.

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