js 收银元小程序

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>js考试</title>
</head>
<script type="text/javascript">
// 1.编写一个程序,计算增加后的工资。要求基本工资大于等于1000元,增加20%的工资;若小于1000元且大于等于800元,则增加15%,若小于800元,则增加10%工资。
var pay = 1000;
if (pay >= 1000){
pay += (pay * 0.2);
}
else if (pay < 1000 && pay >= 800){
pay += (pay * 0.15);
}
else if (pay < 800){
pay += (pay * 0.1);
}
document.write("最后工资为"+pay+"</br>");

 

</script>
<body>

<div onmouseover="mOver(this)" onmouseout="mOut(this)" style="height: 50px; width: 200px; background-color: #ADD8E6; color: red" ></div>

</body>
</html>

posted @ 2017-08-21 22:44  生命不止追求不断  阅读(182)  评论(0编辑  收藏  举报