Professional Documents
Culture Documents
Finals - Attempt Review3 PDF
Finals - Attempt Review3 PDF
Finals - Attempt Review3 PDF
Question 1 Which of the following would correctly generate a random number between 0 and 7?
Correct
c. window.alert('This is text");
d. window.alert("This is text);
c. function get_text ()
d. function my function ()
b. Hello World
c. Hello" "World
Question 6 An event handler is a predefined JavaScript property of an object that is used to handle an event on a Web page.
Correct
b. True
b. 2ndarray
d. my array
Question 8 Which of the following is the open and closing tags of PHP?
Correct
b. <?php ?>
d. <? /php>
Select one:
a. Isabela,Georgina,Maria
b. Maria,Isabela,Georgina,Maria
c. Maria,Isabela,Georgina
b. $ (Dollar Sign)
c. @ (At Sign)
Question 11 Which of the following correctly codes an alert on the click event?
Incorrect
b. name
c. method
d. document
b. Object based
c. server-side language
d. object deficient
b. $_GET
c. $_POST
d. $_GET
b. True
b. False
c. 4<=3
d. 3==3
b. False
b. They provide a way to organize the various parts of the script into the different tasks that must be
accomplished, and they can be reused.
c. They make simple scripts more complex, and they can be reused.
b. 36
d. 45
Question 24 Active scripting is not a programing language instead it is a plain text interpreted to make a dynamic and
Correct interactive web pages.
Mark 1.00 out of
1.00 Select one:
a. True
b. False
Question 25 Which of the following correctly calls myFunction() whenever a user clicks a button?
Correct
b. Yes
Question 28 What do the properties and methods of the Math object enable you to do?
Correct
b. Take the square roots and other such values of strings and return a number
b. period
b. document.form.elements
c. document.plugins
d. document.frames
Question 32 Which of the following comparisons will return true?
Correct
b. 4==3
d. 4!=3
Question 33 Rather than executing every single line of code within the script, a conditional statement allows certain sections
Correct of the script to be executed only when a particular condition is met.
Mark 1.00 out of
1.00 Select one:
a. False
b. True
Question 34 Why should you use the type attribute in the opening script tag?
Correct
b. % %
c. #
d. /* */
b. They can save you time in writing and updating your scripts, and they make it harder for noncoders to
understand the script.
d. They can save you time in writing and updating your scripts, and they can make the purpose of your code
clearer.
Question 37 Which of these would be valid as the first line of a for loop?
Correct
b. for (x==1;x<6;x+=1)
c. for (x+=1;x<6;x=1)
b. Curly brackets - {}
d. Nothing
Question 39 Which of the following would be valid as the first line of an if/else statement?
Correct
b. if (x=2)
c. if (y ! 7)
b. inside a script
Question 41 You should avoid using JavaScript reserved words as variable names.
Incorrect
b. False
Question 42 If str = "Jose, Enrique, Vicente" and res = str.slice(15,22), what will be the resulting value of res?
Correct
b. ,Vicent
d. Enrique
Question 43 The getMonth() method returns the same number as the number that represents the current month (for
Correct example, returns 1 if the current month is January).
Mark 1.00 out of
1.00 Select one:
a. True
b. False
Question 45 Which of the following variable declarations uses a variable with a valid variable name in JavaScript?
Correct
b. var default;
c. var my dog;
Question 46 To write a string of text on a Web page, the _________ method is used.
Correct
b. document,type()
d. document.print()
Question 47 Which of the following declares a variable named pagenumber and gives it a value of 240?
Correct
c. var PageNumber=240;
d. pagenumber=220;
Question 48 Which of the following will correctly access the fifth element of an array named "age"?
Correct
b. age(5);
c. age[4];
Question 49 Which of the following correctly assigns the result of a function named get_something () to a variable named
Correct shopping?
Mark 1.00 out of
1.00 Select one:
a. var shopping=“get_something”;
d. var Shopping=get_Something;
b. True