practiceproblemsSOLN

practiceproblemsSOLN - Practice Problems for JavaScript...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Practice Problems for JavaScript Multiple Choice Questions 1. _______________ are used to group several statements into a compound statement. A. () B. { } C. <> D. /* */ 2. In JavaScript the for statement is used for A. Assignment B. Increment C. Iteration D. Selection 3. The command to display an alert box in JavaScrpit is [I am sorry, I missed semicolons after all these sentences] A. write.alert B. display.alert C. alert( ) D. alert = “text” 4. In JavaScript, a line beginning with // is a(n) A. assignment B. comparison C. comment D. function 5. Which of the following are correct JavaScript variable declarations? [Here, if Sam was a variable declared already, then C could be a right option too. Such ambiguity will not be present in the test] A. var d = a ( b*c ); B. var time = ((( days * 24) + hours) * 60 + minutes) * 60 sec; C. var name = Sam; D. var bool = “true”; 6. Which of the following can be used as part of a variable name A. Hyphen - B. Blank space C. Underscore _ D. Parentheses ( ) Writing Code Segment. Do not worry about other tags like <html>, <body> and so on. Start and end with the <Script> tag. 1. Assume that you are creating a new array called seasons A. Write the statement to declare the array with space allotted for four elements.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/29/2008 for the course COMP APPS 170 taught by Professor Gayatreeganu during the Fall '08 term at Rutgers.

Page1 / 4

practiceproblemsSOLN - Practice Problems for JavaScript...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online