Section 1

Preview this deck

In the following line the word document is a(n) ______ that resides in the computer's memory. document.writeln("Hello World");

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 14, 2020

Cards (59)

Section 1

(50 cards)

In the following line the word document is a(n) ______ that resides in the computer's memory. document.writeln("Hello World");

Front

Object

Back

What is the value of num after the following statement is performed? num = 2 * Math.pow( 2, 3 );

Front

16

Back

A procedure for solving a problem in terms of the actions to be executed and the order in which these actions are to be executed is called ________.

Front

an algorithm

Back

Research determined that all programs could be written in terms of only three control structures. Which of the following is not one of the three control structures?

Front

goto-less structure

Back

What should you use as a counter in counter-controlled repetition?

Front

an integer

Back

Which of the following statements is correct?

Front

if ( studentGrade >= 60 ) document.write( "Passed" );

Back

What type of loop is shown in the script below? <script type = "text/javascript"> var gradeValue = 0, total = 0, grade = 0; while ( gradeValue != - 1 ) { total = total + gradeValue; grade = window.prompt( "Enter Integer Grade, -1 to Quit:" , "0" ); gradeValue = parseInt( grade ); } </script> a) counter controlled b) sentinel controlled c) algorithm controlled d) stepwise controlled

Front

sentinel controlled

Back

What is the value of num after the following statements are performed? num = 2.4589; num = num.toFixed( 2 );

Front

2.46

Back

Which of the following operators associates from right to left?

Front

=

Back

Which of the following is not a valid variable name?

Front

12footage

Back

What output will the following script produce? var i = 0; var j = 3; var counter = 0; while ( i < 5 ) { if (i != j) counter = counter + i; i = i + 1 } document.write( counter );

Front

7

Back

Which of the following is the correct abbreviation for the statement a = a * 7; ?

Front

a *= 7;

Back

What would the browser display if the following code were executed in a script? var x = 11; var y = 14; if ( x > 13 ) if ( y > 13 ) document.writeln( "x and y are > 13" ); else document.writeln( "x is <= 13" );

Front

nothing

Back

Which of the following statements would correctly print out the sentence "Hello World" in blue?

Front

document.write( "<p style = \"color: blue\">"); document.write( "Hello World </p>");

Back

What is the result of the statement 17 % 5?

Front

2

Back

What type of loop should be used in a script that processes test results for 150 students?

Front

counter controlled

Back

What would the browser display if the following code were executed in a script? var product = 0; while (product >= 25) product = 2 + product; document.writeln( product );

Front

0

Back

If the string passed to parseInt contains text characters, parseInt will ________.

Front

return NaN

Back

Which of the following flowchart symbols can represent an if statement?

Front

diamond

Back

The word sequence in the term sequence structure refers to the sequence of ________.

Front

JavaScript instructions in a script

Back

The word top in the term top-down stepwise refinement refers to which of the following?

Front

the single statement that completely represents the script

Back

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>

Front

55

Back

What is the output of the following script? i = 16; document.write( ++i );

Front

17

Back

If the initial value of a is 15, what new value is assigned to a in the expression a %= 4?

Front

3

Back

A program in which all statements are executed one after the other in the order in which they are written exhibits ________.

Front

sequential execution

Back

________ is an informal language that helps programmers develop algorithms.

Front

Pseudocode

Back

Which of the following is a JavaScript repetition statement?

Front

do...while

Back

An alert dialog displaying the text "Welcome!" is created by calling _________.

Front

window.alert( "Welcome!" );

Back

In the following line, the word writeln is a(n) _________ that performs a task or action in the script. document.writeln("Hello World");

Front

Method

Back

Which of the following is declared correctly and will not result in an error, assuming x = 2 and y = 30?

Front

for ( var j = x; j <= 80 * y; j += 5 / x )

Back

What would the browser display if the following script were executed? <script type = "text/javascript"> var count = 0; var total = 0; while ( count <= 5 ) { total = total + 10; count = count + 1; } document.write( total ); </script>

Front

60

Back

If the string passed to parseInt contains a floating-point numeric value, parseInt will ________.

Front

truncate the floating-point part to be left with an integer value

Back

What is the value of i after the following statements? i = 2; i--; i--;

Front

0

Back

Which of the following is not a valid JavaScript equality or relational operator?

Front

=

Back

Which of the following is not a JavaScript selection statement?

Front

for...in

Back

What would the browser display if the following script were executed? <script type = "text/javascript"> <!-- for ( var i = 0; i < 5; i++ ) document.write( "O" ); //--> </script>

Front

OOOOO

Back

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.

Front

parentheses, subtraction, modulus

Back

What would the browser display if the following script were executed? <script type = "text/javascript"> var count = 5; var total = 0; while ( count > -1 ) { total = total - 10; count = count - 1; } document.write( total ); </script>

Front

-60

Back

What would the browser display if the following code were executed in a script? var product = 0; while ( product <= 25 ); product = 2 + product;

Front

nothing, the script would result in an inifite-loop error

Back

Which of the following is not a JavaScript keyword?

Front

sub

Back

Which of the following flowchart symbols indicates that a decision is to be made?

Front

diamond

Back

Specifying the order in which programming statements are to be executed is called ________.

Front

program control

Back

Whenever a value is placed in a memory location, the value________.

Front

replaces the previous value in that location

Back

What does the following expression evaluate to? ( ( 3 + ( 5 + 4 ) * 7 ) + 4 ) / 5

Front

14

Back

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? document.writeln("Hello World </p>"); //--> </script> </html>

Front

Nothing

Back

What is the value of i after the following statements? i = 2; i++;

Front

3

Back

What would the browser display if the following code were executed in a script? var grade = 59; if ( grade >= 60 ) document.writeln( "Passed." ); else document.write( "Failed. " ); document.writeln( "You must take this course again." );

Front

Failed. You must take this course again.

Back

What would the browser display if the following script were executed? <script type = "text/javascript"> <!-- for ( var i = 0; var i < 5; var i++ ) document.write( "X" ); //--> </script>

Front

XXXXX

Back

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>

Front

The word var must be placed before thirdNumber in line 3.

Back

Which of the following is not required for counter-controlled repetition?

Front

sentinel

Back

Section 2

(9 cards)

What would the browser display if it executed the following script? <script type = "text/javascript"> <!-- for ( var count = 1; count <= 10; ++count ) { if ( count == 5 ) break; } document.writeln( count ); //--> </script>

Front

5

Back

Which of the following will not evaluate to true?

Front

false II false

Back

Which of the following will not evaluate to false?

Front

true && true

Back

Consider the following code selections. Assume count is initialized to 7 and num is initialized to 0. i) ii) do { while ( count < 6 ) num = count; num = count; } while ( count < 6 ) What will the value of num be for i) and ii) respectively after the loops have been executed?

Front

7,0

Back

What would the browser display if it executed the following script? <script type = "text/javascript"> <!-- var i = 0; do { document.write( "O" ); i++; } while ( i > 5 ); //--> </script>

Front

O

Back

What would the browser display if it executed the following script? <script type = "text/javascript"> <!-- for ( var count = 0; count < 10; ++count ) { if ( count == 5 ) continue; } document.writeln( count ); //--> </script>

Front

10

Back

The ________ multiple-selection statement is used to handle decision making and can be used to replace multiple if and if...else statements.

Front

d) switch

Back

In a switch statement, the ________ case clause is used to process exceptional conditions and is usually listed last.

Front

default

Back

switch statements contain ________ labels.

Front

case

Back