Skip to content

Commit 897d846

Browse files
committed
Solve: 11~16번 문제 해결
1 parent 1a74739 commit 897d846

File tree

18 files changed

+211
-5
lines changed

18 files changed

+211
-5
lines changed

Challenge/DahyunLim/005.for/solve.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ console.log(a + b);
1717
// a = 11 + 3 = 14
1818
// a + b = 14 + 2 = 16
1919
// 따라서 16
20+

Challenge/DahyunLim/006.false/solve.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
// 5) undefined
1111

1212
/* 답 : 2번
13-
null, undefined, 0, 빈 문자열, NaN, false 를 제외하고는 모두 참인 값 */
13+
null, undefined, 0, 빈 문자열, NaN, false 를 제외하고는 모두 참인 값 */

Challenge/DahyunLim/007.variable/solve.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212

1313
/* 답 : 3, 5번
1414
변수명은 _, $, 문자로 시작
15-
(예약어는 ex.let 불가능) */
15+
(예약어는 ex.let 불가능) */

Challenge/DahyunLim/008.object/solve.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ console.log(d['weight']);
1818
/*
1919
답: 84
2020
키가 중복되었을 경우, 마지막 값을 출력한다.
21-
*/
21+
*/

Challenge/DahyunLim/009.concat/solve.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ console.log(result);
1717
1818
**출력**
1919
2019/04/26 11:34:27
20-
*/
20+
*/

Challenge/DahyunLim/010.star/solve.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ for (let i=1; i<=level; i++){
1919
*****
2020
*******
2121
*********
22-
*/
22+
*/

Challenge/DahyunLim/011.for/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# 문제11 : for를 이용한 기본 활용
2+
3+
1부터 100까지 모두 더하는 Code를 <pass> 부분에 완성하세요. `for`를 사용해야 합니다.
4+
5+
```jsx
6+
let s = 0;
7+
8+
//pass
9+
10+
console.log(s);
11+
```

Challenge/DahyunLim/011.for/solve.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
# 문제11 : for를 이용한 기본 활용
3+
4+
1부터 100까지 모두 더하는 Code를 <pass> 부분에 완성하세요. `for`를 사용해야 합니다.
5+
*/
6+
7+
let s = 0;
8+
9+
//pass
10+
for (let i = 1; i <= 100; i++) {
11+
s += i;
12+
}
13+
14+
console.log(s);
15+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# 문제12 : 게임 캐릭터 클래스 만들기
2+
3+
다음 소스코드에서 클래스를 작성하여 게임 캐릭터의 능력치와 '파이어볼'이 출력되게 만드시오.
4+
**주어진 소스 코드를 수정해선 안됩니다.**
5+
6+
```jsx
7+
**데이터**
8+
<여기에 class를 작성하세요.>
9+
10+
const x = new Wizard(545, 210, 10);
11+
console.log(x.health, x.mana, x.armor);
12+
x.attack();
13+
14+
**출력**
15+
545 210 10
16+
파이어볼
17+
```
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
# 문제12 : 게임 캐릭터 클래스 만들기
3+
4+
다음 소스코드에서 클래스를 작성하여 게임 캐릭터의 능력치와 '파이어볼'이 출력되게 만드시오.
5+
**주어진 소스 코드를 수정해선 안됩니다.**
6+
7+
**데이터**
8+
<여기에 class를 작성하세요.>
9+
10+
const x = new Wizard(545, 210, 10);
11+
console.log(x.health, x.mana, x.armor);
12+
x.attack();
13+
14+
**출력**
15+
545 210 10
16+
파이어볼
17+
*/
18+
19+
class Wizard {
20+
constructor(health, mana, armor) {
21+
this.health = health;
22+
this.mana = mana;
23+
this.armor = armor;
24+
}
25+
attack() {
26+
console.log('파이어볼');
27+
}
28+
}
29+
30+
const x = new Wizard(545, 210, 10);
31+
console.log(x.health, x.mana, x.armor);
32+
x.attack();

0 commit comments

Comments
 (0)