WorksheetsWeb Tech Quiz 3
Total questions: 72
Worksheet time: 52mins
Which of the following explains correctly what happens when a JavaScript program is developed on a Unix Machine?
will work perfectly well on a Windows Machine
will be displayed as JavaScript text on the browser
will throw errors and exceptions
must be restricted to a Unix Machine only
Which of the following is the correct way to add a comment in PHP code?
#
//
/* */
All of the mentioned
Which of the following is the default file extension of PHP files?
.php
.ph
.xml
.html
How to define a function in PHP?
functionName(parameters) {function body}
function {function body}
function functionName(parameters) {function body}
data type functionName(parameters) {function body}
Which is the right way of declaring a variable in PHP?
$3hello
$_hello
$this
$5_Hello
Which of the following PHP functions can be used for generating unique ids?
md5()
uniqueid()
mdid()
id()
In the following PHP program, what is/are the properties?
function sample()
echo “This is an example”;
public $name;
class Example
A function in PHP which starts with __ (double underscore) is known as __________
Default Function
User Defined Function
Inbuilt Function
Magic Function
How many functions does PHP offer for searching and modifying strings using Perl-compatible regular expressions.
10
7
8
9
Which of the following web servers are required to run the PHP script?
Apache and PHP
IIS
XAMPP
Any of the mentioned
Which of the following PHP functions can be used to get the current memory usage?
memory_get_usage()
memory_get_peak_usage()
get_peak_usage()
get_usage()
Which one of the following PHP function is used to determine a file’s last access time?
filetime()
fileatime()
fileltime()
filectime()
What is PHP?
PHP is an open-source programming language
PHP is used to develop dynamic and interactive websites
PHP is a server-side scripting language
All of the mentioned
What does PHP stand for?
PHP stands for Preprocessor Home Page
PHP stands for Pretext Hypertext Processor
PHP stands for Hypertext Preprocessor
PHP stands for Personal Hyper Processor
What is the correct syntax to declare a variable in JavaScript?
var x = 5;
x = 5;
let x = 5;
const x : 5;
Which of the following is a valid way to create a function in JavaScript?
function myFunction: { // code }
myFunction() = function() { // code }
function myFunction() { // code }
function:myFunction() { // code }
What does 'NaN' stand for in JavaScript?
Not-a-Variable
Not-a-Value
Not-a-Number
Not-a-String
How do you create an array in JavaScript?
let arr = [];
let arr = {};
let arr = new Array();
let arr = () => {};
What is the purpose of the 'this' keyword in JavaScript?
The 'this' keyword refers to the global scope in JavaScript.
The 'this' keyword in JavaScript is used to refer to the current execution context or the object that is executing the function.
The 'this' keyword is used to declare variables in JavaScript.
The 'this' keyword is used to define classes in JavaScript.
Which operator is used to assign a value to a variable in JavaScript?
=
+=
-=
==
What is the output of 'typeof null' in JavaScript?
undefined
string
number
object
How do you write a single-line comment in JavaScript?
/* This is a single-line comment */
// This is a single-line comment
# This is a single-line comment
What is the correct way to include a PHP file in another PHP file?
require_once 'filename.php';
Use include 'filename.php'; or require 'filename.php';
Use import 'filename.php';
Include 'filename.php' with brackets;
How do you declare a variable in PHP?
$variableName;
var variableName;
variableName$;
declare variableName;
What is the difference between 'echo' and 'print' in PHP?
'echo' returns a value while 'print' does not
'print' can take multiple parameters like 'echo'
'echo' is slower than 'print' in execution time
The main difference is that 'echo' can take multiple parameters and does not return a value, while 'print' can only take one argument and returns 1.
How do you create an associative array in PHP?
$associativeArray = array('key1', 'value1', 'key2', 'value2');
$associativeArray = new Array('key1' => 'value1', 'key2' => 'value2');
$associativeArray = array('key1' => 'value1', 'key2' => 'value2'); // or $associativeArray = ['key1' => 'value1', 'key2' => 'value2'];
$associativeArray = ['key1', 'value1', 'key2', 'value2'];
What symbol is used to denote a variable in PHP?
&
$
%
@
What is the purpose of the 'include' statement in PHP?
To start a new PHP session.
To create a new function in PHP.
The purpose of the 'include' statement in PHP is to include and evaluate a specified file.
To define a variable in PHP.
How do you define a constant in PHP?
Constants in PHP are defined with the syntax constant('CONSTANT_NAME', value);
You define a constant in PHP using define('CONSTANT_NAME', value) or const CONSTANT_NAME = value;.
You can create a constant in PHP by using var CONSTANT_NAME = value;
You define a constant in PHP using set_constant('CONSTANT_NAME', value);
What is the output of '5 + "5"' in JavaScript?
5 + 5
55.0
10
55
How do you check if a variable is an array in PHP?
Use is_array($variable) to check if a variable is an array.
Use check_array($variable) to determine if it's an array.
Use array_check($variable) to verify if it's an array.
Check if gettype($variable) equals 'array'.
What is the correct way to start a session in PHP?
session_start();
start_session();
session_begin();
initialize_session();
How do you concatenate strings in PHP?
Use the ampersand (&) operator to concatenate strings.
Use the comma (,) operator to concatenate strings.
Use the dot (.) operator to concatenate strings.
Use the plus (+) operator to concatenate strings.
What is the purpose of the 'return' statement in a PHP function?
The 'return' statement defines the function's parameters.
The 'return' statement ends the execution of the function.
The 'return' statement sends a value back to the caller of the function.
The 'return' statement is used to declare a variable.
What is the purpose of the 'return' statement in a PHP function?
The 'return' statement defines the function's parameters.
The 'return' statement ends the execution of the function.
The 'return' statement sends a value back to the caller of the function.
The 'return' statement is used to declare a variable.
.......................is a high-level scripting language that is synchronous with client-side scripting
javaScript
php
oracle
None of these
A ..................... scripting is a light weight programming language
java script
php
oracle
none of these
In HTML, JavaScript code is inserted between ........... and tags
script
VER
TITLE
None of these
To access an HTML element, JavaScript can use the ........................ method.
document.getElementById(id)
CONSOLE
COUT
none of these
........................ Is used to show the out put or give message
document.write():
printf
COUT
None of these
Which type of JavaScript language is ___
Object-Oriented
Object-Based
Assembly-language
High-level
The "function" and " var" are known as
Keywords
Data types
Declaration statements
Prototypes
What should be the correct syntax to write a PHP code?
< php >
< ? php ?>
<? ?>
</ php />
Which of the following is used to display the output in PHP?
echo
write
print
Both echo and print
Which of the following is the correct way of defining a variable in PHP?
$variable name = value;
$variable_name = value;
$variable_name = value
$variable name as value;
Which of the following is used to end a statement in PHP?
! (exclamation)
; (semicolon)
/ (slash)
. (dot)
The raw text, images, and other elements included in a web page
website content
website structure
heading
website
The purpose of different pieces of content in a web page, used to help the computer determine how that content should be displayed
Website structure
Website content
Intellectual property
Copyright
The collected information about an individual across multiple websites on the Internet.
Digital Footprint
Website structure
HTML Element
Heading
What for statament parameter sets starting value?
counter
condition
increment/decrement
do-while
What type of webpage that changes its content upon interacting with the user?
Dynamic website
Static Website
Interactive Website
Idle Website
Which of these statements is not true?
The web operates on a client-server model.
Web servers and web browsers speak HTTP to each other and do so using host names, domain names, and IP addresses.
A web server is special software that knows how not to respond to requests for web pages.
None of the above
What is a scripting language designed specifically for use on the web. It has features to aid you in programming the tasks needed to develop dynamic web applications?
Javascript
PHP
HTML
CSS
Which of the these statements is not true?
The web server continues in HTML mode until it encounters a PHP opening tag (<?php).
The web server starts scanning the file in HTML mode. It assumes the statements are HTML and sends them to the browser without any processing.
The web server continues in PHP mode until it encounters a PHP closing tag (?>).
None of the above.
(a) are containers used to hold information.
Which of these statements were the rule of declaring variable in PHP?
All variable names have a dollar sign ($) in front of them. This tells PHP that it is a variable name.
Variable names must begin with a letter or an underscore. They cannot begin with a number.
Variable names can be any length.
Variable names can include letters, numbers, and underscores only.
All of the above
(a) are a series of instructions in a file named with an extension that tells the web server
What statement tests conditions, executing a block of statements when a condition is true?
(a)
The system of files and directories is called _____.
File system
File directory
File Manager
File dataset
What is a way to store information (in variables) to be used across multiple pages?
POST
SESSION
METHOD
ENCRYPT
Look at this series: 201, 202, 204, 207, ... What number should come next?
205
208
210
211
Look at this series: 544, 509, 474, 439, ... What number should come next?
404
414
420
445
9 16 23 30 37 44 51
59 66
56 62
58 66
58 65
54 61
In a certain code, HARYANA is written as 8197151, how is DELHI written in that code?
45389
57389
89654
12547
If in a code language. COULD is written as BNTKC and MARGIN is written as LZQFHM, how will MOULDING be written in that code?
CHMFINTK
LNKTCHMF
LNTKCHMF
NITKHCMF
In a certain code, MONKEY is written as XDJMNL. How is TIGER written in that code?
QDFHS
SDFHS
SDFHS
UJHFS
Direction
Study the data given below and answer the following questions:
‘Royal Monarch Regal’ is written as @ # *,
‘Regal legacy Gold’ is written as * % ?,
‘Hope Gold Life’ is written as % & $,
‘Regal Monarch Morals’ is written as # * ∀
Q. What will be the code for Regal?
%
*
$
#
?
एक लीप ईयर में कितने घंटे होते हैं।
How many hours are there in a leap year?
6570
8760
2470
8784
Which number would replace the underline mark in the series 20, 40, 100, _, 820?
240
260
280
300
What are the missing numbers in this series, 15, 20, 24, 15, 28, 32 15, _, _, 15?
37,41
36,40
38,42
40,44
12, 24, 14, 28, 18, 36, __
24
25
26
28
Find the missing numbers in the series, 4, 20, 7, 14, 10, 8, 13, _, _.
(a)
