Deck 6: Javascript: Introduction to Scripting

ملء الشاشة (f)
exit full mode
سؤال
What will the browser display if the following script is executed and the user enters 5 at both prompts
< script type = "text/javascript" >
< !--
Var firstNumber = window.prompt( "Enter an integer", "0" );
Var secondNumber= window.prompt( "Enter an integer", "0" );
Var thirdNumber;
ThirdNumber = firstNumber + secondNumber;
Document.write( thirdNumber );
//-- >
< /script >

A) nothing
B) 0
C) 10
D) 55
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
In the following line, the word writeln is a(n) _________ that performs a task or action in the script.
Document.writeln("Hello World");

A) structure
B) collection
C) object
D) method
سؤال
Which of the following operators associates from right to left

A) ==
B) =
C) +
D) %
سؤال
What does the following expression evaluate to
( ( 3 + ( 5 + 4 ) * 7 ) + 4 ) / 5

A) 8
B) 14
C) 17.6
D) 26.4
سؤال
An alert dialog displaying the text "Welcome!" is created by calling _________.

A) window.alert( "Welcome!" );
B) alert.window( "Welcome!" );
C) window( "alert = \"Welcome!\"" );
D) window( "< alert > Welcome! < /alert >" );
سؤال
Consider the following HTML5 code.
< html >
< script type = "text/javascript" >
< !--
< !-- document.writeln("Hello World"); -- >
//-- >
< /script >
< /html >
What would a browser capable of scripting display when executing this code

A) document.writeln("Hello World");
B) nothing
C) Hello World
D) < html > < script type = "text/javascript" >
< !--
< !-- document.writeln("Hello World < /p >");
//-- >
< /script >
< /html >
سؤال
Which of the following sequences does not follow the rules of operator precedence Assume that operators are evaluated in the order listed from left to right.

A) multiplication, division, addition
B) parentheses, subtraction, modulus
C) division, multiplication, addition
D) parentheses, modulus, subtraction
سؤال
Consider the following script. What is wrong with the following code
< script type = "text/javascript" >
Var firstNumber;
ThirdNumber;
FirstNumber = window.prompt("Enter an integer", "0");
SecondNumber = window.prompt("Enter an integer", "0");
ThirdNumber = firstNumber + secondNumber;
< /script >

A) thirdNumber in line 7 must be in quotes.
B) The words Enter an integer in line 6 should not be in quotes.
C) The word thirdnumber in line 3 should have a comma after it.
D) The word var must be placed before thirdNumber in line 3.
سؤال
What is the result of the statement 17 % 5

A) 0
B) 2
C) 3
D) 12
سؤال
Which of the following is not a valid variable name

A) Tax1
B) eightball_8
C) 12footage
D) pageNumber1200
سؤال
Whenever a value is placed in a memory location, the value________.

A) cannot be added if a value already exists
B) can share a location in memory with another value
C) replaces the previous value in that location
D) will be assigned to another identifier if a value already exists
سؤال
Which of the following is not a valid JavaScript equality or relational operator

A) =
B) <
C) >
C)!=
سؤال
Which of the following statements would correctly print out the sentence "Hello World" in blue

A) document.write( "< p style = \"color: blue\"); document.write( "Hello World >");
B) document.write( "< p > style = \"color: blue\" Hello World < /p >);
C) document.write( "< p style = \"color: blue\" Hello World + "< /p >");
D) document.write( "< p style = \"color: blue\" >"); document.write( "Hello World < /p >");
سؤال
In the following line the word document is a(n) ______ that resides in the computer's memory.
Document.writeln("Hello World");

A) attribute
B) behavior
C) object
D) method
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/14
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 6: Javascript: Introduction to Scripting
1
What will the browser display if the following script is executed and the user enters 5 at both prompts
< script type = "text/javascript" >
< !--
Var firstNumber = window.prompt( "Enter an integer", "0" );
Var secondNumber= window.prompt( "Enter an integer", "0" );
Var thirdNumber;
ThirdNumber = firstNumber + secondNumber;
Document.write( thirdNumber );
//-- >
< /script >

A) nothing
B) 0
C) 10
D) 55
D
2
In the following line, the word writeln is a(n) _________ that performs a task or action in the script.
Document.writeln("Hello World");

A) structure
B) collection
C) object
D) method
D
3
Which of the following operators associates from right to left

A) ==
B) =
C) +
D) %
B
4
What does the following expression evaluate to
( ( 3 + ( 5 + 4 ) * 7 ) + 4 ) / 5

A) 8
B) 14
C) 17.6
D) 26.4
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 14 في هذه المجموعة.
فتح الحزمة
k this deck
5
An alert dialog displaying the text "Welcome!" is created by calling _________.

A) window.alert( "Welcome!" );
B) alert.window( "Welcome!" );
C) window( "alert = \"Welcome!\"" );
D) window( "< alert > Welcome! < /alert >" );
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 14 في هذه المجموعة.
فتح الحزمة
k this deck
6
Consider the following HTML5 code.
< html >
< script type = "text/javascript" >
< !--
< !-- document.writeln("Hello World"); -- >
//-- >
< /script >
< /html >
What would a browser capable of scripting display when executing this code

A) document.writeln("Hello World");
B) nothing
C) Hello World
D) < html > < script type = "text/javascript" >
< !--
< !-- document.writeln("Hello World < /p >");
//-- >
< /script >
< /html >
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 14 في هذه المجموعة.
فتح الحزمة
k this deck
7
Which of the following sequences does not follow the rules of operator precedence Assume that operators are evaluated in the order listed from left to right.

A) multiplication, division, addition
B) parentheses, subtraction, modulus
C) division, multiplication, addition
D) parentheses, modulus, subtraction
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 14 في هذه المجموعة.
فتح الحزمة
k this deck
8
Consider the following script. What is wrong with the following code
< script type = "text/javascript" >
Var firstNumber;
ThirdNumber;
FirstNumber = window.prompt("Enter an integer", "0");
SecondNumber = window.prompt("Enter an integer", "0");
ThirdNumber = firstNumber + secondNumber;
< /script >

A) thirdNumber in line 7 must be in quotes.
B) The words Enter an integer in line 6 should not be in quotes.
C) The word thirdnumber in line 3 should have a comma after it.
D) The word var must be placed before thirdNumber in line 3.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 14 في هذه المجموعة.
فتح الحزمة
k this deck
9
What is the result of the statement 17 % 5

A) 0
B) 2
C) 3
D) 12
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 14 في هذه المجموعة.
فتح الحزمة
k this deck
10
Which of the following is not a valid variable name

A) Tax1
B) eightball_8
C) 12footage
D) pageNumber1200
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 14 في هذه المجموعة.
فتح الحزمة
k this deck
11
Whenever a value is placed in a memory location, the value________.

A) cannot be added if a value already exists
B) can share a location in memory with another value
C) replaces the previous value in that location
D) will be assigned to another identifier if a value already exists
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 14 في هذه المجموعة.
فتح الحزمة
k this deck
12
Which of the following is not a valid JavaScript equality or relational operator

A) =
B) <
C) >
C)!=
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 14 في هذه المجموعة.
فتح الحزمة
k this deck
13
Which of the following statements would correctly print out the sentence "Hello World" in blue

A) document.write( "< p style = \"color: blue\"); document.write( "Hello World >");
B) document.write( "< p > style = \"color: blue\" Hello World < /p >);
C) document.write( "< p style = \"color: blue\" Hello World + "< /p >");
D) document.write( "< p style = \"color: blue\" >"); document.write( "Hello World < /p >");
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 14 في هذه المجموعة.
فتح الحزمة
k this deck
14
In the following line the word document is a(n) ______ that resides in the computer's memory.
Document.writeln("Hello World");

A) attribute
B) behavior
C) object
D) method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 14 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 14 في هذه المجموعة.