Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Dashboard / Courses / BLENDED 1923T.

B / BL-CS-301-LEC-1923T / Week 14: Final Exam / Finals

Started on Friday, 8 November 2019, 12:11 PM


State Finished
Completed on Friday, 8 November 2019, 12:58 PM
Time taken 47 mins 29 secs
Marks 42.00/50.00
Grade 84.00 out of 100.00

Question 1 This are statements that make decision.


Correct

Mark 1.00 out of Select one:


1.00
a. Functions

b. Loops

c. Variable

d. Conditional Statement 

Your answer is correct.

Question 2 If a = 5 and b = a++ + 10 * 3, what is the value of y?


Correct

Mark 1.00 out of Select one:


1.00
a. 35

b. 45

c. 36

d. None of the choices 

Your answer is correct.

Question 3 Which of the following indicates that a single line of commentary will follow it within JavaScript code?
Correct

Mark 1.00 out of Select one:


1.00
a. <!--

b. None of the choices

c. /*

d. // 
Question 4 It is a PHP function wherein the data will be transmitted to the server in the http header when the form is
Correct submitted for processing.
Mark 1.00 out of
1.00 Select one:
a. $_GET

b. None of the Choices

c. $_POST 

d. $_GET

Your answer is correct.

Question 5 Which of the following is a valid use of the window.alert() method?


Correct

Mark 1.00 out of Select one:


1.00
a. window.alert("This is text);

b. None of the choices 

c. win.alt("This is text");

d. window.alert('This is text");

Question 6 What property of the Array object will return the numeric value of the length of an array?
Correct

Mark 1.00 out of Select one:


1.00
a. None of the choices

b. The lengthOf property

c. The length property 

d. The getlength property

Question 7 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 8 Which of the following statements will return true?


Correct

Mark 1.00 out of Select one:


1.00
a. (3==3)&&(5<1)

b. !(17>=20) 

c. None of the choices

d. (1==1)&&(2<0)

Your answer is correct.


Question 9 Which of the following is not recommended feature in choosing a script editor?
Correct

Mark 1.00 out of Select one:


1.00
a. The Script Editor should have Syntax checking

b. The Script Editor should have Line numbering

c. The Script Editor should have Syntax checking

d. None of the Choices 

Your answer is correct.

Question 10 In naming a variable in PHP what is the required Special Character?


Correct

Mark 1.00 out of Select one:


1.00
a. & (Ampersand Sign)

b. @ (At Sign)

c. $ (Dollar Sign) 

d. None of the choices

Your answer is correct.

Question 11 Which of the following is the open and closing tags of PHP?
Correct

Mark 1.00 out of Select one:


1.00
a. <?php     ?> 

b. <?        /php>

c. <?php    /?>

d. None of the Choices

Your answer is correct.

Question 12 This are statements that performs repetitive tasks.


Correct

Mark 1.00 out of Select one:


1.00
a. Functions

b. Variable

c. Conditional Statement

d. Loops 

Your answer is correct.

Question 13 The external JavaScript file must contain the <script> tag.
Correct

Mark 1.00 out of Select one:


1.00
a. True

b. False 

Your answer is correct.


Question 14 Which of the following would correctly generate a random number between 0 and 7?
Correct

Mark 1.00 out of Select one:


1.00
a. var rand_int= Math.floor(Math.random());

b. var rand_int= Math.floor(Math.random()*7); 

c. None of the choices

d. var rand_int= Math.floor(Math.random()*8);

Your answer is correct.

Question 15 What is the result of the script below?


Correct <script>
Mark 1.00 out of var greeting;
1.00 var time = 10;
if (time < 10) {
greeting = "Good morning";
} else if (time < 20) {
greeting = "Good day";
} else {
greeting = "Good evening";
}
document.write(greeting);
</script>

Select one:
a. None of the choices

b. Good day 

c. Good morning

d. Good evening

Your answer is correct.

Question 16 In JavaScript, you access object properties through the use of the
Correct

Mark 1.00 out of Select one:


1.00
a. multiplication operator

b. None of the choices 

c. addition operator

d. You can't access the properties of an object

Question 17 Which of the following correctly codes an alert on the click event?
Incorrect

Mark 0.00 out of Select one:


1.00
a. <input type=“button” onChange=“window.alert(“Hey there!”);”> 

b. <input type=“button” onClick=“window.alert(‘Hey there!”);”>

c. <input type=“button” onclick=“window.alert(“Hey there!”);”>

d. None of the choices

Your answer is incorrect.


Question 18 It is a PHP function wherein it adds the input data as series of name value pairs in a query string at the end of the
Correct URL.
Mark 1.00 out of
1.00 Select one:
a. $_GET 

b. $_POST

c. None of the Choices

d. ISSET()

Your answer is correct.

Question 19 Which of the following successfully prints a variable named name by adding it to a set of strings?
Correct

Mark 1.00 out of Select one:


1.00
a. document.write("Hello" + "name" + "!");

b. document.write("Hello name!");

c. document.write("Hello " + name!);

d. None of the choices 

Question 20 The mousedown event uses what keyword as its event handler?
Incorrect

Mark 0.00 out of Select one:


1.00
a. onmousedown

b. mousedown 

c. None of the choices

d. onmouseout

Question 21 In the process of PHP which what is the missing step?


Correct

Mark 1.00 out of 1st: The client browser sends a request to the Web Server
1.00
2nd: The Webserver will simply respond to the client if the page consist of HTML, CSS, Images and Javascript.
However, if the there is a PHP in the webpage, it will proceed to the 3rd step.
3rd: x x x x
4th: If there is a database involve the PHP engine will send the file to the database for processing.
5th: After the database have processed the file it will then return it to the PHP engine and the PHP Engine will
return it to the web server. The web server is the one responsible for sending it back to the client browser.

Select one:
a. The Webserver will then interpret the PHP Webpage and send it back to the Database.

b. The Webserver will then interpret the PHP Webpage and send it back to the Database.

c. None of the choices

d. The Webserver will send the PHP webpage to the PHP Engine for processing. 

Your answer is correct.


Question 22 Which of the following is not the file to access if you want to change your server's time?
Correct

Mark 1.00 out of Select one:


1.00
a. index.php 

b. .htaccess

c. user.ini

d. php.ini

Your answer is correct.

Question 23 Which of the following correctly assigns the day of the week for an instance of the Date object named rightnow
Correct to a variable named weekday?
Mark 1.00 out of
1.00 Select one:
a. None of the above 

b. var rightnow= weekday.getDay();

c. var weekday= right now.getDay();

d. var weekday= rightnow.getDate();

Question 24 Each object in JavaScript has properties associated with it.


Correct

Mark 1.00 out of Select one:


1.00
a. False

b. True 

Question 25 What do the properties and methods of the Math object enable you to do?
Correct

Mark 1.00 out of Select one:


1.00
a. Perform mathematical calculations 

b. Take the square roots and other such values of strings and return a number

c. Go to math class to learn new theorems

d. None of the choices

Question 26 The choice of a Web browser is up to you, as long it's compatible with _________.
Correct

Mark 1.00 out of Select one:


1.00
a. VBScript

b. None of the choices

c. JavaScript 

d. Flash MX

Question 27 Which of the following successfully prints a variable named myhobby by adding it to a set of strings?
Correct

Mark 1.00 out of Select one:


1.00
a. None of the choices

b. document.write("I like to " +myhobby+ " every weekend"); 

c. document.write("I like to +myhobby+ every weekend");

d. document.write("I like to myhobby every weekend");


Question 28 This are statement that performs preset of tasks.
Correct

Mark 1.00 out of Select one:


1.00
a. Loops

b. Functions 

c. Conditional Statement

d. Variable

Your answer is correct.

Question 29 A mouseover event occurs when:


Incorrect

Mark 0.00 out of Select one:


1.00
a. The viewer clicks a link, linked image, or linked area of an image map. 

b. The viewer clicks the mouse while the cursor is over a button.

c. None of the choices

d. The viewer moves the mouse cursor over an element on the page.

Question 30 What is the result of the script below? 


Incorrect
<script>
Mark 0.00 out of var x = 0;
1.00
var e = "gsbatingggl.x";
var domain = "";
for(var ctr = 0; ctr < e.length; ctr++)
{
if(e[ctr] == "@")
{
domain = e.substring(ctr);
if((domain == "@yahoo.com.ph") ||
(domain == "@yahoo.com") ||
(domain == "@edu.gov"))
{
x++1;
}
}
}
document.write(x);
</script>

Select one:
a. None of the choices

b. 12

c. 1 

d. 0

Your answer is incorrect.


Question 31 What are two reasons why a function can be useful?
Correct

Mark 1.00 out of Select one:


1.00
a. They make simple scripts more complex, and they make it harder for noncoders to read the script.

b. None of the choices

c. 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. 

d. They make simple scripts more complex, and they can be reused.

Question 32 When would it be a good idea to use an external JavaScript file?


Incorrect

Mark 0.00 out of Select one:


1.00
a. When your Web site viewers have older browsers

b. When the script is very long or needs to be placed in more than one HTML document

c. When the script is short or going to be used in only one HTML document 

d. None of the choices

Question 33 It is a function that display the content of the array.


Correct

Mark 1.00 out of Select one:


1.00
a. $Flowers = array();

b. None of the Choices

c. print_r($Flowers); 

d. $Flowers = [];

Your answer is correct.

Question 34 This is the command to display the value stored in the variable.
Correct

Mark 1.00 out of Select one:


1.00
a. cout>>

b. Echo 

c. Display

d. None of the choices

Your answer is correct.

Question 35 Which of the following will correctly access the fifth element of an array named "age"?
Correct

Mark 1.00 out of Select one:


1.00
a. None of the choices

b. age[5];

c. age[4]; 

d. age(5);
Question 36 JavaScript is a _________ language that doesn't require a program to be compiled before it is run.
Correct

Mark 1.00 out of Select one:


1.00
programming

server-side

scripting 

None of the choices

Your answer is correct.

Question 37 Function names are case sensitive.


Correct

Mark 1.00 out of Select one:


1.00
a. False

b. True 

Question 38 What symbol is used as the assignment operator in JavaScript?


Correct

Mark 1.00 out of Select one:


1.00
a. +

b. :

c. None of the choices 

Question 39 Is JavaScript code case sensitive?


Correct

Mark 1.00 out of Select one:


1.00
a. No 

b. Yes

Question 40 Which of the following language is used to program the behavior of web pages?
Correct

Mark 1.00 out of Select one:


1.00
a. Java

b. HTML

c. None of the choices 

d. CSS

Question 41 Which of the following does not belong to the group?


Correct

Mark 1.00 out of Select one:


1.00
a. \\AMA-PC1\user 

b. www

c. public_html

d. htdocs

Your answer is correct.


Question 42 Which of the following is not a JavaScript operator?
Correct

Mark 1.00 out of Select one:


1.00
a. &&

b. None of the choices 

c. =

d. ==

Your answer is correct.

Question 43 What is the output of the script below?   <script> var text1 = "Hello"; var text2 = "World!";
Incorrect document.write(text1.concat(" ",text2));
Mark 0.00 out of
1.00 Select one:
a. World

b. Hello" "World

c. None of the choices

d. Hello World 

Your answer is incorrect.

Question 44 To declare a function, you use the reserved word ________.


Incorrect

Mark 0.00 out of Select one:


1.00
a. function

b. var

c. None of the choices 

d. for

Question 45 Which of the following correctly calls myFunction() whenever a user clicks a button?
Incorrect

Mark 0.00 out of Select one:


1.00
a. <input type = "button" value = "Submit" onClick="checkForm(this.form)"> 

b. <button> myFunction () </button>

c. None of the choices

d. <submit> onclicked=myFunction () </submit>

Your answer is incorrect.


Question 46 Which of the following would correctly write the value of pi on a Web page?
Correct

Mark 1.00 out of Select one:


1.00
a. document.write(Math.Pi);

b. document.write(Math.PI); 

c. document.write(Math.pi);

d. None of the choices

Question 47 The script tag's attribute that tells the browser the language of the script.
Correct

Mark 1.00 out of Select one:


1.00
a. type 

b. id

c. None of the choices

d. src

Question 48 Which of the following variable declarations uses a variable with a valid variable name in JavaScript?
Correct

Mark 1.00 out of Select one:


1.00
a. var default;

b. var my dog;

c. var 2cats;

d. None of the choices 

Question 49 Which of the following statements would be valid in JavaScript?


Correct

Mark 1.00 out of Select one:


1.00
a. document.write('John said, "Hi!"");

b. None of the choices

c. document.write("John said, \"Hi!\""); 

d. document.write("John said, "Hi!"");

Question 50 Refers to an array of all objects of a particular type.


Correct

Mark 1.00 out of Select one:


1.00
a. None of the choices

b. object collection 

c. object properties

d. object method

◄ Quiz 006 Jump to...

You might also like