老师帮我看一下

来源:1-8 编程练习

慕九州8424370

2019-01-11 17:50:17

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title>成绩判断</title>

</head>

<body>

    <script>

  //补充代码

  var score=prompt("输入学生成绩");

  if(score>=90 && score<=100){

      alert("优秀");

  }else if{score>=80 && score<=89){

      alert("良好");

  } 

  }else if(score>=70 && score<=79){

      alert("一般");

  }else if(score>=60 && score<=69){

      alert("及格");

  }else if(score<60&& score>=0){

      alert("不及格");

  }else if(score<0 || score>100){

      alert("您输入的成绩有误");

  }

</script>

</body>

</html>


写回答

1回答

好帮手慕糖

2019-01-11

同学你好,1、如下,if语句后面应该是"(",而不是花括号"{",且多了一个"}",例:

http://img.mukewang.com/climg/5c386bee0001f29607240234.jpg

2、如下,分号是在中文状态下输入的,应换为英文状态下的。

http://img.mukewang.com/climg/5c386c3e0001439306940183.jpg

希望能帮助到你,欢迎采纳。

祝学习愉快!

0

0 学习 · 36712 问题

查看课程