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