-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
32 lines (25 loc) · 935 Bytes
/
main.cpp
File metadata and controls
32 lines (25 loc) · 935 Bytes
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
#include <iostream>
#include <iomanip>
#include <string>
#include "shape.h"
int main(int argc, char* argv[])
{
rectangle r{5, 3};
square sq{ 5 };
circle cir{ 1 };
triangle tri{ 3,4,5};
const shape& s = tri;
const rectangle r2{ 2,3 };
std::cout << s.area() << std::endl; // 30
std::cout << s.circumference() << std::endl; // 30
std::cout << s.perimeter() << std::endl; // 30
/*********************************************************/
// rectangle(w: XXX, h: XXX, area: XXX, perimeter: XXX) //
// square(s: XXX, area: XXX, perimeter: XXX) //
// circle(r: XXX, area: XXX, circumference: XXX) //
// triangle(?????, area: XXX, perimeter: XXX) //
/*********************************************************/
std::cout << sq << std::endl; // square(s: 5, area: 25, perimeter: 20)
std::cout << s << std::endl; //triangle(b: 12, lside: 13, rside: 5, area: 30, perimeter: 30)
return 0;
}