[Solved] CSE 241/505- HW5- Inheritance

$25

File Name: CSE_241/505-_HW5-_Inheritance.zip
File Size: 273.18 KB

SKU: [Solved] CSE 241/505- HW5- Inheritance Category: Tag:
5/5 - (1 vote)

CSE 241/505Object Oriented ProgrammingFall 2018Homework # 5Inheritance

In this homework, you will write a Shape hierarchy for all the shapes that we defined in our previous homework assignments.Class Shape is an abstract class that defines at least the following functions. area that returns the area of the shape perimeter that returns the perimeter Overloaded ++ and operators (both pre and post) for incrementing and decrementing the shape positions by 1.0. Overloaded operators == , !=, and other comparison operators to compare two shapes with respect to their areas.Overloaded global operator<< can be used for printing the shapes to SVG files.Class Rectangle, Triangle, Circle and ComposedShape are derived from base Shape class. They behave like the classes in HW3. Class ComposedShape keeps a vector of Shape pointers for the shape elements.Polygon is an abstract class that derives from class Shape. PolygonVect and PolygonDyn are two concrete classes that derive from Polygon class. One of them uses STL vectors to keep the 2D points, the other uses dynamic memory to keep the 2D points.We also define the following global functions Function printAll takes a vector of Shape pointers and prints all shapes to an SVG file Function printPoly takes a vector of Shape pointers and prints all Polygon shapes to an SVG file Function convertAll takes a vector of Shape pointers, converts all shapes to Polygons and returns a new vector with the new shapes. Function sortShapes takes a vector of Shape pointers and increasingly sorts them with respect to their areas.Use the program that our TA Ahmet Soyyiit showed you during the PS to draw this shape hierarchyIn UML diagrams and submit the results.

Reviews

There are no reviews yet.

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

Shopping Cart
[Solved] CSE 241/505- HW5- Inheritance
$25