Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Students can Download Computer Applications Chapter 4 Introduction to Hypertext Pre-Processor Questions and Answers, Notes Pdf, Samacheer Kalvi 12th Computer Applications Book Solutions Guide Pdf helps you to revise the complete Tamilnadu State Board New Syllabus and score more marks in your examinations.

Tamilnadu Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Samacheer Kalvi 12th Computer Applications Introduction to Hypertext Pre-Processor Text Book Back Questions and Answers

PART – I
I. Choose The Correct Answer

Question 1.
What does PHP stand for?
(a) Personal Home Page
(b) Hypertext Preprocessor
(c) Pretext Hypertext Processor
(d) Pre-processor Home Page
Answer:
(b) Hypertext Preprocessor

Question 2.
What does PHP files have a default file extension?
(a) html
(b) xml
(c) .php
(d) ph
Answer:
(c) .php

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 3.
A PHP script should start with ……………………. and end with …………………….
(a) <php>
(b) < ? php ?>
(c) < ? ? >
(d) < ?php ? >
Answer:
(d) < ?php ? >

Question 4.
Which of the following must be installed on your computer so as to mn PHP script?
(a) Adobe
(b) windows
(c) Apache
(d) IIS
Answer:
(c) Apache

Question 5.
We can use ………………….. to comment a single line?
(i) /?
(ii) 11
(iii) #
(iv) /* */
(a) Only (ii)
(b) (i), (iii) and (iv)
(c) (ii), (iii) and (iv)
(d) Both (ii) and (iv)
Answer:
(c) (ii), (iii) and (iv)

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 6.
What will be the output of the following PHP code?
Answer:
< ?php
$num =1;
$num1 =2;
print $num . $num1 ;
?>
(a) 3
(b) 1+2
(c) 1.+.2
(d) Error
Answer:
(a) 3

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 7.
Which of the following PHP statements Will output Hello World on the screen?
(a) echo (“Hello World”)
(b) print (“Hello World”)
(c) printf (“Hello World”)
(d) sprintf (“Hello World”)
Answer:
(a) echo (“Hello World”)

Question 8.
Which statement will output $x on the screen?
(a) echo “\$x”
(b) echo “$$x”
(c) echo “/$x”
(d) echo “$x
Answer:
(a) echo “\$x”

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 9.
Which of the below symbols is a newline character?
(a) \r
(b) \n
(c) /n
(d) /r
Answer:
(b) \n

PART – II

II. Short Answers

Question 1.
What are the common usages of PHP?
Answer:

  • PHP can be used on all major operating systems.
  • PHP has also support for most of the web servers today. This includes Apache, IIS, and many others.
  • The main advantage of creating your own PHP GUI(Graphical User Interface)
  • PHP can interact with MySQL databases
  • PHP can perform all types of calculations and It can collect user information.

Question 2.
What is Webserver?
Answer:
Web server software is available as the open-source or licensed version in the market. A Web server is a Software that uses HTTP (Hypertext Transfer Protocol) to serve the files that form Web pages to users.

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 3.
What are the types of a scripting language?
Answer:
Web scripting languages are classified into two types,

  1. Client-side scripting language
  2. Server-side scripting language

Question 4.
Difference between Client and Server?
Answer:
The server is a high-performance hardware machine it could run more than one application concurrently. The client is a separate hardware machine which is connected with the server in the network (Internet/intranet). It could send the request and receive the response from the server hardware. The Server and client are also called a service provider and service requester respectively.

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 5.
Give few examples of Web Browser?
Answer:

  • Google Chrome v Mozilla Firefox
  • Opera
  • Safari
  • Internet Explorer
  • UC Browser
  • Netscape Navigator etc.

Question 6.
What is a URL?
Answer:
URL: Uniform Resource Locator, the address of a specific Web page or file on the Internet. Eg. http://example.com

Question 7.
Is PHP a case sensitive language?
Answer:
Yes, PHP is case sensitive in regards to function only but it should not include the function(s) which is defined by the user.

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 8.
How to declare variables in PHP?
Answer:
The variable in PHP begins with a dollar ($) symbol and the assignment activity implemented using “=” operator, finally the statement ends with a semicolon The semicolon indicates the end of the statement.
$a=5; $b=T0;

Question 9.
Define Client-Server Architecture?
Answer:

  • Client-server architecture is a network architecture in which each computer or process on the network is either a client or a server.
  • Servers are powerful computers or processes dedicated to managing disk drives printers, or network traffic
  • Clients are PCs or workstations on which users run applications.

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 10.
Define Webserver?
Answer:
Web server software is available as the open-source or licensed version in the market.
A Web server is a Software that uses HTTP (Hypertext Transfer Protocol) to serve the files that form Web pages to users.

PART – III
III. Explain in Brief Answer

Question 1.
Write the features of a server-side scripting language?
Answer:

  1. The server is a high-performance hardware machine it could run more than one application concurrently.
  2. Most of the server side scripting languages are working on anyone the client-server architecture model.
  3. The webserver is software which is running in server hardware.
  4. It takes the responsibilities for the compilation and execution of server-side scripting languages.

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 2.
Write is the purpose of Web servers?
Answer:

  1. A web server (or Web server) is server software or hardware dedicated to running said software, that can satisfy World Wide Web client requests.
  2. A web server can, in general, contain one or more websites.
  3. A web server processes incoming network requests over HTTP and several other related protocols.

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 3.
Differentiate Server-side and Client-Side Scripting language?
Answer:
Server Side Scripting Language:

  1. The server is a high-performance hardware machine. It could run more than one application concurrently.
  2. The server is the service provider.
  3. Ex. Php. Asp.net, Python, Cold Fusion
  4. It is relatively secure

Client-Side Scripting Language:

  1. The client is a separate hardware machine which is connected with a server in the network.
  2. The client is the service requester
  3. html, css, Javascript
  4. Insecure

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 4.
In how many ways you can embed PHP code in an HTML page?
Answer:

  1. There are two ways to use HTML on your PHP page.
  2. The first way is to put the HTML outside of your PHP tags. You can even put it in the middle if you close arid reopen the tags.
  3. The second way to use HTML with PHP is by using PRINT or ECHO. By using this method you can include the HTML inside of the PHP tags.

Question 5.
Write short notes on PHP operator?
Answer:
Operator is a symbol which is used to perform mathematical and logical operations in the programming languages. Different types of operator in PHP are:

  1. Arithmetic operators
  2. Assignment operators
  3. Comparison operators
  4. Increment/Decrement operators,
  5. Logical operators, and
  6. String operators.

PART – IV
IV. Explain in detail

Question 1.
Explain client-side and server-side scripting language?
Answer:

  1. PHP (Hypertext Pre-processor) is a one of the important server-side Web and general-purpose scripting language invented by Rasmus Lerdorf in 1994.
  2. It is very simple and lightweight open-source server-side scripting language.
  3. It can easily embed with HTML and other client-side scripting languages like CSS (Cascading Style Sheets) and Javascript.
  4. It also creates dynamic and interactive Webpages in the real-time Web development projects
  5. Web scripting languages are classified into two types, client-side and server-side scripting language.
  6. PHP is completely different from Client-side scripting language like Javascript.
  7. The PHP code entirely executes on Webserver which is installed in the remote machine and it is generating HTML code that is sent to the user.
  8. The user receives the HTML code and sees the Website contents via an Internet browser in their computer or laptop.
  9. PHP also supports OOPs (Object Oriented Programming) concepts. It is applicable to implement all OOPs features such as class, object and inheritance etc. The action is shown in Figure.

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to H - 1

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 2.
Discuss in detail Website development activities?
Answer:
Web development concept describes in detail Website development and hosting through the network (Internet/Intranet).
The process of development also includes

  • Web content generation
  • Web page designing
  • Website security and so on.

Website Development Life Cycle

1. Information Gathering

  • Set goals for the website
  • Define website’s target audience

2. Planning

  • Create a sitemap sketch
  • Create a wireframe/mockup
  • Select technology stack

3. Design

  • Create colorful page layouts
  • Review the layouts
  • Get client’s feedback on the layouts
  • Change the layout when required

4. Content writing and assembly

  • Create new content
  • Get content ready for migration

5. Coding

  • Build and deploy a website
  • Add special features and website
  • Testing, Review and Launch

6. Test the create website

  • Upload the website to server
  • Final test and launch

7. Maintenance and Regular updating

  • Add report system
  • Fix bugs
  • Keep website up-to-day

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to H - 2

Question 3.
Explain the process of Webserver installation?
Answer:
Web server software that runs on server hardware, governs the server-side scripting compilation into an intermediate bytecode that is then interpreted by the runtime engine.

Web server software is available as the open-source or licensed version in the market. Recent statistics of Web server usage depict that more than 130% of Websites are running under open-source Web servers such as Tomcat Apache, Nginx etc. The following are the steps to install and configure Apache Httpd Webserver and PHP module in windows server machine.

Step 1:
Go to the Apache foundation Website and download the Httpd Webserver Software.
https://httpd.apache.org/download.cgi

Step 2:
After downloading .MSI file from Apache foundation Website, user launches the. MSI file and clicks next and next button to finish the installation on server machine. The software takes default port number 130 or 130130. Once the user finished, the Web server software is installed and configured on server hardware machine as a service.

Step 3:
To test the installation of Apache Httpd Webserver, enter the following URL from your Web browser which is installed in your client machine.
https://localhost:130/ or https://localhost: 130130 The output page that says “Its works”

Step 4:
Administrator user can start, stop and restart the Web server service at any time via the Windows Control panel. Once the services stops, the client machine will not receive the response message from the server machine.

Step 5:
Webserver’s configuration setting “httpd.conf” file is located in the conf directory under the apache installation directory. Edit this file and enable the PHP module to run PHP scripting language.

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 4.
Discuss in detail PHP data types?
Answer:
PHP Data type:
PHP scripting language supports 13 primitive data types. Data Types plays important role in all programming languages to classify the data according to the logic. PHP supports the following data types.

  1. String
  2. Integer
  3. Float
  4. Boolean
  5. Array
  6. Object
  7. NULL
  8. Resource

1. String:
String is a collection of characters within the double or single quotes like
“Computer Application” or ‘Computer Application’. Space is also considered as a character.
Example:
$x = “Computer Application!”;

2. Integer:
Integer is a data type which contains non-decimal numbers.
Example:
$x = 59135;
*
The var_dump( ) system define function, returns structured information (type and value) about variables in PHP.

3. Float:
Float is a data type which contains decimal numbers.
Example:
$x = 19.15;

4. Boolean:
Boolean is a data type which denotes the possible two states, TRUE or FALSE
Example:
$x = true;
$y = false;

5. Array:
The array is a data type which has multiple values in a single variable.
Example:
Scars = array(“Computer”,“Laptop”,“Mobile”);

OUTPUT:
array(3) {[0]=> string(5) “Computer” [1]=>
string(3) “Laptop “ [2]=> string(6)” Mobile”}
Var_dump:
The var_dump( ) function is used to dump information about a variable. This function displays structured information such as type and value of the given variable. Arrays and objects are explored recursively with values indented to show structure.

6. Object:
PHP object is a data type which contains information about data and function inside-the class.
<?php
class School {
function marks( ) {
$this->sec = “A”;
}
}
// create an object
$schoolobj = new School ( );
?>
OUTPUT
NULL

7. NULL:
Null is a special data type which contains a single,value: NULL
<?php $x = null;
?>
OUTPUT:
NULL

8. Resources:
Resource is a specific variable, it has a reference to an external resource. These variables hold specific handlers to handle files and database connections in respective PHP program.
<?php
// Open a file for reading
Shandle = fopen(“note.txt”, “r”);
var_dump($handle);
echo “<br>”;
// Connect to MySQL database server with
default setting
Slink = mysql_connect(“localhost”, “root”, “”);
var_dump($link);
?>

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 5.
Explain operators in PHP with examples?
Answer:
Operators in PHP:
The operator is a symbol which is used to perform mathematical and logical operations in programming languages. Different types of the operator in PHP are:

  1. Arithmetic operators
  2. Assignment operators
  3. Comparison operators
  4. Increment/Decrement operators
  5. Logical operators, and
  6. String operators.

1. Arithmetic operators:
The arithmetic operators in PHP perform general arithmetical operations, such as addition, subtraction, multiplication and division etc.
Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to H - 3

2. Assignment Operators:
Assignment operators are performed with numeric values to store a value to a variable. The default assignment operator is “=”. This operator sets the left side operant value of the expression to the right side variable.
Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to H - 4

3. Comparison Operators:
Comparison operators perform an action to compare two values. These values may contain integer or string data types (Numbers or Strings).
Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to H - 5

4. Increment and Decrement Operators:
Increment and decrement operators are used to perform the task of increasing or decreasing the variable’s value. This operator is mostly used during iterations in the program logics.
Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to H - 6

5. Logical Operators:
Logical Operators are used to combining conditional statements.
Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to H - 7

6. String Operators:
Two operators are used to perform string related operations such as Concatenation and Concatenation assignment (Appends).
Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to H - 8

Samacheer Kalvi 12th Computer Applications Solutions Introduction to Hypertext Pre-Processor Additional Questions and Answers

I. Choose The Best Answer

Question 1.
Tim Benner’s Lee developed
(i) Internet
(ii) www
(iii) Javascript
(iv) css
(a) only (i)
(b) (i) and (ii)
(c) (i), (ii), (iii)
(d) (ii), (iii), (iv)
Answer:
(b) (i) and (ii)

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 2.
The assignment activity implemented using …………….. operator.
a) +
b) –
c) *
d) =
Answer:
d) =

Question 3.
Which one of the following is a fundamental part of any dynamic web page?
(a) HTML
(b) PHP
(c) CSS
(d) JS
Answer:
(b) PHP

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 4.
PHP was invented by
(a) Rasmus Lerdorf
(b) Tim Berner’s Lee
(c) Bob Frankston
(d) Don Bricklin
Answer:
(a) Rasmus Lerdorf

Question 5.
PHP was invented by ………….
a) RasmusLerdorf
b) Dennis Ritchie
c) Bjarne Strousrup
d) James Goasling
Answer:
a) Rasmus Lerdorf

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 6.
Pick the odd one out.
PHP, CSS, ASP, JSP
Answer:
CSS

Question 7.
ASP stands for
(a) All server pages
(b) All script pages
(c) Active server pages
(d) Active script pages
Answer:
(c) Active server pages

Question 8.
Which of the following are the important server-side Web and general-purpose scripting languages?
a) HTML
b) CSS
c) Javascript
d) PHP
Answer:
d) PHP

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 9.
ASP is developed by
(a) Apache
(b) Apple
(c) Microsoft
(d) Macromedia
Answer:
(c) Microsoft

Question 10.
In which year PHP was developed?
(a) 1991
(b) 1992
(c) 1993
(d) 1994
Answer:
(d) 1994

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 11.
Find the Incorrect statement:
(I) 78.9% of websites are developed by PHP Scripting Language.
(II) 2.2% of websites developed with Python.
Answer:
(II) 2.2% of websites developed with Python.

Question 12.
Which of the following is an identical operator?
a) =
b) = =
c) = = =
d) ! = =
Answer:
c) = = =

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 13.
IIS is
(a) Interrupt Interface Service
(b) Intra Interface Service
(c) Intra Interface Service
(d) Internet Intranet Service
Answer:
(b) Intra Interface Service

Question 14.
PHP, 7.3 is released on
(a) Dec 30 2017
(b) Nov 30 2017
(c) Oct 30 2017
(d) Jan 30 2018
Answer:
(b) Nov 30’ 2017

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 15.
PHP, …………… is released by the official team on 30 November 2017.
a) 7.1
b) 7.2
c) 7.3
d) All of the above
Answer:
c) 7.3

Question 16.
The ……………………… is a high-performance hardware machine it could run more than one application concurrently.
Answer:
Server

Question 17.
The ……………………… is a separate hardware machine which is connected with a server in the networks.
Answer:
Client

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 18.
Match the following
1. Webservers – (a) ASP
2. Server Scripting Language – (b) Server
3. Service provider – (c) Microsoft IIS
4. Service requester – (d) Client
(a) 1 -(c) 2-(a) 3-(b) 4-(d)
(b) 1-(a)2 (b) 3-(c) 4-(d)
(c) 1-(d)2-(c)3-(b)4-(a)
(d) 1-(d) 2-(a) 2-(b) 4-(c)
Answer:
(a) 1 -(c) 2-(a) 3-(b) 4-(d)

Question 19.
We can use …………to comment multiple lines?
a) /?
b) //
c) #
d ) /**/
Answer:
d ) /**/

Question 20.
The ……………………… architecture is used for the server, accessed by the client as two-layer interactions.
Answer:
two-tier

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 21.
Statement I: Multi/Three-tier Architecture is used for the server, accessed by the client through more than one layer of Interaction.
Statement 2: The programmer could decide the count of business logic layers according to the software requirement.
(a) I – True, II – False
(b) I – False, II – True
(c) I, II – Both True
(d) I, II – Both False
Answer:
(c) I, II – Both True

Question 22.
……………………… is a software which is running in server hardware.
Answer:
webserver

Question 23.
Which takes the responsibilities for compilation and execution of server-side scripting languages?
(a) Client
(b) HTML
(c) JS
(d) Web Server
Answer:
(d) Web Server

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 24.
How many clarifications of web scripting languages are there?
(a) 1
(b) 2
(c) 3
(d) 4
Answer:
(b) 2

Question 25.
OOP’S stands for ……………………………
Answer:
object-oriented programming

Question 26.
How many percentages of websites are running under the open-source web servers?
(a) 100%
(b) 70%
(c) 120%
(d) 130%
Answer:
(d) 130%

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 27.
What is the default port number taken by the software after installation?
(a) 100
(b) 110
(c) 120
(d) 130
Answer:
(d) 130

Question 28.
Name the configuration setting file which is used to run PHP scripting language?
(a) httpk.conf
(b) httpd.conf
(c) httpp.conf
(d) httpdd.conf
Answer:
(b) httpd.conf

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 29.
Under which directory httpd.conf file is located?
(a) configure
(b) config
(c) configuration
(d) conf
Answer:
(d) conf

Question 30.
How many types of PHP syntax are available?
(a) 1
(b) 2
(c) 3
(d) A
Answer:
(c) 3

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 31.
Pick the odd one out
Default syntax, Shortcut Tags, Short Open Tags, HTML Script embed Tags
Answer:
Shortcut Tags

Question 32.
For short open tags, the admin has to enable settings in the………………………… file?
(a) init
(b) php
(c) initialise
(d) php.ini
Answer:
(d) php.ini

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 33.
The short open tags begin with ………………………….. and close with ……………………………
Answer:
<? and ?>

Question 34.
Find the correct statement.
1) The embedded PHP file gets executed by the web client.
2) The embedded PHP file gets executed in the webserver.
Answer:
2) The embedded PHP file gets executed in the webserver.

Question 35.
………………………….. are the storage locations which can store the values for the later manipulations in the program.
(a) typecast
(b) variables
(c) operand
(d) include
Answer:
(b) variables

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 36.
The variable in PHP begins with a …………………….. symbol.
(a) $
(b) #
(c) II
(d) =
Answer:
(a) $

Question 37.
The statements in PHP ends with
(a) $
(b) =
(c) ;
(d) :
Answer:
(c) ;

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 38.
Which one of the following statements is correct related to a variable?
(a) datatype is required
(b) the datatype is not required
Answer:
(b) the datatype is not required

Question 39.
Which is false?
(a) a variable name can start with number
(b) a variable name can never start with a number
Answer:
(a) a variable name can start with number

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 40.
How many primitive data types are there in PHP scripting language?
(a) 10
(b) 11
(c) 12
(d) 13
Answer:

Question 41.
Identify the Incorrect statements
Case (I): variables are used to classify the data according to the logics Case
Case (II): Data types are used to classify the data according to the logics
Answer:
Case (I): variables are used to classify the data according to the logics Case

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 42.
Pick the odd one.
UNIQUE NULL OBJECT ARRAY
Answer:
UNIQUE

Question 43.
………………………. is a collection of characters within the double quotes or single quotes.
Answer:
String

Question 44.
Space is considered as a character.
(a) True
(b) False
Answer:
(a) True

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 45.
How many possible values does the Boolean data type have?
(a) 2
(b) 3
(c) 4
(d) 5
Answer:
(a) 2

Question 46.
Which datatype contains non-decimal numbers?
(a) Integer
(b) Float
(c) Boolean
(d) Octal
Answer:
(a) Integer

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 47.
Which function gives information about the given variable?
Ans
(a) var( )
(b) variable( )
(c) var-dump( )
(d) vardump( )
Answer:
(c) var-dump( )

Question 48.
………………………… is a data type which contains information about data and function inside the class.
Answer:
object

Question 49.
What is the keyword used to create a class?
(a) class
(b) classes
(c) class name
(d) class tag
Answer:
(a) class

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 50.
………………………… variables hold specific handlers to handle files and database connections
Answer:
Resource

Question 51.
………………………. is a symbol which is used to perform mathematical and logical operations.
Answer:
Operator

Question 52.
How many types of operators are there in PHP?
(a) 3
(b) 4
(c) 5
(d) 6
Answer:
(d) 6

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 53.
Pick the odd one out.
(a) && || ! !=
(b) == == !=
Answer:
(a) != (b)=

Question 54.
Which one of the following is the modulus operator?
(a) +
(b) %
(c) ||
(d) !
Answer:
(b) %

Question 55.
Which is the default assignment operator?
(a) =
(b) ==
(c) ===
(d) ====
Answer:
(a) =

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 56.
Pick the odd one out.
(a) +=
(b) *=
(c) >=
(d) %=
Answer:
(c) >=

Question 57.
Assignment operator set the …………………….. side operant value of the expression to ……………………… side variable.
Answer:
left and right

Question 58.
Which operators compare two values?
(a) Arithmetic
(b) Increment
(c) Comparision
(d) Logical
Answer:
(c) Comparision

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 59.
Match the following
1. And – (i) &&
2. Or – (ii) ||
3. Not – (iii) !
4. Not equal – (iv) image
(a) 1-(i) 2-(ii) 3-(iii) 4-(iv)
(b) 1-(iv) 2-(iii) 3 -(ii) 4-(iii)
Answer:
(a) 1-(i) 2-(ii) 3-(iii) 4-(iv)

Question 60.
Identify the wrongly matched pair.
(a) Equal – ==
(b) Not Equal – ! =
(c) Not Identical – <>
(d) Identical – ===
Answer:
(c) Not Identical – <>

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 61.
Which operator is mostly used during iteration in the program logic.
(a) Increment
(b) Decrement
(c) both a & b
(d) none of these
Answer:
(c) both a & b

Question 62.
!$x is an example of …………………………… operator.
(a) And
(b) Or
(c) Not
(d) Xor
Answer:
(c) Not

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 63.
Which operator combines conditional statements.
(a) Comparision
(b) Relational
(c) Resource
(d) Logical
Answer:
(d) Logical

Question 64.
The string concatenation operator is ………………………….
(a) +
(b) .
(c) -=
(d) – =
Answer:
(b) .

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 65.
…………………………. Concatenation assignment operator.
Answer:
.. =

Question 66.
Concatenation assignment operator comes under
(a) Assignment
(b) String
(c) Character
(d) Logical
Answer:
(b) String

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 67.
Which operator appends are text to the another?
(а) Character
(b) Assignment
(c) Strings
(d) Logical
Answer:
(c) Strings

Question 68.
Find the statement which is wrong?
(a) PHP is a security program language
(b) PHP is a Flexibility program language
(c) PHP is a platform-dependent program language
(d) PHP is a Real-Time Access Monitoring programming language
Answer:
(c) PHP is a platform-dependent program language

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 69.
URL Stands for ………………………….
Answer:
Uniform Resource Locator

Question 70.
HTTP means ……………………….
Answer:
HyperText Transfer Protocol

II. Short Answers

Question 1.
What is the purpose of the Var__dump() function?
Answer:

  • The var_dump() function is used to dump ‘ information about a variable.
  • This function displays structured information such as the type and value of the given variable.

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 2.
Name the three types of syntax available in PHP?
Ans
Three types of PHP Syntax are available. They are as follows:

  1. Default Syntax
  2. Short open Tags
  3. HTML Script embed Tags.

III. Explain in Brief Answer

Question 1.
Write the types of PHP Syntax.
Answer:
Three types of PHP Syntax are available.
They are as follows:

  • Default Syntax
  • Short open Tags
  • HTML Script embed Tags

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 2.
Draw a diagram for the client-server architecture model?
Answer:
Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to H - 9

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 3.
Explain short open tags?
Answer:
Short open Tags:
The Short open Tags begins with “<?” and closes with But admin user has to enable Short style tags settings in the php.ini file on the server.
Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to H - 10

Question 4.
What is the main advantage of PHP variable declaration?
Answer:
The main advantage of the PHP variable declaration is, it does not require to specify the | data type keyword separately such as int, chap float, double or string, etc.

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 5.
Explain resources with examples?
Answer:
Resources
Resource is a specific variable, it has a reference to an external resource. These variables hold specific handlers to handle files and database connections in respective PHP program.
<?php
// Open a file for reading
Shandle = fopen(“note.txt”, “r”);
var_dump($handle);
echo “<br>”;
// Connect to MySQL database server with
default setting
Slink = mysql_connect(“localhost”, “root”, “”);
var_dump(Slink);
?>

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 6.
Write a note on different types of Increment and decrement operators with an example?
Answer:
Increment and Decrement Operators:
Increment and decrement operators are used to perform the task of increasing or decreasing the variable’s value. This operator is mostly used during iterations in the program logic.
Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to H - 11

IV. Explain in detail.

Question 1.
Explain different client-server Architecture models?
Answer:
Client-Server Architecture:
Model Client-server architecture is classified into three types, as follows:

  1. Single Tier Architecture
  2. Two-Tier Architecture
  3. N/Multi/Three tire architecture

1. Single Tier Architecture:
This architecture is used for the server, accessed by the client. The client application runs inside the server machine itself. This acts as a single layer interaction as shown in Figure.
Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to H - 12

2. Two-Tier Architecture:
This architecture is used for the server, accessed by the client as two-layer interactions. Such as the Client layer in tire one and server layer in tire Two.
Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to H - 13

3. Multi/Three Tier Architecture:
This architecture is used for the server, accessed by the client through more than one layer of interaction. The programmer could decide the count of business logic layers according to the software requirement that is the reason this model is also known as Multi Three Tire Architecture.
Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to H - 14
Most of the server-side scripting languages are working on anyone the client-server architecture model. The webserver is software which is running in server hardware. It takes the responsibilities for the compilation and execution of server-side scripting languages.

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 2.
Explain different types of PHP syntax?
Answer:
Three types of PHP Syntax are available. They are as follows

  1. Default Syntax
  2. Short open Tags
  3. HTML Script embed Tags

1. Default Syntax:
The default Syntax begins with “<?php” and closes with “?>”.
Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to H - 15

2. Short open Tags:
The Short open Tags begins with “<?” and closes with “?>”. But admin user has to enable Short style tags settings in the php.ini file on the server.
Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to H - 16

3. HTML Script embed Tags:
HTML Script embed Tags look just like HTML script tags. The syntax is shown in Figure.
Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to H - 17
The above syntax is created and saved in a file with an extension of .php. This .php file is ready to execute from Webserver and generate a response to the client machine.

Samacheer Kalvi 12th Computer Applications Solutions Chapter 4 Introduction to Hypertext Pre-Processor

Question 3.
Write the Characteristics of PHP.
Answer:

  • Open Source
  • Case Sensitive
  • Simplicity Program language
  • Efficiency Program language
  • Platform Independent Program language
  • Security Program language
  • Flexibility Program language
  • Real-Time Access Monitoring Program language