Question
1) Which of the following is NOT a valid variable name in Javascript? a. JavaScriptProgramming Languages b. isThisTrue c. No18Way . scriptingIsFun 2) Which statement
1)
Which of the following is NOT a valid variable name in Javascript?
a. | JavaScriptProgramming Languages | ||||||||
b. | isThisTrue | ||||||||
c. | No18Way | ||||||||
. | scriptingIsFun
2) Which statement is equivalent to the following? (X > 6)
|
3) Which one of these is a pre-test loop?
a. | while | b. | If else | c. | for | d. | Do while |
4) What is the value of count when the following loop is exited?
var count = 2;
while( count < 20)
count=count*3;
a. | 6 | b. | 18 | c. | 54 | d. | 201 |
5) How many times will "Happy Day!" display after the following code is executed?
var m = 3;
while ( m<=6) {
document.write("Happy Day!");
m++;
}
a. | 2 | b. | 3 | c. | 4 | d. | 5 |
6) What will be displayed after the following loop is exited?
var name = "Javascript";
for(var x = 2; x < 0; x--)
document.write(name.charAt(x) + ", ");
a. | java | b. | va |
c. | script | d. | javascript |
7) In the following statement, what is the test condition?
for(var x = 3; x < 5; x++)
a. | x = 3; | b. | x < 5 | c. | 5; | d.x++ |
|
8) Which of the following will test if a password entered by a user, stored in a variable named pwrd, is within the 8-character length restriction, specified in the instructions?
a. | var lgth = pwrd.length; if (lgth == 8) | b. | if (pwrd.length <= 8) |
c. | var length.pwrd = pwrd; if (pwrd <= 7) | d. | var lgth = 8; if (lgth == pwrd.length) |
9) What is the value of the variable myLetter after the following statements are executed?
var name = "Monroe College";
var myLetter = name.charAt(5);
a. | "o" | b. | "" | c. | "e" | d. | "Monroe" |
10) What is the value of address, given:
myAddress = "2501 Jerome Avenue, NY";
address = myAddress.length;
a. | 18 | b. | 22 | c. | 19 | d. | 2501 Jerome Avenue |
11) What is the value of street, given:
var street = " ";
myAddress = "123 Duck Street, NW";
var x = 4;
street = myAddress.charAt(x+2); + myAddress.charAt(x);
a. | Duck | b. | u | c. | uck | d. | CD |
True or false:
1) JavaScript is a loosely typed language.
2) You may use either single or double quotes to enclose the value of the text in a string variable.
3) Logical operators must always be done in order from left to right.
4) (x==0) is called an assignment
5) The following test condition for an if... structure will be true if x = 2:
if(x < 5 && x > 10)
6) The pretest loop always executes at least one time
7) An infinite loop occurs in a pre-test loop when a test condition can never be met.
8) (24%5+4<=2*9/3).
9) The following statement will generate a loop with four iterations:
for(count = 4; count > 0; count--)
10) The extension of a JavaScript file is .script
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started