Write an inheritance hierarchy of three-dimensional shapes

Assignment Help Computer Engineering
Reference no: EM132200484

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: EM132200484

Questions Cloud

Display the values of the new list on screen : Read each value from the Stack and multiply its value by 7. Store each of the new values to either a Queue (linked list) or a Priority.
A program that allows the user to input a list of words : Write a Java program that allows the user to input a list of words, separated by whitespace.
Creates and returns a new copy of the received array : Write a Java method that Receives an array of integers of any length and Creates and returns a new copy of the received array.
Write a java application that meets the given specifications : Write a Java application that meets the following specifications. Make sure to give the classes and methods the exact names shown in this prompt.
Write an inheritance hierarchy of three-dimensional shapes : 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.
Write a html files function that computes a taxi fare : Write a HTML and JavaScript files function that computes a taxi fare.
Write down the intermediate words that are constructed : Write down the intermediate words that are constructed after each iteration when the letters in the word "munich" are alphabetically ordered.
Draw a parse tree for the sentence aaababab : Write a grammar for the language consisting of strings built only of the letters a and b. Draw a parse tree for the sentence aaababab.
Write a java application to to ask the user to input : Write a Java application to to ask the user to input an even number between -100 to 100.

Reviews

Write a Review

Computer Engineering Questions & Answers

  How the given systems-enabled tasks are performed

Write a 350- to 525-word description of your use of technology systems in your current or past jobs. If you have no personal experience to draw from.

  Dynamic instruction scheduling

draw the flow-dependence graph for these instructions - leaving everything else unchanged. Unroll the loop three times. If one reschedules the unrolled loop

  A system employs the go-back-n arq protocol with a window

a system uses the go-back-n arq protocol with a window size of 7. if each packet carries 1000 bits of data how long

  Which one would you install and why

Suppose you are building a computer system from scratch and have complete discretion as to your choice of operating system. Which one would you install and why?

  Which of these malicious software has been more devastating

Which of these malicious software has been more devastating recently and how could it be prevented or contained?

  Write a program with a graphical interface

Write a program with a graphical interface that allows the user to convert an amount of money between U.S. dollars (USD), Euros (EUR), and British pounds (GBP).

  Do different software programs have different definitions

Do different software programs have different definitions for quality? What experiences have you had with poor software quality? Good quality?

  How many times should we apply the filter for the color

How many times should we apply the filter for the color of the pixel at position (20, 20) to be influenced by the color at pixel (100, 100)?

  What is the relationship between an object and a class

How does a class accomplish abstraction, encapsulation, and data hiding? What is the relationship between an object and a class?

  Write a program that calculates a tip

Write a program that calculates a tip according to the diner's satisfaction as Ask for the diners' satisfaction level using these ratings.

  Create a gui application that allows the user to select rate

Create a GUI application that allows the user to select a rate category, and enters the number of minutes of a call into a text field.

  What is federalism

What is Federalism and why is it unique to the United States compared to other countries?

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