0511JS Basic Exercise

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.