-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Task-4 #5
base: main
Are you sure you want to change the base?
Task-4 #5
Conversation
#pragma once | ||
#define _USE_MATH_DEFINES | ||
#include <cmath> | ||
class GeometricFigures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
документация отсутствует
|
||
void GeometricFigures::setRadius(const double radius) | ||
{ | ||
if (radius < eps) { throw - 1; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
("Отрицательный радиус")
|
||
void GeometricFigures::setHeight(const double height) | ||
{ | ||
if (height < eps) { throw - 1; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
аналогично
virtual const double getVolume() override; | ||
virtual const double getSurfaceArea() override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
почему методы virtual
|
||
Cylinder::Cylinder(const double radius, const double height) | ||
{ | ||
radius_ = radius; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
сеттеры?
Cone(const double radius = 0.0, const double height = 0.0); | ||
virtual ~Cone(); | ||
virtual const double getVolume() override; | ||
virtual const double getSurfaceArea() override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
почему virtual
?
|
||
Cone::Cone(const double radius = 0.0, const double height = 0.0) | ||
{ | ||
radius_ = radius; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
сеттеры?
virtual ~Ball(); | ||
virtual const double getVolume() override; | ||
virtual const double getSurfaceArea() override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
аналогично
@@ -0,0 +1,5 @@ | |||
#include"Ball.h" | |||
Ball::Ball(const double radius = 0.0) { radius_ = radius; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
сеттер
Задание 4
Написать программу, в которой описана иерархия классов: геометрические фигуры (шар, цилиндр, конус). Реализовать методы вычисления объема и площади поверхности фигуры. Продемонстрировать работу всех методов классов, предоставив пользователю выбор типа фигуры для демонстрации.