-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path05_conditions_excercise.html
109 lines (85 loc) · 2.3 KB
/
05_conditions_excercise.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
/*
const testNum=prompt("갯수를 입력하세요?");
if(testNum % 2 == 0){
document.write("짝수");
}else {
document.write("홀수");
}*/
</script>
<script>
/*const test1=prompt("점수1를 입력하세요?");
const test2=prompt("점수2를 입력하세요?");
if(test1 >=80 && test2>=80){
document.write("통과");
}else{
document.write("재시험");
}*/
</script>
<script>
/*const test3=prompt("점수1를 입력하세요?");
const test4=prompt("점수2를 입력하세요?");
const ave = (test3 + test4)/2;
if(test3 >=80 && test4>=80 && ave>=80){
document.write("합격");
}else{
document.write("불합격");
}*/
</script>
<script>
/* const testNum=prompt("점수를 입력하세요?");
if(testNum >= 90) {
document.write("A");
}else if(testNum >= 80){
document.write("B");
}else if(testNum >= 70){
document.write("C");
}else if(testNum >= 60){
document.write("D");
}else{
document.write("F");
}*/
</script>
<script>
/*
const a=80;
const b=70;
let c;
let avg;
c = a + b;
avg = c/2;
if(avg>=80){
//document.write("평균 : "+avg+" (합격)");
document.write(`평균 : ${avg} (합격)`);
}else{
//document.write("평균 : "+avg+" (불합격)");
document.write(`평균 : ${avg} (불합격)`);
}
*/
</script>
<script>
const num1=30;
const num2=20;
num1>=num2 ? alert("참(true)일 경우") : alert("거짓(false)일 경우");
/*if(num1>=num2){
alert("참(true)일 경우")
}else{
alert("거짓(false)일 경우")
};*/
/*if(num1>=num2)
alert("참(true)일 경우");
else
alert("거짓(flase)일 경우");
*/
</script>
</body>
</html>