Quiz 005 - Attempt Review2 PDF

You might also like

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

Dashboard / Courses / BLENDED 1923T.

B / BL-CS-301-LEC-1923T / Week 10: Conditional and Loop Statements / Quiz 005

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


State Finished
Completed on Friday, 8 November 2019, 1:01 PM
Time taken 1 min 57 secs
Marks 9/10
Grade 90 out of 100

Question 1 What does an assignment operator do?


Correct

Mark 1 out of 1 Select one:


a. Performs a comparison

b. Assigns a new value to a variable 

c. Gives a variable a new name

d. None of the choices

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


Correct

Mark 1 out of 1 Select one:


a. msg(“Hello World”)

b. None of the choices

c. alert(“Hello World”) 

d. msgBox(“Hello World”)

Your answer is correct.

Question 3 Which of the following comparisons will return false?


Correct

Mark 1 out of 1 Select one:


a. 4!=3

b. 3==3

c. 4<=3 

d. None of the choices

Your answer is correct.


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

b. None of the choices

c. World

d. Hello World 

Your answer is incorrect.

Question 5 Which of the following statements will return false?


Correct

Mark 1 out of 1 Select one:


a. !(3<=1)

b. (4>=4)&&(5<=2) 

c. None of the choices

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

Your answer is correct.

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

Mark 1 out of 1 Select one:


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

b. var rand_int= Math.floor(Math.random());

c. None of the choices

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

Your answer is correct.

Question 7 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 out of 1
Select one:
a. True 

b. False

Question 8 Which of the following comparisons will return true?


Correct

Mark 1 out of 1 Select one:


a. 4==3

b. 4!=3 

c. 4<3

d. None of the choices

Your answer is correct.


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

Mark 1 out of 1 Select one:


a. None of the choices 

b. =

c. &&

d. ==

Your answer is correct.

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


Correct

Mark 1 out of 1 Select one:


a. None of the choices 

b. 36

c. 35

d. 45

Your answer is correct.

◄ Lesson 8: Conditional and Loop


Jump to... Lesson 9: Javascript Arrays ►
Statements

You might also like