Thursday, January 16, 2014

Blog 34

Blog 34
Which statement correctly uses the newline character to show the numbers 1 and 2 on separate lines?


alert(1 \n2)

alert(1\n2)

alert(1+\n+2)

alert('1\n2')

Sunday, January 12, 2014

Blog 33

Blog 33

If the code
name = prompt ('What is your name?')
is used, which code checks to see the user did not click cancel?

if (name == null)

if (name == ' ')

if (name != null)

if (name != ' ' )

Monday, January 6, 2014

Blog 31

Blog 31

Study the code editor an work out the values of the variables after the code runs. Enter the values for a and b.

var a = 5;
whle (a<3) {
a= a +1;
}

var b = 10;
whle (b< = 5) {
b = b +1;
}


a=

b =

Blog 32

Blog 32

Code is written to move a robot. Describe what this code does.

var n = 0
while (n<6)
{robot.forward();
n= n+1;
}



Blog 30

Blog 30

Study the code and  work out the values of teh variables after it runs. Enter values for a and b.

var a = -100;
while (a<- 5) {
a = a + 2;
}

var b = 20;
while (b> - 5) {
b = b +10;
{


a =

b =

Tuesday, December 17, 2013

blog 29

Blog 29

Work out the values of the variables after each loop runs.

var a = 5;
while (a< 3) {
       a = a - 1;
}



var b = 10
while (b < = 5) {
      b = b - 1;
}

Saturday, December 14, 2013

blog 28

Blog 28

Which is an invalid variable name?

variable        var     visible      value


Which is an invalid variable name?


if         and         a      then


Which is an invalid variable name?

yes      correct    on    true