-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrectangle.cpp
More file actions
executable file
·45 lines (39 loc) · 1.01 KB
/
rectangle.cpp
File metadata and controls
executable file
·45 lines (39 loc) · 1.01 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
#include "shape.h"
#include "rectangle.h"
#include "quadrilateral.h"
#include <iostream>
rectangle::rectangle(string nam, string col, int w, int h):quadrilateral(nam,col,w, h){
//void setName(string nam);
//void setColor(string col);
//setHeight( h); //void already defined in header prototype..
//setWidth( w);
}
void rectangle::draw()
{
cout << getName() << endl << getColor() << endl << "Height is " << getHeight() << endl << "Width is " << getWidth() <<endl
<<"area is "<<CalArea(getWidth(), getHeight())<<endl<< "is square (1,0)?: " << isSquare(getWidth(), getHeight()) << endl;// getisSquare();<-do from main
}
double rectangle::CalArea(double w, double h) {
return w*h;
}
/*double rectangle::setCalArea() {
area;
}*/
bool rectangle::isSquare(int w, int h) {
if (w == h)
{
return true;
}
else
{
return 0;
}
}
/*bool rectangle::getisSquare() {
if(width==height){}
}
/*bool rectangle::getisSquare() {
if(width==height)
return true;
else return false;
}*/