宇与鱼
发表于 2019-8-29 10:39:13
mua
jaqx
发表于 2019-8-29 22:16:11
刚刚回家
sam1
发表于 2019-8-29 23:02:43
wkfisjoasfa
啊刁呀
发表于 2019-11-23 11:22:20
学习
掵ф伫錠
发表于 2019-12-8 14:53:31
var youmoney;
var money = Number(prompt("请输入奖金", ));
if (isNaN(money)) {
alert("输入数字");
}
money = money / 10000
if (money <= 10) {
youmoney = money * 0.1;
} else if (money <= 20) {
youmoney = (10 * 0.1) + (money - 10) * 0.75;
} else if (money <= 40) {
youmoney = (10 * 0.1) + (10 * 0.75) + (money - 20) * 0.05;
} else if (money <= 60) {
youmoney = (10 * 0.1) + (10 * 0.75) + (20 * 0.05) + (money - 40) * 0.03;
} else if (money <= 100) {
youmoney = (10 * 0.1) + (10 * 0.75) + (20 * 0.05) + (20 * 0.03) + (money - 60) * 0.015;
} else if (money > 100) {
youmoney = (10 * 0.1) + (10 * 0.75) + (20 * 0.05) + (20 * 0.03) + (40 * 0.015) + (money - 100) * 0.01;
}
console.log(youmoney*10000);
水中望月
发表于 2019-12-9 16:22:23
.
sensems
发表于 2020-1-8 17:10:02
let calculationBonus = function(profit,bonus) {
bonus = bonus || 0;
if(profit <= 100000) {
bonus = parseFloat(profit * 0.1);
}else if (profit > 100000 && profit <= 200000) {
bonus = (profit - 100000) * 0.075 + calculationBonus(100000);
}else if(profit > 200000 && profit<= 400000) {
bonus = (profit - 200000) * 0.05 + calculationBonus(200000);
}else if (profit > 400000 && profit<= 600000) {
bonus = (profit - 400000) * 0.03 + calculationBonus(400000);
}else if (profit > 600000 && profit<= 1000000) {
bonus = (profit - 600000) * 0.015 + calculationBonus(600000);
}else {
bonus = (profit - 1000000) * 0.01 + calculationBonus(1000000);
}
return bonus;
}
let bonus = calculationBonus(450000)
hjg
发表于 2020-2-1 08:06:51
学习一下
hjg
发表于 2020-2-1 08:07:25
学习使我快乐
爱我什么呀
发表于 2020-2-12 22:05:49
。。
beatss
发表于 2020-3-5 08:26:31
来看看
落寞少年
发表于 2020-10-26 20:47:19
function count(){
var mm = document.getElementsByTagName("input").value;
var money=0;
if(mm<=100000)money=mm*1.1;
if(mm>100000&&mm<200000)money=(200000-mm)*1.075+110000;
if(mm>=200000&&mm<400000)money=(mm-200000)*1.05+117500;
if(mm>=400000&&mm<600000)money=(mm-400000)*1.03+227500;
if(mm>=600000&&mm<1000000)money=(mm-600000)*1.015+233500;
if(mm>=1000000)money=(mm-1000000)*1.01+239500;
alert(money);
}
var button = document.getElementsByTagName("button");
button.onclick =count;
地狱泰隆
发表于 2020-12-29 20:34:26
1
ainz42
发表于 2021-3-21 10:46:26
学习下
TI8的maybe本人
发表于 2022-1-27 09:03:49
每日第三练
jack6666
发表于 2022-10-11 22:12:40
1