12_SCIENCE_ALL_CHP_NOTES

Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

RAHUL INTERNATIONAL JUNIOR COLLEGE

12th Standard Science Information Technology Notes

Chapter 1 Advanced Web Designing (IT HSC)

Q 1. Fill in the blanks.

1. The………………element is a staring element in an HTML, it indicates that document type definition being used
by the document.

Answer : <!DOCType>

2 .The……………. is a tag in html that describe some aspects of contents of a webpage.

Answer : Meta Tag

3. The <ol> tag defines an………………

Answer : Ordered List

4. An unordered list created using the.................tag

Answer : <ul>

5. The....................... element creates an inline frame.

Answer : <iframe>

6. ......................tag is used to specify video on an HTML document.

Answer: <video>

7. If a web developer wants to add the description to an image he must use ……… attribute of <img>
tag.

Answer : alt

8. The……………… property is used to set position for an element

Answer : Position

9. The float property defines the ...............of content.

Answer : Flow

10. ………………is used with elements that overlap with each other.
Answer : Absolute position

Q2. State whether the following statement is True or False

1) HTML is an Object Oriented Programming Language

Answer : FALSE

2) Charset is used for character encoding declaration.

Answer : TRUE

3) An unordered list can be numerical or alphabetical

Answer : FALSE

4) Multilevel list can be created in HTML 5.

Answer : TRUE

5) Srccode specifies the HTML content of the page to show in the <iframe>

Answer : TRUE

6) The ‘controls’ attribute is not used to add play, pause, and volume.

Answer : FALSE

7) cs is the extension of CSS file

Answer : FALSE

Q3. Choose Single correct answer from the given options.

1) ………………….element used to create a linking image

Option :

a) <img> b) <td>

c) <map> d) <usemap>

Answer : d) <usemap>

2) The ……………tag is used to embed audio files on Webpages.

Option :

a) <sound> b) <audio>
c) <video> d) <embeded>

Answer : b) <audio>

3) A programmer wants to define range for age between 18 to 50, he will use a form with following
appropriate control.

Option :

a) number b) compare

c) range d) Textboxes

Answer : c) range

4) ......……….character is used to create id in CSS.

Option :

a) % b) $

c) @ d) #

Answer : d) #

Q4. Choose Two correct answers from the given options.

1) List within another list either………list or………list is called nested list.

Option :

a) multilevel b) order

c) unordered d) general

e) cascading

Answer : b) order, c) unordered

2) Image maps are of two types ……...........and …………..........

Option :

a) Network side b) Client Side

c) Computer Side d) Server Side


e) n-computing

Answer : b) Client Side, d) Server Side

3) A CSS rule set contains……….. and……………………...............

Option :

a) Set b) Selector

c) post d) Declaration

e) block

Answer : b) Selector, d) Declaration

4) Client-side image map can be created using two elements …………… and………...

Option :

a) <area> b) <image>

c) <usemap> d) <map>

e) <server>

Answer : a) <area>, d) <map>

Q5. Choose Three correct answers from the given options

1) Attributes of <area> tag is……………………..

Option :

a) href b) src

c) coords d) data

e) alt f) usemap

Answer : a) href , c) coords , e) alt

2) Attributes used with iframe are………………..

Option :

a) srcdoc b) name
c) att d) src

e) href f) loop

Answer : a) srcdoc ,b) name, f) loop

3) Following are the Form controls……………

Option :

a) email b) search

c) label d) video

e) tel f) audio

Answer : a) email ,b) search, f) tel

4) Attributes used with <audio> tag…………………………..

Option :

a) autoplay b) href

c) controls d) cntrl

e) loop f) bgsound

Answer : a) autoplay ,c) controls , e) loop

5) CSS types are ………...... and…………………

Option :

a) internal b) external

c) control d) inline

e) loop f) style

Answer : a) internal , b) external, d) inline

6) Positioning types in CSS are……………………

Option :

a) Static b) fixed
c) absolute d)position

e) dynamic f) nested

Answer : a) Static , b) fixed, c) absolute

7) Types of floating properties are………,…………, …………..

Option :

a) left b) zero

c) right d) all

e) none f) dock

Answer : a) left , b) zero, c) right

Q. 6. Match the pair


Answer: -

<ul> ======> bulleted list

usemap ======> Client side image map

color ======> CSS Property

<img> ======> inserts an image

<Input type =image> ======> Image as a submit button

Q7. Question 7 is practical question,

Write a program using html with following CSS specification-

1. The background colour of the company name should be in green.


2. The text colour of the company name should be red.
3. The heading should be large –with font ''comic sans ms''
4. The description of the company should be displayed in blue color in a paragraph.

Answer:-
Note: In this question, They had not mentioned that which css use. Like internal css, inline css or external css. So here we can use any of them. Then inline css is most easy
type of css. Here we will create this program using Inline CSS.

Program :

<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<h1 style="font-family: comic sans ms;">This is large Heading with font "comic sans ms"</h1>
<p style="background-color: green; color: red">Company Name : XYZ Corporate Comoany</p>
<p style="color: blue " >Description : Write any description you want here</p>
</body>
</html>

Output:

(Q2)

Write Html5 code with CSS as follows-

1. To create form to accept name,age, email address, from the user.


2. Create a submit button to send the data.
3. The heading of the form should have a background colour and a different font style.

Answer:-
Program :

<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>

<h1 style="background-color: red; font-family: cursive;">Form Heading</h1>


<form>
name : <input type="text" name="name"><br><br>
email : <input type="text" name="email"><br><br>
Age :
<input type="radio" name="male" value="m">Male
<input type="radio" name="female" value="f">Female<br><br>
<input type="submit" name="submit" value="submit">

</form>
</body>
</html>

(Q3)

Write Html5 code with CSS as follows-

1. Create ordered list with names of tourist Cities


2. Create unordered list with tourist places of those cities
3. Divide the list into two sections left and right by using CSS.

Answer:-
Program

<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
/* Pen-specific styles */
*{
box-sizing: border-box;
}

/* Pattern styles */
div {
display: inline-block;
vertical-align: top;
width: 50%;
padding: 1rem;
}

.left-half {
background: #ff9e2c;
}

.right-half {
background: #b6701e;
}
</style>

</head>
<body>

<div class="left-half">
<p>tourist Cities</p>
<ol>
<li>Mumbai</li>
<li>Delhi</li>
<li>Gujrat</li>
<li>Punjab</li>
</ol>
</div>

<div class="right-half">
<p>tourist Cities</p>
<ol>
<li>Mumbai</li>
<li>Delhi</li>
<li>Gujrat</li>
<li>Punjab</li>
</ol>

</div>

</body>
</html>

(Q4)

What are the uses of <P>, <B>, <br> and <mark> tags?
Answer:-
(1) <P> Tag :
Meaning : The <p> tag defines a paragraph. It is a block-level element and always starts on a new
line. The <p> tag comes in pairs which is opening and closing tag.

Syntax : <p>...... content (Elements).......</p>

Example :

<!DOCTYPE html>

<html>

<head>
<title>Title of the document</title>

</head>

<body>

<p>This is a paragraph</p>

</body>

</html>

(2) <B> Tag :


Meaning : The <b> tag specifies bold text without any extra importance.

Syntax : <b>...... content (Elements).......</b>

Example :

<!DOCTYPE html>
<html>
<body>

<h1>The b element</h1>

<p>This is normal text - <b>and this is bold text</b>.</p>

</body>
</html>

(3) <B> Tag :


Meaning : <br> tag is used to break line. The <br> tag inserts a single line break. The <br> tag is an empty
tag which means that it has no end tag.

Syntax : <br> (Only have opening tag)

Example :

<!DOCTYPE html>
<html>
<body>

<h1>The br element</h1>

<p>To force<br> line breaks<br> in a text,<br> use the br<br> element.</p>

</body>
</html>
(4) <Mark> Tag :
Meaning : The <mark> tag defines marked text. <mark> tag is used to highlight the specific word or
sentence.

Syntax : <mark>...... content (Elements).......</mark>

Example :

<!DOCTYPE html>
<html>
<body>

<h1>The mark element</h1>

<p>Do not forget to buy <mark>milk</mark> today.</p>

</body>
</html>

CHAPTER 2: SEO

Q 1. Fill in the blanks.


The full form of SEO is..............................
Answer : Search Engine Optimization

2 .........................are links on one website that, when clicked, take the user to another site.

Answer : Backlinks

3. One of the optimization factor to improve images is by using..................... attribute.

Answer : Alt

4. An.................................helps to find out what you can be done to improve ranking on search
engines, so that consumers can find the website with greater ease.

Answer : SEO Audit

5. The...........................files tells search engine which pages you want to exclude from indexing.

Answer :Robots.txt

Q. 2. Match the pair


Column A Column B

1. Image Optimization a) meta tag

2. Links to Twitter, Facebook b) SEO technique

3. Description about author c) alt attribute

4. White Hat Strategy d) Social Media Optimization


Answer: -
Column A Column B

1. Image Optimization c) alt attribute

2. Links to Twitter, Facebook d) Social Media Optimization

3. Description about author a) meta tag

4. White Hat Strategy b) SEO technique

Q3. correct Answers from the following. (2 correct)


1) The page content optimization can be done by using keywords in

Option :

a)<font> b) <title>

c) <hr> d> <meta>

e) <input>

Answer : b) <title>, d) <meta>

2) Other factors to rank the website higher are

Option :

a) Desktop friendly

b) Speed of the website

c) Creating robots. txt

d) No backlinks

e) No external links

Answer : b) Speed of the website, c) Creating robots. txt

Answer briefly.
(1) Define SEO and State types of SEO.

Answer :

1. SEO stands for Search Engine Optimization, which is the practice of increasing the quantity and quality of
traffic to your website through organic search engine results.
2. Thus SEO is useful in increasing the number of visitors to a website.
3. There are many strategies and techniques adopted to optimize the webpage.

There are two types of SEO -

1. On-Page SEO: This includes the provision of good content, good keyword selection, putting keywords on
correct places, giving appropriate title to every page, etc.
On-Page SEO is concerned with information that is displayed to the end-user, such as text, images, and
website navigation.
2. Off-Page SEO: It includes link building, increasing link popularity by submitting open directories, search
engines, link exchange, etc.
Off-Page SEO is concerned with Website-Website relationship.

(2) Which are the different SEO techniques?

Answer :

1. SEO techniques are classified into two broad categories, which are White Hat SEO and Black Hat SEO.
2. White Hat SEO: Techniques that search engines suggest as a part of good design are called White Hat SEO.
3. It contains proper and well-labeled images according to the content.
4. It is in the form of a Standard-compliant HTML.
5. Black Hat SEO: Techniques that search engines do not approve of and those techniques which are used for
optimizing the website are called Black Hat SEO.
6. It mainly contains duplicate contents. Such websites are mainly used to redirect users to other websites and
cause traffic.

(3) Explain in short White Hat technique.

Answer :

1. Techniques that search engines suggest as a part of good design are called White Hat SEO.
2. It contains proper and well-labeled images according to the content.
3. It is in the form of Standard-compliant HTML.
4. The page titles are unique but relevant at the same time.
5. It has Complete sentences with good spelling and grammar.

(4) Explain in short Black Hat technique.

Answer :

1. Techniques that search engines do not approve and those techniques which are used for optimizing the
website are called Black Hat SEO.
2. It mainly contains duplicate contents which mostly are stolen from other original creators mainly without
any credits and permissions.
3. Such websites are mainly used to redirect users to other websites and cause traffic.
4. Links from such sites are irrelevant and don't show the actual search content. Websites like these contain
invisible text and stuffed keywords.

(5) Explain in short SEO Keyword search.

Answer :

1. SEO keywords are the important words and phrases related to the developed website content.
2. A list of keywords needs to be carefully chosen to optimize the search. Keyword Research and Analysis is an
important part of the Search Engine Optimization (SEO) as well as "Search Engine Marketing".
3. For "Search Engine Marketing", one can pay for certain keywords.
4. There are various online Keyword Planner tools (such as Google Add Words Keyword Planner) to shortlist
keywords.
5. This is more useful to compare the cost of various keywords if the website designer opts for Paid Search
Engine Marketing.

(6) Explain any two Page content optimization points.


Answer :

1. <TITLE> - Title is the first thing that user notices in the search result list while using Google for searching.
Contents should be up to 60 characters (spaces included)
2. Meta-description Tag - While creating a web page, Meta description should be used to boost your On-Page
SEO. Meta Description should be between 70 and 160 characters (spaces included) that others are
interested to know about the contents form your website.

(7) Explain how could you optimize images.

Answer :

1. Image Tags with ALT attribute: The alt attribute gives information about the image, so even if the image
does not download, it can make the viewers understand the image-related information.
2. Image Tag with Title attribute: The title tag of images shows the keyword of the image when the mouse has
hovered above the image.
3. Image compression: The images which are compressed load faster which give the user good friendly
experience.
4. Images can have Caption keywords: Certain images can have keywords on the image to make it relevant for
users to know about it.

Chapter 3: ADVANCED JAVASCRIPT

Fill in the blanks.


(1) __________ script resides on server computer.

Answer : Server-Side

(2) __________ statement is used to jump out of loop.

Answer : Break

(3) ____________ defines logical structure of document.

Answer : DOM (Document Object Model)

(4) ___________ property of window object returns Boolean value indicating whether window is
closed or not.

Answer : Closed

(5) ____________ event occurs when an element losses its focus.

Answer : onblur

State whether given statement is true or false.


(1) JavaScript is case sensitive language.

• True
• False

Answer : True
(2) Math.ceil() function is used to return the nearest integer less than or equal to given number.

• True
• False

Answer : False

(3) MAX_VALUE property of number object returns smallest possible value.

• True
• False

Answer : False

(4) getDay() method of Date object returns month in number.

OPTIONS

• True
• False

Answer : False

(5) onKeydown event occurs when user moves mouse pointer.

• True
• False

Answer : False

Multiple choice questions. Select one correct answer.


(1) JavaScript is ___________ language.

• Compiled
• Interpreted
• Both Compiled and Interpreted
• None of the above

Answer : Both Compiled and Interpreted

(2) Select correct method name of String object ________

• charAt()
• characterAt()
• valueAt()
• lengthAt()

Answer : charAt()

(3) __________ method displays message box with Ok and Cancel button.
• Confirm()
• Alert()
• both Confirm() and Alert()
• None of these

Answer : Confirm()

(4) We can declare all types of variables using keyword ____________

• var
• dim
• variable
• declare

Answer : var

(5) Trace output of following JavaScript code.

var str="Information Technology"; document.write(str.lastlndexOf("o");

OPTIONS

• 18
• 19
• 20
• 21

Answer : 20

Multiple choice questions. Select two correct answer.


(1) Valid two methods of Date object are ___________ and ___________

a) setTime()

b) getValidTime()

c) getTime()

d) setValidTime()

Answe : setTime() and getTime()

(2) Properties of document object are __________ and ___________

a) URL

b) title

c) name

d) status

Answer : URL and title


(3) __________ and ________ are event/event handler used with text object in JavaScript.

a) onBlur

b) onMove

c) onFocus

d) onAction

Answer : onBlur and onFocus

Multiple choice questions. Select three correct answers.


(1) Select three correct methods of window object __________, __________ and ___________

a) write()

b) alert()

c) writeln()

d) close()

e) open()

f) charAt()

Answer : alert(), close() and open()

(2) JavaScript features are __________, _________ and ____________

a) supports event based facilities

b) is platform dependent language

c) case insensitive scripting language

d) provide inbuilt objects

e) can handle date and time effectively

f) requires special software to run

Answer : supports event based facilities, provide inbuilt objects and can handle date and time
effectively.

(3) Inbuilt objects in JavaScript are _______, ________ and ___________

a) Time

b) Date

c) Inheritance
d) Array

e) Number

f) function

Answer : Date, Array and Number

Explain the following.


(1) What are the similarities and differences between Client-side Scripting and Server-side
Scripting?

Answer :

Client-side Scripting:

1. It is used at the frontend which users can see from the browser.
2. Client-side scripting does not need any server interaction.
3. Client-Side scripting language involves languages such as HTML5, JavaScript, etc.
4. Client-side scripting is used for validation purposes.

Server-side Scripting:

1. It is used at the backend, where the source code is not visible or hidden in the client browser.
2. When a server-side script is processed it communicates to the server.
3. Server-side scripting language involves languages such as PHP, ASP.NET, Python, etc.
4. Server-side scripting is useful in customizing the web pages and implements dynamic changes in
the website.

(2) Briefly explain features of JavaScript.

Answer :

• JavaScript is light weight scripting language.


• No need of special software to run JavaScript Programs
• JavaScript is the object-oriented scripting language
• It can handle date and time very effectively.
• It is a case-sensitive language.

(3) Explain switch case conditional statement in JavaScript with example.

Answer :

JavaScript has a decision control statement known as switch. The switch statement test the value
of given expression against the list of case values and when the match is found a block of
statement associated with that case is executed.

Syntax of switch case is:

switch(expression)
{
case x:
//code block
break;
case y:
//code block
break;
default:
//code block
}
Write event driven JavaScript program for the following.
(1) Write event driven JavaScript program for the following.

Display Addition, subtraction, multiplication, division and remainder of two numbers, which were
accepted from user.

Answer :

<html>
<script type="text/javascript">
var a,b,res;
a=parselnt(prompt("Enter First Number"));
b=parselnt(prompt("Enter Second Number"));
res=a+b;
document.write("<br><br>Addition is"+res);
res=a-b;
document.write("<br><br>Substraction is"+res);
res=a*b;
document.write("<br><br>Multiplication is"+res);
res=a/b;
document.write("<br><br>Division is"+res);
</script>
</html>
(2) Write event driven JavaScript program for the following.

Display number sequence from 100 to 150 in following format.

(100, 101, 102, ............., 150)

Coding:

<html>
<script type="text/javascript">
var i;
document.write("<br>Numbers from 100-150 are <br>");
for(i=100;i<=150;i++)
{
document.write("\t"+i);
}
</script>
</html>
(3) Write event driven JavaScript program for the following.

Find and display factorial of given number.

Answer :

Coding:

<html>
<script type="text/javascript">
var n=4,i,f=1;
for(i=n;i>= 1;i--)
{
f=f*i;
}
document.write("<br>Factorial of 4 is"+f);
</script>
</html>
(4) Write event driven JavaScript program for the following.

Accept any string from user and count and display number of vowels occurs in it.

Answer :

Coding:

<html>
<script type="text/javascript">
var n,i,ch,cnt=0;
n=prompt("Enter a String");
for(i=0;i<n.length;i++)
{
ch=n.charAt(i);
if(ch=='a' | | ch==' A' | | ch=='e' | | ch='E' | | ch='i' | | ch=='i' | |
ch=='o' | | ch=='O' | | ch=='u' | | ch=='U')
{
cnt=cnt+1;
}
}
document.write("Number of vowels in string are"+cnt);
</script>
</html>

Match the following.


(1) Match the following.

Column A Column B

ceil() Writes HTML expression or JavaScript code to a document

floor() Sets focus to current window.

write() Removes white spaces from both sides of string.

focus() Returns next integer greater than or equal to given number.

trim() Returns the next integer less than or equal to given number.

Answer :

Column A Column B

ceil() Returns next integer greater than or equal to given number.

floor() Returns the next integer less than or equal to given number.

write() Writes HTML expression or JavaScript code to a document


focus() Sets focus to current window.

trim() Removes white spaces from both sides of string.

CHAPTER 4: EMERGING TECHNOLOGIES


Fill in the blanks.

(1) IOT is Referred as __________

Answer : Internet of Things

(2) Smart Home is the application of _______ Technology.

Answer : IoT

(3) Amazon is the ____________ service provider.

Answer : SaaS

Match the pair.


(1)

Column 'A' Column 'B'

1) Smart city a) Software as a Service

2) Amazon web server b) Platform as a Service

3) PaaS c) Cloud computing

4) SaaS d) IOT

Answer :

Column 'A' Column 'B'

1) Smart city d) IOT

2) Amazon web server c) Cloud computing

3) PaaS b) Platform as a Service

4) SaaS a) Software as a Service

State whether given statement is true or false.


(1) PaaS provides a platform with tools to test, develop and host applications in the same
environment.

• True
• False

Answer : True

(2) Cloud computing means to store and access data and programs over the internet.
• True
• False

Answer : True

Explain the followings.


(1) Give some applications of lOT.

Answer :

Following are some applications of lOT:

1. Smart thermostats - Allows users to schedule, monitor and remotely control home temperatures.
2. Smart lighting - The illumination of light is controlled on the basis of day light.
3. Smart locks and garage door openers, Password-based or facial recognition-based doors and locks.
4. Smart security cameras - Security cameras that can identify known and unknown persons and raise
alarm, in case of security threat.
5. Smart traffic signals - Signal that can adjust their commutes and holiday traffic and keep cars
moving.

(2) Explain in detail about cloud computing.

Answer :

1. Cloud computing is the on-demand availability of computer system without direct active
management by the user.
2. There are three primary service models of cloud computing that are Infrastructure as a Service
(IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS).
3. Infrastructure as a Service (laaS): IaaS provides automated and scalable environments that provide
a high degree of control and flexibility for the user.
4. Platform as a Service (PaaS): A service provider offers access to a cloud-based environment in
which users can develop, manage and deliver applications.
5. Software as a Service (SaaS): A service provider delivers software and applications through the
internet or an API.
6. There are three basic types of deployment of cloud computing that are Public, Private and Hybrid.
7. In public cloud, all the services and supporting infrastructure are managed off-site over the internet
and shared across multiple users.
8. Private cloud provides l.T services through the internet or a private network to selected users rather
than to general public.
9. Hybrid cloud environments combine both Public and Private cloud elements.

(3) Explain models of cloud computing.

Answer :

• Cloud Computing is the on-demand availability of computer system without direct active
management by the user.
• There are three primary service models of cloud computing that are Infrastructure as a Service
(IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS).
• Infrastructure as a Service (laaS):
(i) IaaS provides automated and scalable environments that provide a high degree of control and
flexibility for the user.
(ii) Instead of purchasing hardware, users pay for IaaS on demand.
(iii) Examples: Amazon web services (AWS), Microsoft Azure VM, Google Compute Engine (GCE)
• Platform as a Service (PaaS):
(i) A service provider offers access to a cloud-based environment in which users can develop,
manage and deliver applications.
(ii) PaaS provides a platform with tools to test, develop and host applications in the same
environment.
(iii) Examples: Google App Engine
• Software as a Service (SaaS):
(i) A service provider delivers software and applications through the internet or an API.
(ii) Applications are accessible from almost any internet-connected device, from virtually anywhere
in the world.
(iii) Examples: Google's G suite, GitHub, Dropbox.

(4) Give brief idea about Al.

Answer :

• Artificial Intelligence is the study of making intelligent machines that can perform operations like a
human being.
• AI is different from robotics but related to some extent, in which machines sense their environment,
perform calculations and do physical tasks either by themselves.

Different fields of AI are as follows:

1. Machine learning is the study of computer algorithms that improve automatically through
experience.
2. Neural networks imitate the brain's array of interconnected neurons, and relay information between
various units to find connections and derive meaning from data.
3. Deep learning utilizes really big neural networks and a lot of computing power to find complex
patterns in data, for applications such as image and speech recognition.
4. Natural language processing involves analyzing and understanding human language and
responding to it.

(5) Explain the concept of 5G.

Answer :

1. 5G is the fifth generation of cellular network technology.


2. 5G is the next generation of wireless communications. It is expected to provide Internet
connections that are multiple times faster than 4G LTE (Long Term Evolution).
3. 5G technology may use a variety of spectrum bands, including millimeter wave (mmWave) radio
spectrum, which can carry very large amounts of data at a short distance.
4. The drawback of the higher frequencies is that they are more easily obstructed by the walls of
buildings, trees and other foliage, and even changes in the weather.
5. The new 5G networks will be able to transmit very large amounts of data but only a few blocks at a
time.
6. 5G networks are digital cellular networks, in which the service area covered by providers is divided
into small geographical areas called cells.
7. 5G can support up to a million devices per square kilometer, compared to 4G.

CHAPTER 5: PHP

Fill in the blanks.


(1) PHP is __________ side scripting language.

Answer : Server
(2) PHP is _________ language i.e. there is no need for compilation.

Answer : interpreted

(3) A variable starts with __________ sign followed by variable name.

Answer : $

(4) An _________ is a variable, which can hold more than one value at a time.

Answer : array

(5) Information can be passed to functions through ___________.

Answer : arguments

State True/False
(1) PHP is platform dependent scripting language.

• True
• False

Answer : False

(2) $_POST is an array of variables passed via the URL parameters.

• True
• False

Answer : False

(3) A Function is a block of statements that can be used repeatedly in a program.

• True
• False

Answer : True

(4) PHP cannot be embedded along with HTML tags.

• True
• False

Answer : False

(5) GET should NEVER be used for sending sensitive information.

• True
• False

Answer : True
Multiple Choice Question (1 correct)
(1) The program file of PHP have _________ extension.

• .asp
• .php
• .js
• .txt

Answer : .php

(2) A variable declared ___________ a function has global scope.

• outside
• anywhere
• inside
• none

Answer : outside

(3) The ____________ function returns a part of a string.

• trim()
• ucwords()
• substr()
• strpos()

Answer : substr()

Multiple Choice Question. (2 correct)


(1) The _________ and _________ are valid data types in PHP.

a) Double

b) Varchar

c) Integer

d) Array

e) Biglnt

Answer : Integer and Array

(2) Single line comment in PHP is possible using _______, __________.

a) //

b) /* */

c) #

d) <!-- -->
e) $

Answer : // and /* */.

Multiple Choice Question. (3 correct)


(1) ln PHP, three types of arrays are ________, _________, __________.

a) Indexed

b) Simple

c) Associative

d) Multidimensional

e) Complex

f) General

Answer : Indexed, Associative, Multidimensional.

(2) The scope of variable can be _______, _______, ______.

a) local

b) global

c) universal

d) static

e) final

f) outside

Answer : local, global, static.

Brief Questions.
(1) Explain any two features of PHP?

Answer :

PHP is the most popular and frequently used worldwide server-side scripting language.

Following are features of PHP:

1. Simple: It is very simple and easy to use, as compared to other scripting languages.
2. Interpreted: It is an interpreted language, i.e. there is no need for compilation.
3. Faster: It is faster than other scripting languages e.g. JSP and ASP.
4. Open Source: Open source means you need not pay for use of PHP. You can freely download and
use it.
5. Platform Independent: PHP code will be run on every platform, Linux, Unix, Mac OS X, Windows.

(2) What are the rules for declaring variables in PHP?


Answer :

Following are the rules for declaring variables in PHP:

1. A variable starts with the $ sign, followed by the name of the variable
2. A variable name must start with a letter or the underscore character
3. A variable name cannot start with a number
4. A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and_)
5. Variable names are case-sensitive ($age and $AGE are two different variables)

(3) What is server-side scripting?

Answer :

1. A server is a computer system that serves as a central control of data and programs shared by
clients.
2. The server-side environment that runs a scripting language is termed a web server.
3. A user's request is fulfilled by running a script directly on the web server.
4. It is used to provide interactive websites.
5. Programming languages for server-side programming are PHP, Python, JSP.

(4) List the supported data types in PHP.

Answer :

1. String: A string is a sequence of characters. A string can be any text inside quotes. You can use
single or double-quotes.
2. Integer: An integer data type is a non-decimal number between -2,147,483,648 and 2,147,483,647.
3. Float (floating point numbers): A float (floating-point number) is a number with a decimal point or a
number in exponential form.
4. Boolean: A Boolean represents two possible states. TRUE or FALSE.
5. Array: An array stores multiple values in one single variable.
6. NULL: Null is a special data type which can have only one value NULL. A variable of data type NULL
is a variable that has no value assigned to it.

(5) Explain any two string manipulation function.

Answer :

Function Description

strlen() Returns the length of a string (i.e. total no. of characters)

str_word_count() Counts the number of words in a string

strrev() Reverses a string

Searches for a specific text within a string and returns the character position of the first match and
strpos()
if no match is found, then it will return false

str_replace() Replaces some characters with some other characters in a string

Q7. Write Programs for the following.


(1) Write a PHP code which calculates square of any number using form.

Answer :
Coding:

<html>
<body>
<form method="post">
Enter a Number
<input type="text" name="sq"><br><br>
<input type="submit" name="submit" value="Sqaure">
</form>
</body>
</html>
<?php
if(isset($_POST['submit']))
{
$sq= $_POST['sq'];
$s=$sq*$sq;
echo "<br><br> The Square of number is: ".$s;
}
?>
(2) Write Programs for the following.

Answer :

Coding:

<?php
$a="Hypertext Preprocessor";
echo "<br><br> String is ".$a;
echo" <br><br> Words in String is ".str_word_count($a);
?>
(3) Write Programs for the following.

Answer :

Coding:

Form.html
<html>
<body>
<form action="wc.php" method="post">
Enter Name
<input type="text" name="name"><br><br>
Enter Password
<input type="password" name="pass"><br><br>
<input type="submit" name= "submit" value="Submit">
</form>
</body>
</html>
wc.php
<html>
<body>
Welcome
<?php
echo $_POST["name"]; ?> <br><br>
Your Password is
<?php
echo $_POST["pass"];
?>
: ItexamNotes.com

CHAPTER 6: E-COMMERCE AND E-GOVERNANCE


Q. 1 Fill in the blanks.

1. E-Commerce’s scope is ……………

Answer : Global

2. A customer can do shopping …………..online using type of E-Commerce.

Answer : B2C

3. The…………… phase consist of Order and Delivery.

Answer : execution

4. E-wallet is a type of ………… account in which a user can store his/her money for any future
online transaction.

Answer : prepaid

5. EDI is ………………………exchange of information.

Answer : electronic

6. The ……. type of e-governance refers to the government services which enable citizens to
get access to wide variety of public services.

Answer : G2C

7. The e-governance which provides safe and secure inter-relationship between domestic or
foreign government is ………..

Answer : G2G

Q. 2 True OR False.

1. C2C type of E-commerce deals with Business and Customer.

Answer : FALSE

2. The lack of a personal touch can be a disadvantage for many types of services and
products in E-commerce.

Answer : TRUE

3. Checking the balance of holiday is an example of G2C.

Answer : FALSE

4. E-commerce provides more options to compare and select the cheaper and better options.

Answer : TRUE

5. M-commerce can be used through desktop computer.


Answer : FALSE

Q.3 Multiple Choice Questions one Correct Answer.

1. Invoice and payment are included in ……………phase of trade cycle.

Answer : (C) Settlement

2. License renewal is an example of ………….. e-governance

Answer : (a) G2C

Q.4 Multiple Choice Question 2 correct Answer.


1. Encryption consist of two processes..................... and ……………...................

Answer : (a) encryption (d) decryption

2. Social commerce is a subset of electronic commerce that involves social media


like ........................ & ……………………..

Answer : (a) Facebook (b) Instagram

Q.5 Match the following


Match the following.

Column A Column B

1. M-commerce a) Coded form of data

2. Cipher Text b) B2B

3. EDI c) E-bill payment

4. Wholesaler-to-Retailer d) Paperless exchange of information

5. License renewal services e) G2G

6. Online facility to employees like leave f) G2C

7. Government agencies share same database g) G2E

Answer :

Column A Column B

1. M-commerce c) E-bill payment

2. Cipher Text a) Coded form of data

3. EDI d) Paperless exchange of information

4. Wholesaler-to-Retailer b) B2B

5. License renewal services f) G2C

6. Online facility to employees like leave g) G2E


7. Government agencies share same database e) G2G

Answer in brief.
(1) Explain phases of trade cycle.

Answer :

A trade cycle is the series of exchanges, between a customer and supplier that take place when a
commercial exchange is executed.

A general trade cycle consists of the following phases:

1. Pre-Sales: It consists of two steps like Search and Negotiates. Customer searches for a required
website for products to be purchased. In Negotiate step customer find a supplier who offers a good
quality product at a cheaper price and then the customer agrees to the terms forwarded by the
supplier.
2. Execution: This phase consists of Order and Delivery. Customer sends an order for the selected
product and after processing the order, customer receives delivery of the product.
3. Settlement: This phase consists of an Invoice (if any) and Payment. Invoice means customer will
receive a bill for the purchased product and after confirmation of received product, customer will
pay for the same.
4. After-Sales: This phase consists of warranty and After-Sale Services. In the warranty period,
customers will get all maintenance services for free or at minimum cost. After-sale services mean
customers will do complaints (if any) about the performance of product and get maintenance
service from the supplier.

(2) Explain M-commerce.

Answer :

M-commerce (Mobile Commerce):

1. M-commerce is buying and selling of goods and services through wireless devices such as
smartphones and tablets.
2. M-commerce enables the user to access online shopping platforms without using desktop
computers.
3. Applications of M-commerce are Mobile banking, E-bill payment, ticket booking, etc.

(3) Describe process of encryption.

Answer :

1. Encryption is widely used on the internet to protect user-information being sent between a browser
and a server.
2. This includes passwords, payment information, and other personal information that should be
considered private.
3. Encryption converts Plain text into Cipher text means non-readable form of data.
4. Decryption is the opposite of encryption i.e. it converts Cipher text into Plain text.
5. Encryption is of two types Symmetric and Asymmetric.

(4) What is E-governance?

Answer :

1. E-governance signifies the implementation of Information Technology in the Government


processes.
2. The basic purpose of E-governance is to simplify processes for all, i.e. government, citizens,
businesses, etc. at all levels.
3. E-governance delivers SMART (S-Simple, M-Moral, A-Accessible, R-Responsive, T-Transparent
Government).

(5) List out advantages of E-commerce.

Answer :

Advantages of E-commerce:

1. Global scope: E-commerce provides the sellers with a global reach. Now sellers and buyers can
meet in the virtual world, without the barrier of place.
2. Electronic transaction: E-commerce reduces the paperwork and significantly lower the transaction
cost.
3. Anytime shopping: The great advantage of E-commerce is the convenience. A customer can shop
24 × 7.
4. No intermediaries: Electronic commerce also allows the customer and the business to be in touch
directly, without any intermediaries.

(6) Which are the different types of E-governance?

Answer :

E-governance is of four types depending on the specific types of services:

1. Government to Citizen (G2C):


(i) The Government to citizen refers to the government services which enable citizens to get access
to a wide variety of public services.
(ii) Most of the government services fall under G2C.
(iii) A citizen can have access to the services anytime from anywhere.
(iv) Services like license renewals and paying tax are essential in G2C.
(v) It also focuses on geographic land barriers.
2. Government to Business (G2B):
(i) G2B is the exchange of services between Government and Business organizations.
(ii) G2B provides access to relevant forms needed to comply.
(iii) The G2B consists of many services exchanged between business sectors and government.
(iv) It aims at eliminating paperwork, cost and establishes transparency in the business
environment while interacting with the government.
3. Government to Government (G2G):
(i) The Government to Government refers to the interaction between different government
departments, organizations, and agencies.
(ii) In G2G government agencies can share the same database using online communication.
(iii) The government departments can work together.
(iv) G2G services can be at the local level or international level.
(v) It provides a safe and secure inter relationship between domestic or foreign government.
4. Government to Employee (G2E):
(i) The Government to Employee is the internal part of G2G sector.
(ii) G2E aims to bring employees together and improvise knowledge sharing.
(iii) G2E provides online facilities to the employees like applying for leave, reviewing salary payment
records, and checking the balance of the holiday.
(iv)This sector provides human resource training and development.
(v) Examples of successful implementation of E-governance are e-Mitra, e-Seva project, CET
(Common Entrance Test).

(7) State two examples of G2E services.


Answer :

1. The Government to Employee is the internal part of G2G sector.


2. G2E aims to bring employees together and improvise knowledge sharing.
3. G2E provides online facilities to the employees like applying for leave, reviewing salary payment
records, and checking the balance of the holiday.
4. This sector provides human resource training and development.
5. Examples of successful implementation of E-governance are e-Mitra, e-Seva project, CET (Common
Entrance Test).

(8) Write any four advantages of E-governance.

Answer :

Advantages of E-governance are:

• Improves delivery and efficiency of government services


• Improved government interactions with business and industry
• Citizen empowerment through access to information
• More efficient government management
• Less corruption in the administration
• Increased transparency in administration
• Greater convenience to citizens and businesses
• Cost reductions and revenue growth
• Increased legitimacy of government
• Improved relations between the public authorities and civil society

**********************

You might also like