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

Figure Classes #22

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Figure Classes #22

wants to merge 3 commits into from

Conversation

UlaDutchak
Copy link

No description provided.

}

export class Circle {
export class Triangle implements Figure {
shape: Shape;
Copy link

@sasha-morozov sasha-morozov Aug 25, 2021

Choose a reason for hiding this comment

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

  shape: Shape ====> public shape = Shape.triangle

public b: number,
public c: number,
) {
this.shape = Shape.triangle;
Copy link

@sasha-morozov sasha-morozov Aug 25, 2021

Choose a reason for hiding this comment

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

You may remove "this.shape" if you adhere your code to the suggestion I left above

Choose a reason for hiding this comment

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

 погоджуюсь, це код можна прибрати, якщо створити shape як через public і зразу записати в нього triangle

Copy link

@sasha-morozov sasha-morozov left a comment

Choose a reason for hiding this comment

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

Overall, the code is good! Left one suggestion above

public b: number,
public c: number,
) {
this.shape = Shape.triangle;

Choose a reason for hiding this comment

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

 погоджуюсь, це код можна прибрати, якщо створити shape як через public і зразу записати в нього triangle

}

getArea(): number {
const p: number = (this.a + this.b + this.c) / 2;

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.

3 participants