Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Task-4 #5

wants to merge 1 commit into from

Conversation

Dazdroperma
Copy link
Owner

Задание 4
Написать программу, в которой описана иерархия классов: геометрические фигуры (шар, цилиндр, конус). Реализовать методы вычисления объема и площади поверхности фигуры. Продемонстрировать работу всех методов классов, предоставив пользователю выбор типа фигуры для демонстрации.

@MarinaPaley MarinaPaley self-requested a review June 10, 2021 17:09
#pragma once
#define _USE_MATH_DEFINES
#include <cmath>
class GeometricFigures
Copy link
Collaborator

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; }
Copy link
Collaborator

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; }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

аналогично

Comment on lines +8 to +9
virtual const double getVolume() override;
virtual const double getSurfaceArea() override;
Copy link
Collaborator

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;
Copy link
Collaborator

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;
Copy link
Collaborator

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;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

сеттеры?

Comment on lines +7 to +9
virtual ~Ball();
virtual const double getVolume() override;
virtual const double getSurfaceArea() override;
Copy link
Collaborator

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; }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

сеттер

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants