JavaScript Syntax jobs

Source: Internet
Author: User

Blind Date process: Do you have a house? Do you have any money? Do you have the power?
"Get married," "Buy a house before you get married," "Make money before you buy a house and then get married."
Using if nesting as a blind date process

<script>
var a=prompt ("Do you have a house?");
if (a== "has") {
Alert ("Marriage");
else{
var b=prompt ("You have Money");
if (b== "has") {
Alert ("Buy a house before you get Married");
}
else{
var c=prompt ("Do you have the Power");
if (c== "has") {
Alert ("Make money before you buy a house and get married again");
}
else{
Alert ("Goodbye ~");
}
}
}
</script>

4. Standard Weight:
Men's weight = height -100±3
Lady weight = height -110±3
Enter gender, height, weight, and see if the weight is standard.

<script>
var a = prompt ("Please enter gender")
var B = Prompt ("Please enter height")
var c = prompt ("Please enter your weight")
x= "Male"
y= "Female"
D = b-103
E = b-97
f = b-113
g = b-103
if (a==x) {if (a>=e&&a<=d) alert ("Standard")}else{alert ("Nonstandard")}
if (a==y) {if (a>=b&&a<=f) alert ("Standard")}else{alert ("Nonstandard")}


</script>

Equation ax2+bx+c=0; two quadratic equation. Seeking root
=B2-4AC; If the <0 equation is not real roots
If >0, the equation has two different real roots X1 x2
If =0, the equation has two identical real roots
A number to open square--math.sqrt ()

<script>
var a=prompt ("Please enter a number not 0");
var b=prompt ("Please enter a number");
var c=prompt ("Please enter a number");
var y=b*b-4*a*c;
var x1= (-b-math.sqrt (y))/(2*A);
var x2= (-b+math.sqrt (y))/(2*A);
if (a==0) {
Alert ("The Wrong Loser");
}

else if (y==0)
{
Alert ("Equation has two identical real roots" +x1+ "," +x2 ");
}

else if (y<0)
{
Alert ("Equation without real roots");
}

else {
Alert ("The equation has two different real roots" +x1+ "," +x2 ");
}
</script>

JavaScript Syntax jobs

Related Article

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.