Statement:
var ch11 = prompt("Is Colombia (the South American country) with U or O?"); if (ch11 === "o" || ch11 === "O") { alert("You are right! Colombia is with "O", Columbia with "U" is the capital of SC" ); } else { alert("Sorry, try again later"); } }
Statement:
var gender = prompt("What is your gender?"); if (gender === "female" || gender === "Female" || gender === "FEMALE") { alert("Girly!");} else if (gender === "male" || gender === "Male" || gender === "MALE"){alert("Macho!!");} else { alert("Sorry, that is not an option, try again later"); }
Statement:
alert("Is 10 is equal to 10?"); var ch13question = 10; if (ch13question <= 10 || ch13question >= 12) { alert("Thats right! 10 is equal to 10");} else { alert("Sorry, try again later!");
Statement:
var ch14question = prompt("Are you male or female?"); if (ch14question === "male" || ch14question === "Male" || ch14question === "MALE"){ var age = prompt("Are you 21 or older?"); if (age === "yes" || age === "YES" || age === "Yes") { alert("You have to register in the Colombian army!"); } else { alert("You won't qualify to the Colombian army!"); } } else if (ch14question === "female" || ch14question === "Female" || ch14question === "FEMALE") { alert("You wont qualify to the Colombian army!"); } else { alert("Sorry, try again later!"); }
Statement:
var MyName = ["Juan", "Pablo", "Diaz", "Rodriguez"];
My middle name is...
alert(names[2]);
Statement:
var name = [" Juan", " Pablo", " Diaz", " Rodriguez"];
alert("Array:[ Juan, Pablo, Diaz, Rodriguez ] Replacing the first name to David and removing the second lastName");
name[0] = " David";
name.pop();
alert(name);
}
Statement:
var ch17question = [" Juan", " Diaz", " (704) 801-8920"];
alert("ch17question = [ " + ch17question + " ]");
prompt("Insert the name of the class (Web-115) into the array between my lastName and my phone number.");
if (ch17question() === "ch17question.splice(2, 0, "Web-115");")
{
alert("Good Job!!");
}
else {
alert("Sorry, try again later!");
}
}
Statement:
var ch18question = ""; var i; for (i = 0; i ‹ 5; i++) { ch18question += "The number is " + i + "\n"; } document.getElementById("loop").innerHTML = ch18question; }
Statement:
var PC = [" Hp", " Dell", " Toshiba", " Samsung", " Acer", " LG"];
var ch19question = ""; var i; for (i = 0; i ‹ PC.length; i++) { ch19question += PC[i]\n;}document.getElementById("loop19").innerHTML = ch19question; }
Statement:
var ch20question = [" J", " U", " A", " N"];
var ch20question1 = [" D", " I", " A", " Z"];
var options = [];
for (var i = 0; i ‹ ch20question.length; i++) {
for (var j = 0; j ‹ ch20question1.length; j++) {
options.push(ch20question [i] + ch20question1[j]); } }
document.getElementById("names").innerHTML = options += "";
}