Skip to content

Solve: 21-25 문제풀이 #173

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 19, 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
9 changes: 9 additions & 0 deletions Challenge/SubinChoi/021.set/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 문제21 : set은 어떻게 만드나요?

다음 중 set을 만드는 방법으로 올바른 것을 모두 고르시오.

1) var x = {1, 2, 3, 5, 6, 7};
2) var x = {};
3) var x = new Set('javascript');
4) var x = new Set(range(5));
5) var x = new Set();
11 changes: 11 additions & 0 deletions Challenge/SubinChoi/021.set/solve.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
# 문제21 : set은 어떻게 만드나요?

다음 중 set을 만드는 방법으로 올바른 것을 모두 고르시오.
*/

//1) var x = {1, 2, 3, 5, 6, 7};
//2) var x = {};
var x = new Set("javascript");
// 4) var x = new Set(range(5));
var x = new Set();
9 changes: 9 additions & 0 deletions Challenge/SubinChoi/022.multiple/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 문제22 : 배수인지 확인하기

다음 중 변수 i가 6의 배수인지 확인하는 방법으로 올바른 것은?

1) i / 6 == 0
2) i % 6 == 0
3) i & 6 == 0
4) i | 6 == 0
5) i // 6 == 0
11 changes: 11 additions & 0 deletions Challenge/SubinChoi/022.multiple/solve.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
# 문제22 : 배수인지 확인하기

다음 중 변수 i가 6의 배수인지 확인하는 방법으로 올바른 것은?
*/

// 1) i / 6 == 0
i % 6 == 0;
// 3) i & 6 == 0
// 4) i | 6 == 0
// 5) i // 6 == 0
3 changes: 3 additions & 0 deletions Challenge/SubinChoi/023.OX/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 문제23 : OX문제

`console.log(10/3)`의 출력 결과는 **3**이다.
6 changes: 6 additions & 0 deletions Challenge/SubinChoi/023.OX/solve.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// # 문제23: OX문제

// `console.log(10/3)`의 출력 결과는 ** 3 ** 이다.

//X
//console.log(Math.floor(10/3))
12 changes: 12 additions & 0 deletions Challenge/SubinChoi/024.toUpperCase/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 문제24 : 대문자로 바꿔주세요!

민지는 국제 포럼에서 아르바이트를 하게 되었습니다. 민지는 각 국에서 온 참가자들의 명단을 엑셀로 정리하고 있는데 참가자들 이름이 어떤 이는 전부 소문자, 어떤 이는 전부 대문자로 써져 있는 등 형식이 제각각이었습니다.

민지를 위해 **이름이 입력되면 전부 대문자로 출력되는 프로그램**을 만들어주세요.

```jsx
**입출력**

입력 : mary
출력 : MARY
```
16 changes: 16 additions & 0 deletions Challenge/SubinChoi/024.toUpperCase/solve.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
# 문제24 : 대문자로 바꿔주세요!

민지는 국제 포럼에서 아르바이트를 하게 되었습니다. 민지는 각 국에서 온 참가자들의 명단을 엑셀로 정리하고 있는데 참가자들 이름이 어떤 이는 전부 소문자, 어떤 이는 전부 대문자로 써져 있는 등 형식이 제각각이었습니다.

민지를 위해 **이름이 입력되면 전부 대문자로 출력되는 프로그램**을 만들어주세요.

**입출력**

입력 : mary
출력 : MARY
*/

const input = prompt("이름을 입력해주세요");

console.log(input.toUpperCase());
8 changes: 8 additions & 0 deletions Challenge/SubinChoi/025.circle-area/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 문제 25: 원의 넓이를 구하세요

원의 넓이는 `반지름의 길이 x 반지름의 길이 x 3.14`로 구할 수 있습니다.
함수를 사용하여 원의 넓이를 구하는 코드를 작성해봅시다.

**입력으로 반지름의 길이 정수 n이 주어지면 원의 넓이를 반환하는 함수**를 만들어 주세요.


13 changes: 13 additions & 0 deletions Challenge/SubinChoi/025.circle-area/solve.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// # 문제 25: 원의 넓이를 구하세요

// 원의 넓이는 `반지름의 길이 x 반지름의 길이 x 3.14`로 구할 수 있습니다.
// 함수를 사용하여 원의 넓이를 구하는 코드를 작성해봅시다.

// **입력으로 반지름의 길이 정수 n이 주어지면 원의 넓이를 반환하는 함수**를 만들어 주세요.

const n = prompt("반지름을 입력해주세요");
function circle(radius) {
return n ** 2 * 3.14;
}

circle(n);
6 changes: 6 additions & 0 deletions Challenge/SubinChoi/026.planet_2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# 문제26 : 행성 문제2

우리 태양계를 이루는 행성은 수성, 금성, 지구, 화성, 목성, 토성, 천왕성, 해왕성이 있습니다.
이 행성들의 영어 이름은 Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune입니다.

행성의 한글 이름을 입력하면 영어 이름을 반환하는 프로그램을 만들어 주세요.
20 changes: 20 additions & 0 deletions Challenge/SubinChoi/026.planet_2/solve.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// 문제26 : 행성 문제2

// 우리 태양계를 이루는 행성은 수성, 금성, 지구, 화성, 목성, 토성, 천왕성, 해왕성이 있습니다.
// 이 행성들의 영어 이름은 Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune입니다.

//행성의 한글 이름을 입력하면 영어 이름을 반환하는 프로그램을 만들어 주세요.

const planetNameKor = propmt("행성 이름을 입력해주세요");
const planetNameEng = {
수성: "Mercury",
금성: "Venus",
지구: "Earth",
화성: "Mars",
목성: "Jupiter",
토성: "Saturn",
천왕성: "Uranus",
해왕성: "Neptune",
};

console.log(planetNameEng[planetNameKor]);
14 changes: 14 additions & 0 deletions Challenge/SubinChoi/027.object/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 문제27 : 객체 만들기

첫번째 입력에서는 학생의 이름이 공백으로 구분되어 입력되고, 두번째에는 그 학생의 수학 점수가 공백으로 구분되어 주어집니다.

두 개를 합쳐 **학생의 이름이 key**이고 **value가 수학 점수**인 객체를 출력해주세요.

```jsx
**입력**
Yujin Hyewon
70 100

**출력**
{'Yujin': 70, 'Hyewon': 100}
```
22 changes: 22 additions & 0 deletions Challenge/SubinChoi/027.object/solve.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// # 문제27 : 객체 만들기

// 첫번째 입력에서는 학생의 이름이 공백으로 구분되어 입력되고, 두번째에는 그 학생의 수학 점수가 공백으로 구분되어 주어집니다.

// 두 개를 합쳐 **학생의 이름이 key**이고 **value가 수학 점수**인 객체를 출력해주세요.

// **입력**
// Yujin Hyewon
// 70 100

// **출력**
// {'Yujin': 70, 'Hyewon': 100}

const name = prompt("이름을 차례대로 입력해주세요").split(" ");
const score = prompt("다음으로 점수를 차례대로 입력해주세요").split(" ");
const students = new Object();

for (let i = 0; i < name.length; i++) {
students[name[i]] = parseInt(score[i]);
}

console.log(students);