(Project: Polymorphic Screen Manager Using Shape Hierarchy) Develop a basic graphics package. Use the Shape hierarchy implemented in Exercise 21.13. Limit yourself to two-dimensional shapes such as squares rectangles triangles and circles. Interact with the user. Let the user specify the position size shape and fill characters to be used in drawing each shape. The user can specify more than one of the same shape. As you create each shape place a Shape * pointer to each new Shape object into an array. Each Shape class should now have its own draw member function. Write a polymorphic screen manager that walks through the array sending draw messages to each object in the array to form a screen image. Redraw the screen image each time the user specifies an additional shape. Exercise 21.13 (Shape Hierarchy) Implement the Shape hierarchy designed in Exercise 20.7 (which is based on the hierarchy in Fig. 20.3). Each Two Dimensional Shape should contain function get Area to calculate the area of the two-dimensional shape. Each Three Dimensional Shape should have member functions get Area and get Volume to calculate the surface area and volume respectively of the three-dimensional shape. Create a program that uses a vector of Shape pointers to objects of each concrete class in the hierarchy. The program should print the object to which each vector element points. Also in the loop that processes all the shapes in the vector determine whether each shape is a Two Dimensional Shape or a Three Dimensional Shape. If a shape is a Two Dimensional Shape display its area. If a shape is a Three Dimensional Shape display its area and volume. Exercise 20.7 (Richer Shape Hierarchy) The world of shapes is much richer than the shapes included in the inheritance hierarchy of Fig. 20.3. Write down all the shapes you can think ofboth two-dimensional and three-dimensionaland form them into a more complete Shape hierarchy with as many levels as possible. Your hierarchy should have the base class Shape from which class Two Dimensional Shape and class Three Dimensional Shape are derived. Well use this hierarchy in the exercises of Chapter 21 to process a set of distinct shapes as objects of base-class Shape. (This technique called polymorphism is the subject of Chapter 21.)
PLACE THIS ORDER OR A SIMILAR ORDER WITH homework handlers TODAY AND GET AN AMAZING DISCOUNT
The post (Project: Polymorphic Screen Manager Using appeared first on homework handlers .
“Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!”
The post (Project: Polymorphic Screen Manager Using appeared first on Homework Handlers.
(Project: Polymorphic Screen Manager Using was first posted on July 18, 2019 at 9:18 pm.
©2019 “Nursing Paper Tutors”. Use of this feed is for personal non-commercial use only. If you are not reading this article in your feed reader, then the site is guilty of copyright infringement. Please contact me at email@example.com
The post (Project: Polymorphic Screen Manager Using appeared first on WGU Nursing Essays.