1, the height of the blue ball bounce 100 meters The height of the first few times is less than 1 meters, each bounce is the last 0.6
var gaodu = 100;
var Cishu = 0;
while (Gaodu >= 1) {
Gaodu *= 0.6;
cishu++
}
alert (Cishu);
2. Standard Weight:
Men's weight-height +100=±3
Women's weight-height +110=±3
var JG = tz-sg+100
The user enters the height, then enters the weight to judge is not the standard weight
while (Xingbie! = "Male" && xingbie! = "female") {
Xingbie = Prompt ("Please enter the correct gender");
}
var height = prompt ("Please enter height () cm");
var width =prompt ("Please enter weight () kg");
if (Xingbie = = "Male") {
var cha = width-height +100;
if (Cha >=-3 && cha <= 3) {
Alert ("Standard weight");
}else
Alert ("Not a standard weight");
}else{
var cha = width-height +110;
if (Cha >=-3 && cha <= 3) {
Alert ("Standard weight");
}else
Alert ("Not a standard weight");
}
0511JS Basic Exercise