<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
var kor=prompt("국어 성적 입력");
var eng=prompt("영어 성적 입력");
var math=prompt("수학 성적 입력");
var sum=eval(kor)+eval(eng)+eval(math);
var avg=eval(sum/3);
var score1,score2;
document.write("국어 :"+kor+"<br>")
document.write("영어 :"+eng+"<br>")
document.write("수학 :"+math+"<br>")
document.write("합계 :"+sum+"<br>")
document.write("평균 :"+avg+"<br>")
document.write("평균2 :"+parseInt(avg)+"<br>")
if(eval(avg)>=90){
score1="A";
} else if(eval(avg)>=80&&avg<90){
score1="B";
} else if(eval(avg)>=70&&avg<80){
score1="C";
} else if(eval(avg)>=60&&avg<70){
score1="D";
} else {
score1="F";
}
var dual = parseInt(avg/10);
switch(eval(dual)){
case 10:
case 9: score2="A";
break;
case 8: score2="B";
break;
case 7: score2="C";
break;
case 6: score2="D";
break;
default : score2="F";
}
document.write(score1+"학점 <br>");
document.write(score2+"학점 <br>");
</script>
</head>
<body>
</body>
</html>