Skip to content

step2_1 다각형의 넓이 구현#52

Merged
crongro merged 1 commit intocode-squad:Soorealbutnicefrom
soojinroh:step1
Apr 8, 2019
Merged

step2_1 다각형의 넓이 구현#52
crongro merged 1 commit intocode-squad:Soorealbutnicefrom
soojinroh:step1

Conversation

@soojinroh
Copy link
Copy Markdown

@soojinroh soojinroh commented Apr 8, 2019

Michelle & 수리
다각형의 넓이 구하기 함수 구현

1. 반지름을 입력받아 원의 넓이를 계산하는 함수
2. 사각형의 넓이를 계산하는 함수
3. 사다리꼴의 넓이를 계산하는 함수
4. 원기둥의 넓이를 계산하는 함수
위의 네 개의 함수를 구현하고 숫자가 아닌 경우, 인자의 갯수가 틀린 경우 에러를 반환합니다.
Copy link
Copy Markdown
Contributor

@crongro crongro left a comment

Choose a reason for hiding this comment

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

리뷰남겨드린 것 참고하세요.
담백하게 잘 구현했어요.

@@ -0,0 +1,48 @@
const {PI} = Math
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

오 ! 디스트럭츄링~

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

pow는 왜 안했어요?

}

function cylinderArea(r, h) {
checkArgumentCount(arguments, 2);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

이런방법이 어색하지만, 요구사항에는 맞는 방법이에요~!

checkArgumentCount(arguments, 2);
checkType(arguments);

return (2 * PI * Math.pow(r, 2)) + 2 * PI * r * h
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

circleArea를 재사용할 수 있다면 더 좋을 듯.

@crongro crongro merged commit afdf974 into code-squad:Soorealbutnice Apr 8, 2019
@crongro crongro mentioned this pull request Apr 8, 2019
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