JavaScript: Quiz Part 1


1. Java is an abbreviation for JavaScript, i.e. they are the same language.
   


2. What company created/first released Netscape?
  Microsoft
  Netscape
  Oracle
  Google


3. Which of the following is a JavaScript command to output content to a web page?
  output.send
  out
  print
  document.write


4. Which of the following is another JavaScript command used to output content to a web page?
  send
  display
  alert
  log


5. What characters are in used in JavaScript if statements to surround a block of code?
  ( )
  < >
  { }
  <? ?>


6. What will be the output whent his program runs?


	<script>
		var x = 10; 
		var y = 22; 
		if (x >= 10 || y > 30) {
			document.write("<p>Michigan.</p>");
		} else if (x == 10 && y > 22) {
			document.write("<p>Ohio.</p>");
		} else if (x > 10 || y > 22) {
			document.write("<p>New York.</p>");
		} else if (x >= 10 || y == 2) {
			document.write("<p>Kansas.</p>");
		} else {
			document.write("<p>Florida.</p>");
		}
	</script>
	
  Michigan.
  Ohio.
  New York.
  Kansas.
  Florida.


7. What will be the output whent his program runs?


	<script>
	var y = 10;
	for (x=1; x < 7; x++) { 
		y++;	
		}
	document.write(y);
	</script>
	
  7
  10
  16
  17


8. What will be the output whent his program runs?


	<script>
	var y = 10;
	for (x=1; x < 7; x+=2) { 
		y++;	
		}
	document.write(x);
	</script>
	
  7
  10
  16
  17