Finals - Attempt Review2 PDF

You might also like

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 Wednesday, 13 November 2019, 2:00 PM


State Finished
Completed on Wednesday, 13 November 2019, 2:17 PM
Time taken 17 mins 20 secs
Marks 22.00/50.00
Grade 44.00 out of 100.00

Question 1 Which of the following would be a valid function name in JavaScript?


Incorrect

Mark 0.00 out of Select one:


1.00
a. function if ()

b. function get_text ()

c. function my function ()

d. None of the choices 

Question 2 What is the result of the script below?


Correct <script>
Mark 1.00 out of var n = ["Maria", "Isabella", "Georgina"];
1.00 var new_n = n.pop();
document.write(new_n);
</script>

Select one:
a. Georgina 

b. None of the choices

c. Maria

d. Isabella

Your answer is correct.

Question 3 Which of the following correctly points to an external JavaScript file named yourfile.js? 
Correct

Mark 1.00 out of Select one:


1.00
a. <script type= "text/javascript" src="yourfile.js"></script> 

b. None of the choices

c. <script type="text/javascript" link="yourfile.js"></script>

d. <script language="yourfile.js"></script>

Your answer is correct.


Question 4 An external JavaScript file commonly uses a filename extension of _______.
Correct

Mark 1.00 out of Select one:


1.00
a. None of the choices

b. .jav

c. .html

d. .js 

Question 5 How do you write "Hello World" in an alert box?


Correct

Mark 1.00 out of Select one:


1.00
a. None of the choices

b. msgBox(“Hello World”)

c. alert(“Hello World”) 

d. msg(“Hello World”)

Your answer is correct.

Question 6 What is the result of the script when the user input a small letter ‘a’?
Incorrect <head>
Mark 0.00 out of <script>
1.00 function myFunction() {
var x = document.getElementById("fname");
x.value = x.value.toUpperCase();
}
</script>
</head>
<body>
Enter your name: <input type="text" id="fname" onchange="myFunction()">
</body>
</html>

Select one:
a. None of the choices 

b. c

c. 65

d. A

Your answer is incorrect.

Question 7 What are two of the benefits of using variables?


Correct

Mark 1.00 out of Select one:


1.00
a. None of the choices

b. They can save you time in writing and updating your scripts, and they make it harder for noncoders to
understand the script.

c. They make the purpose of your code clearer, 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 8 It is a function in the PHP that get the date of the server.
Correct

Mark 1.00 out of Select one:


1.00
a. strtoupper()

b. None of the Choices

c. array()

d. date() 

Your answer is correct.

Question 9 It is a function in the PHP that converts the string into Upper case.
Correct

Mark 1.00 out of Select one:


1.00
a. date()

b. strtoupper() 

c. None of the Choices

d. array()

Your answer is correct.

Question 10 Is use to change the color of the web page to blue.


Correct

Mark 1.00 out of Select one:


1.00
a. document.write(color.blue)

b. None of the above

c. document.fgcolor = blue

d. window.bgcolor = blue 

Question 11 It holds multiple values.


Correct

Mark 1.00 out of Select one:


1.00
a. Arrays 

b. Functions

c. Loops

d. Variable

Your answer is correct.

Question 12 It acts as the placeholder for unknown or changing values.


Correct

Mark 1.00 out of Select one:


1.00
a. Loops

b. Functions

c. Arrays

d. Variable 

Your answer is correct.


Question 13 An event handler is a predefined JavaScript property of an object that is used to handle an event on a Web page.
Incorrect

Mark 0.00 out of Select one:


1.00
a. True

b. False 

Question 14 All object collections are supported by all browsers or browser versions.
Correct

Mark 1.00 out of Select one:


1.00
a. False 

b. True

Question 15 Which of the following does not correctly create an array?


Incorrect

Mark 0.00 out of Select one:


1.00
a. var myarray= new Array(5);

b. None of the choices 

c. var myarray= new Array(“hello”,”hi”,”greetings”);

d. var if= new Array[10];

Question 16 JavaScript is a language that must be compiled while Java is a language that must be interpreted.
Correct

Mark 1.00 out of Select one:


1.00
a. False 

b. True

Question 17 How many times can you nest a code block within another?
Incorrect

Mark 0.00 out of Select one:


1.00
a. Once

b. None of the above

c. None 

d. As many times as you like (though enough nesting could run the browser out of memory)

Question 18 What does an assignment operator do?


Incorrect

Mark 0.00 out of Select one:


1.00
a. Gives a variable a new name

b. None of the choices 

c. Performs a comparison

d. Assigns a new value to a variable

Question 19 Which of the following declares a variable named pagenumber and gives it a value of 240?
Incorrect

Mark 0.00 out of Select one:


1.00
a. var pagenumber=240;

b. None of the choices

c. pagenumber=220; 

d. var PageNumber=240;
Question 20 Variable names are not case sensitive.
Incorrect

Mark 0.00 out of Select one:


1.00
a. False 

b. True

Question 21 It is a function in the PHP that check whether the variable has been set.
Correct

Mark 1.00 out of Select one:


1.00
a. strtoupper()

b. isset() 

c. date()

d. None of the Choices

Your answer is correct.

Question 22 Which of the following is not a JavaScript object?


Correct

Mark 1.00 out of Select one:


1.00
a. frame

b. None of the choices 

c. window

d. link

Question 23 Where should we write the event handler?


Incorrect

Mark 0.00 out of Select one:


1.00
a. inside a function definition 

b. inside a script

c. None of the choices

d. inside an html tag

Question 24 It is the command used to incorporate an external page into your html.
Correct

Mark 1.00 out of Select one:


1.00
a. None of the Choices

b. get

c. include 

d. post

Your answer is correct.


Question 25 Which of the following string declarations is invalid?
Incorrect

Mark 0.00 out of Select one:


1.00
a. var mytext=‘Here is some text!’;

b. None of the choices

c. var mytext= “Here is \n some text!”;

d. var mytext=“Here is some text!”; 

Question 26 Which of the following correctly calls a function named major_alert() inside the onfocus event handler?
Incorrect

Mark 0.00 out of Select one:


1.00
a. None of the choices

b. <input type=“text” onFocus=‘major_alert()”>

c. <input type=“text” onfocus=“major_alert();’>

d. <input type=“text” onfocus=“major_alert();”> 

Your answer is incorrect.

Question 27 In a regular array, access to an element is usually through the use of a(n) __________.
Correct

Mark 1.00 out of Select one:


1.00
a. random number

b. None of the choices

c. string

d. index number 

Question 28 Which of these would be valid as the first line of a for loop?
Incorrect

Mark 0.00 out of Select one:


1.00
a. for (x=1;x<6;x+=1)

b. for (x+=1;x<6;x=1)

c. for (x==1;x<6;x+=1) 

d. None of the choices

Your answer is incorrect.

Question 29 Which of the following is something you should have to use the JavaScript?
Incorrect

Mark 0.00 out of Select one:


1.00
a. Web browser

b. C++ compiler

c. None of the choices 

d. 50GB hard drive


Question 30 A mouseout event occurs when a viewer clicks an element on the page.
Correct

Mark 1.00 out of Select one:


1.00
a. True

b. False 

Question 31 Which of the following correctly calls a function named some_alert () and sends it two string values as
Incorrect parameters?
Mark 0.00 out of
1.00 Select one:
a. some_alert("some","words);

b. None of the choices 

c. some_alert ();

d. some_alert("some","words");

Question 32 What is the original name of JavaScript?


Incorrect

Mark 0.00 out of Select one:


1.00
a. Java

b. Mocha

c. LiveScript

d. None of the choices 

Question 33 Who developed the JavaScript?


Incorrect

Mark 0.00 out of Select one:


1.00
a. Tim Berners-Lee

b. Dennis Ritchie 

c. Bill Gates

d. None of the choices

Question 34 How will you end a statement in PHP?


Correct

Mark 1.00 out of Select one:


1.00
a. None of the choices

b. by putting a dot (.)

c. by putting a semicolon (;) 

d. by putting a curly braces (})

Your answer is correct.

Question 35 What does a comparison operator do?


Correct

Mark 1.00 out of Select one:


1.00
a. None of the choices

b. Deals with bits and is not important right now

c. Compares two values or statements, and returns a value of true or false 

d. Performs a mathematical calculation


Question 36 Is an object collection for all internal frames in the document.
Incorrect

Mark 0.00 out of Select one:


1.00
a. document.plugins 

b. document.frames

c. None of the choices

d. document.form.elements

Question 37 JavaScript has similarities to other programming and scripting languages.


Incorrect

Mark 0.00 out of Select one:


1.00
a. False 

b. True

Question 38 It is a server side scripting language that is designed to be embedded because it is mixed in the HTML Markup.
Incorrect This Language can process and email contact forms, upload & file from online forms, generate thumbnails for
Mark 0.00 out of large images, watermark images, read and write files and communicate with a database.
1.00

Select one:
a. PHP

b. None of the choices 

c. JAVA

d. CSS

Your answer is incorrect.

Question 39 What does the following code do?


Incorrect var s_list= new Array()
Mark 0.00 out of
1.00 Select one:
a. Creates an array named s_list with the default number of elements, 10

b. Creates an empty array named list 

c. Creates an array that can never have any elements added to it

d. None of the choices

Question 40 Which of the following would be valid as the first line of an if/else statement?
Incorrect

Mark 0.00 out of Select one:


1.00
a. if (x=2) 

b. None of the choices

c. if (x==2) && (y > x)

d. if (y ! 7)

Your answer is incorrect.


Question 41 Which of the following is a Free PHP Editor?
Incorrect

Mark 0.00 out of Select one:


1.00
a. Komodo Edit

b. PhpED

c. Dreamweaver 

d. Zend Studio

Your answer is incorrect.

Question 42 What do you use to enclose the blocks of code in conditionals and loops?
Incorrect

Mark 0.00 out of Select one:


1.00
a. None of the choices 

b. Parentheses

c. Square brackets

d. Curly brackets

Question 43 It is named value pairs that are stored in the browser and they're sent to the web server with each page request.
Correct

Mark 1.00 out of Select one:


1.00
a. Session

b. None of the Choices

c. Cookies 

d. Functions

Your answer is correct.

Question 44 Which of the following is a valid name for an array?


Incorrect

Mark 0.00 out of Select one:


1.00
a. None of the choices

b. 2ndarray

c. my array 

d. soap

Question 45 Part of the web browser that understands HTML and CSS.
Incorrect

Mark 0.00 out of Select one:


1.00
a. Rendering Engine

b. JavaScript Interpreter 

c. JavaScript Compiler

d. None of the choices


Question 46 Which of the following statements will return false?
Incorrect

Mark 0.00 out of Select one:


1.00
a. (“a”==“a”)&&(“c”!=“d”)

b. !(3<=1)

c. (4>=4)&&(5<=2)

d. None of the choices 

Your answer is incorrect.

Question 47 What is the output of the script below? 


Incorrect <script>
Mark 0.00 out of var str = "HELLO WORLD";
1.00 document.write(str.charAt(1));
</script>

Select one:
a. E

b. 69 

c. H

d. None of the choices

Your answer is incorrect.

Question 48 If str = "Jose, Enrique, Vicente" and res = str.slice(15,22), what will be the resulting value of res?
Incorrect

Mark 0.00 out of Select one:


1.00
a. Vicente

b. None of the choices 

c. ,Vicent

d. Enrique

Question 49 Part of the browser that understands JavaScript.


Correct

Mark 1.00 out of Select one:


1.00
a. Rendering Engine

b. JavaScript Compiler

c. None of the choices

d. JavaScript Interpreter 

Question 50 Is a property use to display document within the frame.


Correct

Mark 1.00 out of Select one:


1.00
a. method

b. None of the choices

c. name

d. document 
◄ Quiz 006 Jump to...

You might also like