[Solved] ITSE 2317 Program 2 TwoDimensionalShape

$25

File Name: ITSE_2317_Program_2__TwoDimensionalShape.zip
File Size: 376.8 KB

SKU: [Solved] ITSE 2317 Program 2 – TwoDimensionalShape Category: Tag:
5/5 - (1 vote)

Implement the Shape hierarchy shown in the diagram below. 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 its a TwoDimensionalShape, display its area. If its a ThreeDimensionalShape, display its area and volume.

Run your program and copy and paste the output to a file. Create a folder named, fullname_program2. Copy your source code and the output file to the folder. Zip the folder and upload it to Blackboard.

Test Data

Edge .. 2.5

Length .. 2.5

Radius .. 5.75

Base .. 7.95

Height .. 10.33

Shape Hierarchy

This hierarchy begins with the superclass, Shape, which is extended by two subclasses, TwoDimensionalShape and ThreeDimensionalShape. In geometry, Shapes are either two dimensional or three dimensional. The third level of this hierarchy contains specific types of two dimensional shapes and three dimensional shapes. You can follow the arrows from the bottom of the diagram to the topmost superclass in this class hierarchy to identify several is-a relationships. For instance, a Triangle is a TwoDimensionalShape and is a Shape, while a Sphere is a ThreeDimensionalShape and is a Shape.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] ITSE 2317 Program 2  TwoDimensionalShape[Solved] ITSE 2317 Program 2 TwoDimensionalShape
$25