29 Jul (PROJECT: POLYMORPHIC SCREEN MANAGER USING
(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.)
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
About Writedemy
We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.
How It Works
To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Are there Discounts?
All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.
