| 8 | void printSums(const std::vector<Shape*>& shapes); |
| 9 | |
| 10 | int main() |
| 11 | { |
| 12 | Circle c1{ Point{1, 1}, 1 }; |
| 13 | Circle c2{ Point{2, 2}, 2 }; |
| 14 | Circle c3{ Point{3, 3}, 3 }; |
| 15 | Rectangle r1{ {4, 5}, 4, 5 }; // Shorter notation (omitted Point type) could of course be used for Circles as well! |
| 16 | Rectangle r2{ {6, 7}, 6, 7 }; |
| 17 | Rectangle r3{ {8, 9}, 8, 9 }; |
| 18 | |
| 19 | std::vector<Shape*> shapes{ &c1, &r1, &r2, &c2, &c3, &r3 }; |
| 20 | |
| 21 | printSums(shapes); |
| 22 | |
| 23 | for (auto* shape : shapes) shape->scale(1.5); |
| 24 | |
| 25 | std::cout << std::endl; |
| 26 | printSums(shapes); |
| 27 | } |
| 28 | |
| 29 | double calculateSumAreas(const std::vector<Shape*>& shapes) |
| 30 | { |