第5次作业-查询水果的价格
这个作业属于哪个课程 | https://edu.cnblogs.com/campus/sdscfz/SF3 |
---|---|
这个作业要求在哪里 | (https://edu.cnblogs.com/campus/sdscfz/SF3/homework/12953) |
这个作业的目标 | 第5次作业-查询水果的价格 |
代码
<html>
<head>
<title>多条件选择</title>
<meta charset="utf-8">
<body>
<script src="./02.js"></script>
</body>
</head>
</html>
var week = prompt("请您输入查询的水果") ;
switch(week){
case" 香蕉":
document.write('香蕉的价格为6.34/斤');
break
case "榴莲":
document.write('榴莲的价格为40/斤');
break
case "沃柑":
document.write('沃柑的价格为4.5/斤');
break
case "草莓":
document.write('草莓的价格为7/斤');
break
case "西瓜":
document.write('西瓜的价格为4/斤');
break
case "菠萝":
document.write('菠萝的价格为8/斤');
break
case "芒果":
document.write('芒果的价格为6.5/斤');
break
default:
document.write("输入错误!");
}