Calculate the area of the two-dimensional shape

Assignment Help Basic Computer Science
Reference no: EM13521770

Question : Implement a Shape hierarchy where Each TwoDimensional Shape should contain the method getArea to calculate the area of the two-dimensional shape.

Each ThreeDimensionalShape should have methods getArea and getVolume to calculate the surface area and volume, respectively, of the three-dimensional shape.

Create a program that uses an array of Shape references to object of each concrete class in the hierarchy. The program should print a text description of the object to which each array element refers. Also, in the loop that processes all the shapes in the array, determine whether each shape is a TwoDimensionalShape or ThreeDimensionalShape.

If it's a TwoDimensionalShape, display its area. If it's a ThreeDimensionalShape, display its area and volume.

Reference no: EM13521770

Questions Cloud

Determine the design of the cut : Determine the design of the cut, including burden and spacing for each element of the cut - burden and spacing of the easer, perimeter and lifer holes
State the amino acid sequence in the n terminal : Given the DNA template strand 3'GCATTCAAG5' write the amino acid sequence in the N terminal to the C terminal direction. Use the three letter amino acid abbreviations.
Determine the intensity of the starlight at the earth : Consider a bright star in our night sky. Assume that its power output is 3.20 1028 W, about 80 times that of the Sun, and that its distance is 21.0 ly. Find the intensity of the starlight at the Earth
Explain the species that react with zn : For groups (a) and (b) below, identify the best oxidizing and the best reducing agent in each group. You should have one oxidizing and one reducing agent (species) for a, and one of each for b. Assume the reaction as written
Calculate the area of the two-dimensional shape : Implement a Shape hierarchy where Each TwoDimensional Shape should contain the method getArea to calculate the area of the two-dimensional shape.
What frequency does betsy hear : Jim is speeding toward James Island with a speed v = 22 m/s when he sees Betsy standing on shore at the base of a cliff. Jim sounds his f = 365-Hz horn. What frequency does Betsy hear
Explain what are there different thermodynamic factors : A bridged ketone intermediate is formed and is isolable and 1,2,3,4-tetraphenylnaphthalene is the only product seen. What are there different thermodynamic factors that account for this
Find the laser beam intensity will produce such a field : One of the weapons considered for the "Star Wars" antimissile system is a laser that could destroy ballistic missiles. What laser beam intensity will produce such a field
Shows the database design for the bicycle rental : Shows the database design for the bicycle Rental business.The Bicycle Rental Business mainly revolves around renting out bicycles to customers on basis of time.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Technology someday eliminate need for antenna maintenance

What technology may someday eliminate this need for antenna maintenance? In your own words, briefly describe how this technology works.

  Asynchronous transaction processing mode

When operating in an asynchronous transaction processing mode, what information must be present in both the pending request and the received response messages for the response to be exclusively matched to its associated pending request?

  Macro running in response to form button

All of the following are events except: a macro running in response to a form button being clicked, changing the data in a cell, clicking on a control button or opening or closing an Excel workbook.

  Optimal value of the objective function

Find the optimal value of the objective function for the following problem by only inspecting its dual. (Do not solve the dual by the simplex method)

  Write a multithreaded program

This program will be passed a series of numbers on the command line and will then create three separate worker threads. One thread will determine the average of the numbers, the second will determine the maximum value, and the third will determine..

  Identify people to interview to learn new training activity

Draft a project scope statement for the TIMS system and describe the constraints. She said be specific. Need to identify the people want to interview to learn more about the new training activity, and prepare a list of the questions I will ask.

  Create a program to keep track of the participants

Create a program to keep track of the participants in a triathlon. Your program will keep track of the times in three events: Running, Swimming, and Biking.

  Receive the measurement for the diam-eter of a circle

Design an algorithm that will prompt for and receive the measurement for the diam-eter of a circle, and calculate and display the area and circumference of that circle. Your program is to continue processing until a sentinel of 999 is entered.

  Which nameserver was provided?

Which nameserver was provided?

  Describe potential challenge for collaboration-it department

Author recommends ways to do this. Describe potential challenge that this type of collaboration might face and explain way of dealing with it.

  Design a system (i) using a rom; and (ii) using a pal.

For the following set of functions, design a system (i) using a ROM; and (ii) using a PAL.

  People spend hundreds and hundreds of dollars

People spend hundreds and hundreds of dollars hiring writers to help them with their resume and cover letters.

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