1-4 编程练习作业提交
来源:1-4 编程练习
MiMicccc
2020-09-22 22:02:04
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>收银系统</title>
</head>
<body>
<script>
//补充代码
var price = prompt("请输入商品的价格");
var num = prompt("请输入商品的数量");
var total = price * num;
if (total >= 500) {
total *= 0.8;
alert("请您支付" + total + "元");
} else {
alert("请您支付" + total + "元");
}
</script>
</body>
</html>1回答
同学你好,代码实现是正确的,继续加油,祝学习愉快~
相似问题