Find whether each shape is two dimensional shape

Assignment Help Programming Languages
Reference no: EM1371597

Each TwoDimensionalShape should contain 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 objects 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 a ThreeDimensionalShape. If it is a TwoDimensionalShape, display its area. If it is a ThreeDimensionalShape, display its area and volume.

Reference no: EM1371597

Questions Cloud

Existence of externalities : What are some goods and services which produce positive externalities generally produced by the government?
Create web application uses visual web java server : Create the Web application which uses Visual Web Java Server Faces framework and either Apache Tomcat or Glassfish as the server.
Question on quantitative data : You've been asked to apply your decision-making skills and analysis to the merchandising of JMI's travel product stores. Much of the floor display space is taken up by innovations department. Describe the type of accounting quantitative data you wi..
Explain outsourcing is a major issue confronting warehouse : Explain Outsourcing is a major issue confronting warehouse management and Do an Internet search to further expand on the topic
Find whether each shape is two dimensional shape : Find whether each shape is TwoDimensionalShape or a ThreeDimensionalShape. If it is a TwoDimensionalShape, display its area. If it is a ThreeDimensionalShape, display its area and volume.
Explain impact on economy of government spending on health : Please explain impact on economy of Government spending on Health care on interest rates, investments, employment and income in economy. Please follow sequence in question. Explain how interrelationships.
Explain how comfortable would you be working in a culture : Explain How comfortable would you be working in a culture like that of SuccessFactors where a certain level of "niceness" is part of the job description?
Prepare cron file to performs level dump every day : Prepare a cron file which will regularly perform the following backups: performs level 5 dump every day which neither a level 0 nor level 2 dump is performed.
Should joe continue to search or buy a dvd player : Joe's search costs are $7 per search. He wants to buy a DVD player for his wife for Christmas and lowest price he's found so far is $200. Should Joe continue to search or buy a DVD player at a price of $200.

Reviews

Write a Review

Programming Languages Questions & Answers

  Create memo to grace to outline purposes of organization

Create a memo to Grace in which you outline purposes of organization and costs and benefits of becoming a member.

  Write statement essential to call compute interest method

Write statement essential to call the calculate interest method with an account balance of $2300.00 and an interest rate of 5%. What rule must be adhered to when calling a method with multiple parameters?

  Write program to calculate integer part of quotient

Write program segments that accomplish each of the following tasks:Calculate the integer part of the quotient when integer a is divided by integer. Calculate the integer remainder when integer a is divided by integer b.

  Program-visual basic to compute tips for services rendered

Write a program in Visual Basic 2010 to compute tips for services rendered. The program should request the person's occupation, the amount of the bill and the percentage tip

  Benefits of programming with objects and classes

How is it different from programming with functions alone? Write down benefits of programming with objects and classes in Web applications?

  Create program which tests each member of resistor class

Create program which tests each member of Resistor class to ensure that they work properly. Complete the following Tasks: Create main function and instantiate three Resistor Class objects: Resistor1, Resistor2 and Resistor3.

  Expression evaluate to true if string variable equals string

Write an expression that evaluates to true if and only if the string variable equals the string "end". Suppose that the value of s were "friend".

  Probability line is executed in nth iteration of for loop

What is the probability that line is executed during the nth iteration of the for loop? What is the exact expected number of executions of line?

  Design program to asks for number of fat grams

Design a program that asks for the number of fat grams and calories in a food item. Validate the input as follows: Make sure the number of fat grams and calories are not less than 0.

  Create new method public to create and return new picture

Create a new method public Picture frame (int frameSize, Color frameColor) this method will create and return a new picture object.

  Design and algorithm that compute numbers of married men

Design and algorithm that will read through the file and compute the numbers of married men, single men, married women and single women.

  Write procedure list-records whihc returns list of records

Write a procedure called list-records which returns a list of all records by artist from a list of records containing several artists.

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