0

web technology Online Quiz - 126

Description: web technology Online Quiz - 126
Number of Questions: 20
Created by:
Tags: web technology
Attempted 0/20 Correct 0 Score 0

What is the correct syntax for referring to an external script called "xxx.js"?


Correct Option: A

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

  1. alert("Hello World")

  2. alertBox="Hello World"

  3. alertBox("Hello World")

  4. msgBox("Hello World")


Correct Option: A

How do you create a function?

  1. function myFunction()

  2. function=myFunction()

  3. function:myFunction()

  4. function myFunction


Correct Option: A

How do you call a function named "myFunction"?

  1. call myFunction()

  2. call function myFunction

  3. myFunction()

  4. call function myFunction()


Correct Option: C

AI Explanation

To call a function named "myFunction", you would use the syntax in option C: myFunction().

In programming, when you define a function with a specific name, you can call that function by using its name followed by parentheses. This syntax indicates to the program that you want to execute the code inside the function.

Options A, B, and D are incorrect:

Option A: call myFunction() - This is not the correct syntax for calling a function. In most programming languages, you do not need to use the keyword "call" before calling a function.

Option B: call function myFunction - This is also not the correct syntax for calling a function. It includes the unnecessary keyword "call" and the keyword "function".

Option D: call function myFunction() - This is similar to option B, including the unnecessary keywords "call" and "function".

Therefore, the correct answer is option C: myFunction(). This syntax directly calls the function named "myFunction".

How do you write a conditional statement for executing some code if "i" is equal to 5?

  1. if (i==5)

  2. if i=5 then

  3. if i=5

  4. if i==5 then


Correct Option: A

AI Explanation

To write a conditional statement for executing some code if "i" is equal to 5, you can use the following syntax:

A) if (i==5)

Explanation: Option A is the correct answer. In most programming languages, the double equals sign "" is used to represent equality. The condition `(i5)` checks if the variable "i" is equal to 5. If the condition evaluates to true, the code block following the if statement will be executed.

How do you write a conditional statement for executing some code if "i" is NOT equal to 5?

  1. if =! 5 then

  2. if (i != 5)

  3. if (i <> 5)

  4. if <> 5


Correct Option: B

How does a "while" loop start?

  1. while (i<=10)

  2. while (i<=10;i++)

  3. while i=1 to 10

  4. while (i=0;i<=10;i++)


Correct Option: A

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) while (i<=10) - This option is correct because it starts the "while" loop with the condition that the loop will continue as long as the variable "i" is less than or equal to 10.

Option B) while (i<=10;i++) - This option is incorrect because it uses the semicolon (;) inside the parentheses, which is not the correct syntax for a "while" loop.

Option C) while i=1 to 10 - This option is incorrect because it uses the assignment operator (=) instead of the comparison operator (<=) to set the condition for the loop.

Option D) while (i=0;i<=10;i++) - This option is incorrect because it uses the assignment operator (=) instead of the comparison operator (<=) to set the initial value of "i" and the condition for the loop.

The correct answer is Option A. This option is correct because it correctly starts the "while" loop with the condition that the loop will continue as long as the variable "i" is less than or equal to 10.

How does a "for" loop start?

  1. for (i = 0; i <= 5)

  2. for i = 1 to 5

  3. for (i <= 5; i++)

  4. for (i = 0; i <= 5; i++)


Correct Option: D
  1. //This is a comment

  2. 'This is a comment

  3. /*This is a comment


Correct Option: A

What is the correct JavaScript syntax to insert a comment that has more than one line?

  1. //This comment has more than one line//

  2. /This comment has more than one line/

  3. 'This comment has more than one line


Correct Option: C

What is the correct way to write a JavaScript array?

  1. var txt = new Array(1:"tim",2:"kim",3:"jim")

  2. var txt = new Array("tim","kim","jim")

  3. var txt = new Array:1=("tim")2=("kim")3=("jim")

  4. var txt = new Array="tim","kim","jim"


Correct Option: B
  1. round(7.25)

  2. Math.round(7.25)

  3. rnd(7.25)

  4. Math.rnd(7.25)


Correct Option: B
  1. Math.max(x,y)

  2. top(x,y)

  3. Math.ceil(x,y)

  4. ceil(x,y)


Correct Option: A

What is the correct JavaScript syntax for opening a new window called "w2" ?

  1. w2=window.open("http://www.w3schools.com");

  2. w2=window.new("http://www.w3schools.com");

  3. w2=window("http://www.w3schools.com");

  4. w2=openwindow("http://www.w3schools.com");


Correct Option: A

How do you put a message in the browser's status bar?

  1. window.status = "put your message here"

  2. status("put your message here")

  3. statusbar = "put your message here"

  4. window.status("put your message here")


Correct Option: A

How can you find a client's browser name?

  1. browser.name

  2. navigator.appName

  3. client.navName

  4. All the above


Correct Option: B

How many bit support does ASP.NET 2.0 provide?

  1. 16-bit support

  2. 32-bit support

  3. 64-bit support

  4. 128-bit support


Correct Option: C

ASP.NET 2.0 is not fully backward compatible with ASP.NET previous versions.

  1. True

  2. False


Correct Option: B
- Hide questions