-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGeometry.cpp
More file actions
46 lines (35 loc) · 1.04 KB
/
Copy pathGeometry.cpp
File metadata and controls
46 lines (35 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//============================================================================
// Name : Geometry.cpp
// Author : Mike Dietz
// Version :
// Copyright : All Rights Reserved
// Description : Pure virtual functions providing interface framework.
//============================================================================
#include <iostream>
#include "Shape.h"
#include "Rectangle.h"
#include "Triangle.h"
#include "Box.h"
#include "Circle.h"
using namespace std;
using namespace Shapes;
int main(void) {
Rectangle Rect;
Triangle Tri;
Box Bx;
Circle Cr;
Rect.setHeight(17);
Rect.setWidth(10);
Tri.setHeight(7);
Tri.setWidth(10);
Bx.setHeight(7);
Bx.setWidth(10);
Bx.setLength(7);
Cr.setRadius(5);
// Print the area of the object.
cout << "Total Rectangle area: " << Rect.getArea() << "\n\n" << endl;
cout << "Total Triangle area: " << Tri.getArea() << "\n\n" << endl;
cout << "Total Circle area: " << Cr.getArea() << "\n\n" << endl;
cout << "Volume of Box: " << Bx.getVolume() << "\n\n" << endl;
return 0;
}