CS-1C Assignment 5

$30.00

Category: You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (2 votes)

1. Create an abstract class called Shape with pure virtual members
called calcPerimeter and calcArea. Create subclasses of Shape
called Square and Triangle that inherited the pure virtual members
above.
2. Write two non-member functions called printPerimeter and
printArea that call the methods calcPerimeter and calcArea
respectfully.
3. Instantiate a Square and a Triangle object.
4. Input the side of a Square and then call the functions
printPerimeter and printArea.
5. Input the length of the three sides of a triangle and then call the
functions printPerimeter and printArea.
6. Output the perimeter and area of the Square and triangle objects.
Use the following data:
Let 9.99 inches be the length of a side of the Square.
The sides of the triangle are 5.0 feet, 12.0 feet, and 13.0 feet
Use Heron’s formula for the triangle
Due March 2