Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1.
go fast
2.
3.6
3.
4.
12
5.
var myValue; var yourValue; myValue = 5; yourValue = 3; document.write(myValue - yourValue); myValue = myValue + yourValue;
2
What will the value of myValue be after this code runs?
6.
7.
8.
var day_of_the_week; var wakeUp; day_of_the_week = "Monday"; if (day_of_the_week == "Sunday") wakeUp = "8:00"; else if (day_of_the_week == "Saturday") wakeUp = "11:00"; else wakeUp = "6:15";
6:15
What is the value of day_of_the_week after this code executes?
Monday
What will this code print on the screen?
nothing
9.
var my_num; my_num = 5; if (my_num < 10) document.write("ten "); if (my_num < 8) document.write("eight "); if (my_num < 6) document.write("six "); if (my_num < 4) document.write("four ");
10.
var by_num; by_num = 5; if (by_num < 10) document.write("ten "); if (by_num < 4) document.write("four "); else document.write("again ");
ten again
11.
3
What is the value of i after this code executes?
12.
4
What is the value of j after this code executes?
13.
var count; count = 1; while (count <= 5){ count = count + 1; document.write(count); }
23456
14.
var ktoon; ktoon = 0; while (ktoon > 5){ document.write("$"); ktoon = ktoon + 1; } var times; times = 2; while (times < 5){ document.write(times); times = times - 1; }
15.
Infinite loop will print numbers starting at 2, decreasing to negative infinity without stopping.
16.
var outer; var inner; inner = 1; while (inner <= 5){ outer = 1; while (outer <= 3) { document.write("*"); outer = outer + 1; } inner = inner + 1; }
15