1. Consider a three-dimensional (3-D) geometric shape as a concept. Any such 3-D shape will have...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Consider a three-dimensional (3-D) geometric shape as a concept. Any such 3-D shape will have a volume and surface area, but until you know the nature of the shape and its attribute dimensions, these will be abstract in nature. o Design and implement an inheritance hierarchy starting with a 3-D shape, then a set of at least three derived classes that define regular 3-D shapes such as a cube, sphere, cylinder, and so on. Include with your submission a UML class diagram showing the design. o Any general 3-D shape will have a name, but few other attributes. For each derived shape, store fundamental attribute data about its dimensions, and provide methods to access and modify this data. In addition, provide appropriate methods to compute each shape's volume and surface area. For example, a cube has a volume of s3 where s is the length of a side, whereas a sphere has a volume of 4tr/3 where r is the radius. In terms of style, every class should have constructors and a tostring () method that properly uses inheritance. o Create a driver class with an array reference for 3-D shapes, and instantiate several shapes of different types and dimensions to exercise the behaviour you provided. 1. Consider a three-dimensional (3-D) geometric shape as a concept. Any such 3-D shape will have a volume and surface area, but until you know the nature of the shape and its attribute dimensions, these will be abstract in nature. o Design and implement an inheritance hierarchy starting with a 3-D shape, then a set of at least three derived classes that define regular 3-D shapes such as a cube, sphere, cylinder, and so on. Include with your submission a UML class diagram showing the design. o Any general 3-D shape will have a name, but few other attributes. For each derived shape, store fundamental attribute data about its dimensions, and provide methods to access and modify this data. In addition, provide appropriate methods to compute each shape's volume and surface area. For example, a cube has a volume of s3 where s is the length of a side, whereas a sphere has a volume of 4tr/3 where r is the radius. In terms of style, every class should have constructors and a tostring () method that properly uses inheritance. o Create a driver class with an array reference for 3-D shapes, and instantiate several shapes of different types and dimensions to exercise the behaviour you provided.
Expert Answer:
Answer rating: 100% (QA)
To design and implement an inheritance hierarchy for 3D geometric shapes we can create the following ... View the full answer
Related Book For
Auditing and Assurance Services Understanding the Integrated Audit
ISBN: 978-0471726340
1st edition
Authors: Karen L. Hooks
Posted Date:
Students also viewed these operating system questions
-
In this question assume that p and q are atomic formulae. (a) Compare and contrast path formulae and state formulae in temporal logic. [4 marks] (b) Describe and contrast the meanings of F(G p) and...
-
answer the question clearly You are building a flight-control system for which a convincing safety case must be made. Would you assign the tasks of safety requirements engineering, test case...
-
One item is omitted in each of the following summaries of balance sheet and income statement data for the following four different corporations: Determine the missing amounts, identifying them...
-
As a portfolio manager, you commonly take short positions in stocks that have a high short interest margin. What is the advantage of focusing on these types of firms? What is a possible disadvantage?
-
In an article in Public Roads (1983), Bissell, Pilkington, Mason, and Woods study bridge safety (measured in accident rates per 100 million vehicles) and the difference between the width of the...
-
Discuss major concerns in controlling and reducing the spread of hospital-acquired infections.
-
Selected accounts for Brianna??s Salon are presented below. All June 30 postings are from closing entries.Instructions(a) Prepare the closing entries that were made.(b) Post the closing entries to...
-
1 . Discuss the accounting requirements for stock compensation plans under GAAP ( ASC 7 1 8 ) . 2 . Discuss the valuation techniques / models used to estimate the fair value for employee share...
-
10 6. 4. 5. 7. PROJECT STEPS Carla Arranga is a senior account manager at Ensight Healthcare Consultants, a consulting firm that works with hospitals, clinics, and other healthcare providers around...
-
Delta Company produces a single product. The cost of producing and selling a single unit of this product at the company's normal activity level of 103,200 units per year is: Direct materials. $2.10...
-
Your job is to paint a row of n houses red, green, or blue so as to minimize total cost, where cost(i, color) = cost to pain house i the specified color. You may not paint two adjacent houses the...
-
Are you optimistic or pessimistic about the future? Why?
-
Would the export of hazardous waste to developing countries be efficient? Sometimes? Always? Never? Would it be moral? Sometimes? Always? Never? Make clear the specific reasons for your judgments.
-
Future generations can cast neither votes in current elections nor dollars in current market decisions. Therefore, it should not come as a surprise to anyone that the interests in future generations...
-
Fertility rates vary widely among various ethnic groups in the United States. Black and Spanish-speaking Americans have above-average rates, for example, while Jews have below-average fertility...
-
Given a thin glass-epoxy unidirectional lamina with 0-50' with the applied state of stress (0, 0, 1)-(7.5, -5. 2.5) ksi, use the material properties from Lesson 5, Slide 20 to: a) Sketch a complete...
-
DEPARTMENT DATA EMPLOYEE DATA EmployeeNumber FirstName Mary Rosalie Richard George Alan 3 4 5 7 8 9 855555ES 12 13 14 15 16 17 Create the database tables in SQL or ACCESS: 18 19 20 PROJECT DATA Ken...
-
Why is assessing the risk of fraud important for the planning stage? What do the audit standards require regarding fraud risk during planning?
-
What audit procedures are useful for a financial statement audit but not an ICFR audit, and why?
-
Fred is a partner at D&Y, an international professional services firm. Freds primary client, Green Investments, is a publicly traded holding company with subsidiaries around the world. Most of Green...
-
What are a manager's resources?
-
What are the three levels of management?
-
What is the glass ceiling?
Study smarter with the SolutionInn App