Skip to content

Solve : 9,10,11,12 #153

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

Merged
merged 2 commits into from
Jun 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Challenge/HeejinKim/009.concat/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 문제9 : concat을 활용한 출력 방법

다음 소스 코드를 완성하여 날짜와 시간을 출력하시오.

```jsx
**데이터**
var year = '2019';
var month = '04';
var day = '26';
var hour = '11';
var minute = '34';
var second = '27';

var result = //빈칸을 채워주세요

console.log(result);

**출력**
2019/04/26 11:34:27
```
30 changes: 30 additions & 0 deletions Challenge/HeejinKim/009.concat/solve.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
# 문제9 : concat을 활용한 출력 방법

다음 소스 코드를 완성하여 날짜와 시간을 출력하시오.

**데이터**
var year = '2019';
var month = '04';
var day = '26';
var hour = '11';
var minute = '34';
var second = '27';

var result = //빈칸을 채워주세요

console.log(result);

**출력**
2019/04/26 11:34:27
*/
var year = "2019";
var month = "04";
var day = "26";
var hour = "11";
var minute = "34";
var second = "27";

var result = `${year}/${month}/${day} ${hour}:${minute}:${second}`;

console.log(result);
18 changes: 18 additions & 0 deletions Challenge/HeejinKim/010.star/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 문제10 : 별 찍기

크리스마스 날, 은비는 친구들과 함께 파티를 하기로 했습니다. 그런데, 크리스마스 트리를 사는 것을 깜빡하고 말았습니다. 온 가게를 돌아다녀 봤지만 크리스마스 트리는 모두 품절이었습니다.
하는 수 없이 은비는 프로그래밍으로 트리를 만들기로 합니다.

**은비를 위해 프로그램을 작성해 주세요.**

```jsx
**입력**
5

**출력**
*
***
*****
*******
*********
```
36 changes: 36 additions & 0 deletions Challenge/HeejinKim/010.star/solve.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
# 문제10 : 별 찍기

크리스마스 날, 은비는 친구들과 함께 파티를 하기로 했습니다. 그런데, 크리스마스 트리를 사는 것을 깜빡하고 말았습니다. 온 가게를 돌아다녀 봤지만 크리스마스 트리는 모두 품절이었습니다.
하는 수 없이 은비는 프로그래밍으로 트리를 만들기로 합니다.

**은비를 위해 프로그램을 작성해 주세요.**

**입력**
5

**출력**
*
***
*****
*******
*********
*/

// function star(num) {
// for (let i = 0; i < num+1; i++) {
// for (let j = 1; j < i + 2; j += 2) {
// console.log("*".repeat(j));
// }
// }
// }

// star(5);

function start(num) {
for (let i = 0; i < num; i++) {
console.log(" ".repeat(num - i) + "*".repeat(2 * i + 1));
}
}

start(5);
11 changes: 11 additions & 0 deletions Challenge/HeejinKim/011.for/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 문제11 : for를 이용한 기본 활용

1부터 100까지 모두 더하는 Code를 <pass> 부분에 완성하세요. `for`를 사용해야 합니다.

```jsx
let s = 0;

//pass

console.log(s);
```
19 changes: 19 additions & 0 deletions Challenge/HeejinKim/011.for/solve.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
# 문제11 : for를 이용한 기본 활용

1부터 100까지 모두 더하는 Code를 <pass> 부분에 완성하세요. `for`를 사용해야 합니다.

let s = 0;

//pass

console.log(s);
*/

let s = 0;

for (let i = 1; i <= 100; i++) {
s += i;
}

console.log(s);
17 changes: 17 additions & 0 deletions Challenge/HeejinKim/012.class/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 문제12 : 게임 캐릭터 클래스 만들기

다음 소스코드에서 클래스를 작성하여 게임 캐릭터의 능력치와 '파이어볼'이 출력되게 만드시오.
**주어진 소스 코드를 수정해선 안됩니다.**

```jsx
**데이터**
<여기에 class를 작성하세요.>

const x = new Wizard(545, 210, 10);
console.log(x.health, x.mana, x.armor);
x.attack();

**출력**
545 210 10
파이어볼
```
46 changes: 46 additions & 0 deletions Challenge/HeejinKim/012.class/solve.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
# 문제12 : 게임 캐릭터 클래스 만들기

다음 소스코드에서 클래스를 작성하여 게임 캐릭터의 능력치와 '파이어볼'이 출력되게 만드시오.
**주어진 소스 코드를 수정해선 안됩니다.**

**데이터**
<여기에 class를 작성하세요.>

const x = new Wizard(545, 210, 10);
console.log(x.health, x.mana, x.armor);
x.attack();

**출력**
545 210 10
파이어볼
*/

class Wizard {
constructor(health, mana, armor) {
this.health = health;
(this.mana = mana), (this.armor = armor);
}
attack() {
console.log("파이어볼");
}
}

const x = new Wizard(545, 210, 10);
console.log(x.health, x.mana, x.armor);
x.attack();

// class Wizard {
// constructor(health, mana, armor) {
// this.health = health;
// this.mana = mana;
// this.armor = armor;
// }
// attack() {
// console.log("파이어볼");
// }
// }

// const x = new Wizard(545, 210, 10);
// console.log(x.health, x.mana, x.armor);
// x.attack();