The Best Essay Writing Service

Get started with the best Essay Writing Service around. Simply send us your essay question, and we’ll locate an expertly qualified writer to create an answer like no other. wycieczka do czarnobyla z kijowa po polsku

(Project: Polymorphic Screen Manager Using Shape

(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.)