-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquadrilateral.cpp
More file actions
executable file
·47 lines (40 loc) · 1.06 KB
/
quadrilateral.cpp
File metadata and controls
executable file
·47 lines (40 loc) · 1.06 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
47
#include "shape.h"
#include "circle.h"
#include "quadrilateral.h"
#include <iostream>
using namespace std;
//quadrilateral::quadrilateral() {}
quadrilateral::quadrilateral(string nam, string col, int h, int w):Shape(nam, col) {
//void setName(string nam); //PRIVATE DATA
//void setColor(string col);
setHeight( h);
setWidth( w);
}
void quadrilateral::draw()
{
//quadrilateral p;
cout << getName()<<endl << getColor() <<endl<< "Width is " << getWidth() << endl << "Height is " << getHeight() << endl <<"Area is "<<CalArea()<<endl<<"Perimeter is "<<getCalPerimater()<<endl;
//cout << name << color;
}
double quadrilateral::CalArea()
{
return width*height; //RECTANGLE
}
void quadrilateral::setHeight(int h) {
height = h;
}
void quadrilateral::setWidth(int w) {
width = w;
}
double quadrilateral::CalPerimater() {
return 2 * (height + width);
}
double quadrilateral::getCalPerimater() {
return 2 * (height + width);
}
int quadrilateral::getHeight() {
return height;
}
int quadrilateral::getWidth() {
return width;
}