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

  Method takes string and integer as parameters

Write a method called multiConcat which takes a String and an integer as parameters. Return String made up of the string parameter concatenated with itself count times.

  Reducing the average memory access time

Suppose that increasing the line size to 128 bytes increases the H to 0.97. Does this reduce the average memory access time?

  Write program which takes as input arithmetic expression

Write program which takes as input an arithmetic expression. The program outputs whether expression contains matching grouping symbols.

  Write program for bucket sort containing method called sort

Columns indexed from 0 to n - 1, where n is the number of values to be sorted. Each row of the two-dimensional array is referred to as a bucket. Write a class named BucketSort containing a method called sort.

  Create e-r diagram for sell and buy of antiques

Create E-R diagram for following situation (state any assumptions you believe you have to make to develop diagram): XYZ Antiques buys and sells one-of-a kind antiques of all kinds

  Subdividing address block among four different customers

The ISP needs to subdivide the address block among four different customers, requiring 29, 28, 27, and 26 hosts respectively.

  Program to prompt a user for hourly pay rate

Create program called "calculatePay" which will prompt user for their hourly pay rate.

  Write vl program to convert leagues-number of nautical miles

Write a VL program which will convert 20,000 leagues to number of nautical miles. Your program requires no input elements, just elements to compute result and output how many nautical miles is equivalent to 20,000 leagues.

  Program to read information from keyboard

Write a C++ program that reads the following information from the keyboard terminated with the sentinel -999 in the Student Number, and stores the records in arrays (3 separate arrays).

  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.

  Create program to calculate and display number of miles

Create a program to calculate and displays the number of miles per hour over the speed limit that a speeding driver was doing. The program should ask for the speed limit and the drivers speed.

  Program to match exam score to a letter grade

Create algorithm which will prompt the operator for student's serial number and student's exam score out of 100. Your program is then to match exam score to a letter grade.

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