第5次作业-查询水果的价格

发布时间 2023-03-28 22:01:30作者: 孙友训

第五次作业

这个作业属于哪个课程 https://edu.cnblogs.com/campus/sdscfz/SF4
这个作业要求在哪里 https://edu.cnblogs.com/campus/sdscfz/SF4/homework/12952
这个作业的目标 第五次作业
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=1, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        
var fruit = prompt("请你输入查询的水果:")

switch(fruit){
    case '苹果':document.write("苹果的价格是3元/一斤")
    bresk;
    case '水蜜桃':document.write("水蜜桃的价格是5元/一斤")
    bresk;
    case '香蕉':document.write("香蕉的价格是4元/一斤")
    bresk;
    case '西瓜':document.write("西瓜的价格是1元/一斤")
    bresk;
    default:
    document.write("输入数据不合法")
}
    </script>
</body>
</html>