0% found this document useful (0 votes)
326 views7 pages

Quiz and Test Module 3

Test sobre el módulo 3 de Python

Uploaded by

josegmay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
326 views7 pages

Quiz and Test Module 3

Test sobre el módulo 3 de Python

Uploaded by

josegmay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Quiz and Test (JSE) Module 3

Centro público integrado de formación profesional


Nuevo (desglose IES Campanillas)

Quiz and Test


JavaScript Essentials 1 (JSE)
Module 3

José García JavaScript - JSE-40-01


Quiz and Test (JSE) Module 3

Índice
JAVASCRIPT ESSENTIALS 1 (JSE) - MODULE 3 .............................................................................................................................3
JAVASCRIPT ESSENTIALS 1 (JSE) MODULE 3 ........................................................................................................................................................... 3
Operators and User Interaction ............................................................................................................................................................................. 3
QUIZ ....................................................................................................................................................................................................................4
TEST ...................................................................................................................................................................................................................6

José García 2 JavaScript - JSE-40-01


Quiz and Test (JSE) Module 3
JavaScript Essentials 1 (JSE) - Module 3

JavaScript Essentials 1 (JSE)


Module 3

Operators and User Interaction


After completing Module 3, the student will:

• know what operators are and how to classify them (by type of operand, by number of operands, etc.);
• be able to use assignment, arithmetic, logical, and comparison operators in practice;
• understand the operation of the conditional operator and the typeof, instanceof, and delete operators;
• understand what the precedence and associativity of basic operators are and be able to influence them
by means of bracket grouping;
• be able to perform basic two-way communication with the program user using the alert, confirm, and
prompt dialog boxes.

José García 3 JavaScript - JSE-40-01


Quiz and Test (JSE) Module 3
Quiz
Analyze the code snippet:
let n = 5 + 2 ** 2 * 3:
The result stored in the variable n is:
a. 117649
b. 42
c. 84
d. 17

The number 3 is stored in the variable x: (let x =3;). The command x=x*x wasthen called. This last command can
be replaced using:
a. x**=2;
b. x**=x;
c. x+=x;
d. x*= 2;

The string "1024" has been written into the str variable: (let str - "1024";).
Then the operation str = -str is performed. As a result, the variable str will contain:
a. -1024
b. "1024"
c. "-1024"
d. NaN

Analyze the code snippet:


let n = 10;
let m = n++;
Its execution will result in the following values in the variables n and m
a. n. 10, m. 11
b. n: 11, m: 11
c. n: 11, m: 10
d. n: 10, m: 10

The result of the operation true && false I| true will bet
a. null
b. true
c. false
d. 1

The result of the operation 20 && 5 will be:


a. 25
b. true
c. 5
d. 20

The result of the operation true && "false" will be:


a. true
b. false
c. 0
d. "false"

José García 4 JavaScript - JSE-40-01


Quiz and Test (JSE) Module 3
Analyze the code snippet:
let str = "10";
let a = (str = 10);
let b = (str == 10);
let c = (str === 10);
After its execution the variables a, b and a will have the values:
a. a: 10. b: false, c: true
b. a: 10, b: 10, c: 10
c. a: 10, b: true, c: false
d. a: 10. b: null, c: null

Which operator do we use if we want to check if two variables store different values?
a. !==
b. <>
c. Diff
d. =!

The result of the comparison "abcd" > "dc" will be:


a. “abcd”
b. -1
c. false
d. true

The result of the operation 6 * 2 < 20 - 15 will be:


a. -9
b. NaN
c. false
d. true

Which method will display a dialog box that allows the user to type in any string?
a. alert
b. confirm
c. prompt
d. fill

The confirm method allows you to create a dialog box. What value does this method return when the user closes
the window?
a. It depends on the option selected by the user.
b. It always returns false .
c. The string entered by the user.
d. It always returns true.

Analyze the following code:


let choice = confirm("Are you ready?") ? "true":"false"
What value will the choice variable have if we press the OK button in the dialog box after running the code?
a. true
b. "ОК"
c. false
d. "true"

José García 5 JavaScript - JSE-40-01


Quiz and Test (JSE) Module 3
Test
The number 2 is stored in the variable n (let n – 2;). The command n = n*n*n is then called. This last
command can be replaced by:
a. n***=n;
b. n**=3;
c. n**=n;
d. n*=3;

Analyze the code snippet:


let nr = "1";
let x = (nr === 1);
let y = (nr == 1);
let z = (nr = 1);
After its execution, the variables ×, y, and z will have the values:
a. x: 1,y: 1, z: 1
b. x: true, y: false, z: 1
c. x: false, y: true, z: 1
d. x: null, y: null, z: 1

Analyze the following code:


let test = prompt ("Hello", "World");
What value will the test variable have if, after running the code, we immediately press the OK button on the
newly created dialog?
a. "ОК"
b. true
c. "World"
d. "Hello"

The confirm method allows you to create a dialog box. What value does this method return when the user closes
the window?
a. The string entered by the user.
b. It depends on the option selected by the user.
c. Always false.
d. Always true

The result of the operation 20 | | 5 will be:


a. true
b. 25
c. 5
d. 20

The result of the operation 3 * 4 > 20 - 15 will be:


a. -14
b. NaN
c. true
d. false

Analyze the code snippet:


let n = 2 * 3 ** 3 - 1;
The result stored in the variable n is:
a. 36
b. 18
c. 215
d. 53

José García 6 JavaScript - JSE-40-01


Quiz and Test (JSE) Module 3
The result of the operation ! (true 66 false || true) will be:
a. 1
b. null
c. false
d. true

The string "12" has been written into the str variable: ( let str = "12"; ). Then the operation str = +str is
performed. As a result, the variable str will contain:
a. NaN
b. “+12”
c. “12”
d. 12

Analyze the code snippet:


let n = 10;
let m = ++n;
Its execution will result in the following values in the variables n and m:
a. n: 11, m: 11
b. n: 10, m: 11
c. n: 11, m: 10
d. n: 10 , m: 10

The result of the comparison "abcd" > "Abcd" will be:


a. “abcd”
b. 1
c. true
d. false

Which operator do we use if we want to check if two variables store the same values of exactly the same type?
a. ===
b. =
c. !==
d. ==

The methods window.alert, window.confirm, and window.prompt are methods of the window object.
Which of the following is not true?
a. The methods window.alert, window.confirm, and window.prompt are methods of the window object. Which
of the following is not true?
b. The window object represents the window in which the HTML document containing the JavaScript code
currently being executed is open.
c. The alert, confirm, and prompt methods display information in modal windows that block access to the
page until they are closed.
d. You can call window methods, such as window.alert, without including the name window, so calling alert
("abc") would be correct.

The result of the operation false || "false" will be:


a. 0
b. “false”
c. false
d. true

José García 7 JavaScript - JSE-40-01

You might also like