Sale!

CS-1C Assignment 5 solved

Original price was: $35.00.Current price is: $28.00. $23.80

Category:

Description

5/5 - (7 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