From af161d42c319263b78d3181df9c26a3ca64f5c1d Mon Sep 17 00:00:00 2001 From: TheWitness63 <146203277+TheWitness63@users.noreply.github.com> Date: Tue, 31 Dec 2024 05:46:28 +0500 Subject: [PATCH] figures.hpp --- task2/figures.hpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/task2/figures.hpp b/task2/figures.hpp index 65a6110..92acf8a 100644 --- a/task2/figures.hpp +++ b/task2/figures.hpp @@ -19,23 +19,51 @@ class Figure { class Rect : public Figure { +private: + double width; + double height; + +public: + Rect(double a, double b); + FigureType Type() const override; + double Perimeter() const override; + double Area() const override; }; class Triangle : public Figure { + double a, b, c; + +public: + Triangle(double side_a, double side_b, double side_c); + FigureType Type() const override; + double Perimeter() const override; + double Area() const override; }; class Circle : public Figure { +private: + double a; + +public: + Circle(double radius); + FigureType Type() const override; + double Perimeter() const override; + double Area() const override; }; std::unique_ptr
make_figure(FigureType type, double a, double b = 0, double c = 0); class WrongTriangle : public std::invalid_argument { +public: + using std::invalid_argument::invalid_argument; }; class LessThanZeroParam : public std::invalid_argument { +public: + using std::invalid_argument::invalid_argument; };