成绩练习
1 <script> 2 var name = prompt("请输入学生姓名:"); 3 var degree = parseInt(prompt("请输入学生成绩:")); 4 5 if(degree == 100) { 6 7 alert("恭喜你:" + name + "," + "满分通过" + "。"); 8 9 10 11 12 } else if(degree >= 80 && degree < 100) { 13 14 alert(name + "," + "你很优秀,继续保持!"); 15 16 17 18 19 } else if(degree >= 60 && degree < 80) { 20 21 alert(name + "成绩良好!"); 22 23 24 25 26 } else if(degree >= 50 && degree < 60) { 27 28 alert(name + "就差一点点,下次一定要至少及格!"); 29 30 31 32 33 } else { 34 35 alert(name + "你是笨蛋么?"); 36 } 37 </script>