0

web technology Online Quiz - 99

Description: web technology Online Quiz - 99
Number of Questions: 20
Created by:
Tags: web technology
Attempted 0/20 Correct 0 Score 0
  1. A script is a
  1. Program or sequence of instructions that is interpreted or carried out by processor directly

  2. Program or sequence of instruction that is interpreted or carried out by another program

  3. Program or sequence of instruction that is interpreted or carried out by web server only

  4. None of above


Correct Option: B
  1. When compared to the compiled program, scripts run
  1. Faster

  2. Slower

  3. The execution speed is similar

  4. All of above


Correct Option: B
Explanation:

To answer this question, the user needs to know the difference between a compiled program and a script.

A compiled program is a set of machine-readable instructions that are generated by a compiler from high-level programming language source code. The compiled program is then executed directly by the computer's CPU.

On the other hand, a script is a set of instructions written in a programming language that is interpreted by an interpreter at runtime. The interpreter reads and executes the code line by line instead of generating machine code.

Now, let's go through each option and explain why it is right or wrong:

A. Faster: This option is generally incorrect. Compiled programs are usually faster than scripts because they are already translated into machine code. The computer can execute machine code directly, which is faster than interpreting source code line by line.

B. Slower: This option is generally correct. Scripts are usually slower than compiled programs because they need to be interpreted at runtime. The interpreter has to read and execute the code line by line, which is slower than executing machine code directly.

C. The execution speed is similar: This option is generally incorrect. In most cases, compiled programs are faster than scripts. However, there may be some cases where the execution speed is similar, such as when the compiled program is poorly optimized or the script is highly optimized.

D. All of the above: This option is incorrect. Option A and C contradict each other, so they cannot both be correct. Option B is generally correct, but there may be some rare cases where a script is faster than a poorly optimized compiled program.

Therefore, the correct answer is:

The Answer is: B. Slower

  1. PHP is a widely used ……………. scripting language that is especially suited for web development and can be embedded into html
  1. Open source general purpose

  2. Proprietary general purpose

  3. Open source special purpose

  4. Proprietary special purpose


Correct Option: A
  1. Which of the following is not true?
  1. PHP can be used to develop web applications

  2. PHP makes a website dynamic.

  3. PHP applications can not be compiled.

  4. PHP can not be embedded into html.


Correct Option: D
  1. The most portable version of PHP tag that is compatible to embed in XML or XHTML too is:
  1. ?>


Correct Option: D
  1. Which of the following variables is not a predefined variable?
  1. $get

  2. $ask

  3. $request

  4. $post


Correct Option: B
  1. You can define a constant by using the define() function. Once a constant is defined
  1. It can never be changed or undefined

  2. It can never be changed but can be undefined

  3. It can be changed but can not be undefined

  4. It can be changed and can be undefined


Correct Option: A
  1. The following piece of script will output: $email=’[email protected]’; $new=strstr($email, ‘@’ print $new; ?>
  1. admin

  2. admin@psexam

  3. @psexam.com

  4. psexam.com


Correct Option: C
  1. Which of the following function returns the number of characters in a string variable?
  1. count($variable)

  2. len($variable)

  3. strcount($variable)

  4. strlen($variable)


Correct Option: D
  1. When you need to obtain the ASCII value of a character which of the following function you apply in PHP?
  1. chr( );

  2. asc( );

  3. ord( );

  4. val( );


Correct Option: C

The same file name can be specified in the USING and GIVING phrase of a SORT statement.

  1. True

  2. False


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) True - This option is correct. In a SORT statement, the same file name can be specified in both the USING and GIVING phrases. The USING phrase specifies the input file(s) to be sorted, and the GIVING phrase specifies the output file where the sorted data will be written.

Option B) False - This option is incorrect. The same file name can be specified in both the USING and GIVING phrases of a SORT statement.

The correct answer is A) True. This option is correct because the same file name can indeed be specified in both the USING and GIVING phrases of a SORT statement.

When you execute 'open with lock', the following occurs :

  1. If the specified file is already in the open mode, the program is suspended, and waits for exclusive availability of the file.

  2. If the specified file is not in the open mode, the file is opened.

  3. If the specified file is not in the open mode, the program is suspended, and waits for exclusive availability of the file.

  4. If the specified file is in the open mode, the file is opened.


Correct Option: A,B

Which are the JSP scripting elements below?

  1. Declarations

  2. Scriptlets

  3. Expressions

  4. Include


Correct Option: A,B,C

Fullform of a JSP ?

  1. Java servlet paper

  2. Java server Paper

  3. Java Server Pages

  4. None


Correct Option: C

What are the common mechanisms used for session tracking?

  1. Cookies

  2. URL- rewriting

  3. sessions

  4. SSL sessions


Correct Option: A,B,D
  1. init(ServletConfig config)

  2. service( ServletRequest req, ServletResponse res)

  3. destroy( ServletRequest req, ServletResponse res)

  4. destroy()


Correct Option: A,B,D

A doGet() method is limited with 2k of data to be sent?

  1. True

  2. False


Correct Option: A

What is the correct JavaScript syntax to write "Hello World"?

  1. "Hello World"

  2. document.write("Hello World")

  3. response.write("Hello World")

  4. ("Hello World")


Correct Option: B

AI Explanation

To answer this question, you need to have a basic understanding of JavaScript syntax for displaying text on a webpage. Let's go through each option to understand why it is correct or incorrect:

Option A) "Hello World" - This option is incorrect because it is just a string literal and does not display the text on a webpage.

Option B) document.write("Hello World") - This option is correct because it uses the document.write() method to display the text "Hello World" on a webpage.

Option C) response.write("Hello World") - This option is incorrect because response.write() is not a valid JavaScript method for displaying text on a webpage.

Option D) ("Hello World") - This option is incorrect because it is missing a statement or method to display the text on a webpage.

The correct answer is B) document.write("Hello World"). This option is correct because it uses the document.write() method to display the text "Hello World" on a webpage.

- Hide questions