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

An external JavaScript must contain the tag

  1. True

  2. False


Correct Option: B
  1. alert("Hello World")

  2. alertBox="Hello World"

  3. alertBox("Hello World")

  4. msgBox("Hello World")


Correct Option: A
  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.

  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

How can you add a comment in a JavaScript?

  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
  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

How do you find the number with the highest value of x and y?

  1. Math.max(x,y)

  2. top(x,y)

  3. Math.ceil(x,y)

  4. ceil(x,y)


Correct Option: A

AI Explanation

To find the number with the highest value of x and y, you can use the Math.max() function.

Option A) Math.max(x, y) - This option is correct because the Math.max() function returns the highest value among the given numbers. In this case, it will return the number with the highest value between x and y.

Option B) top(x, y) - This option is incorrect because the top() function does not exist in JavaScript or any common programming language. It is not a valid way to find the number with the highest value of x and y.

Option C) Math.ceil(x, y) - This option is incorrect because the Math.ceil() function is used to round a number up to the next largest integer. It does not compare two numbers and find the highest value.

Option D) ceil(x, y) - This option is incorrect because ceil() is not a valid function or method in JavaScript or any common programming language. It is not a valid way to find the number with the highest value of x and y.

The correct answer is Option A) Math.max(x, y). This option is correct because it correctly compares the values of x and y and returns the number with the highest value.

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

Which of the following features of ASP.NET 2.0 provides 'visual inheritance'

  1. Themes

  2. Site Navigation

  3. Gird View

  4. Master Pages


Correct Option: D
- Hide questions