Class 8 Computer Book PDF

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

Be Future Ready

Windows 10 with Office 2016

P
Davinder Singh Minhas

Reema Soni
PM
This book belongs to:

Name ..........................................................................

Class .................. Section ............... Roll No. ...........

School ..........................................................................

® 8
PM PUBLISHERS PVT. LTD.
IT PLANET - 8 (GIGABYTE)

© 2011 by PM Publishers Pvt. Ltd.


All rights reserved. No part of this publication may be reproduced, stored in a retrieval system,
transmitted or utilized in any form or by any means, electronic or mechanical, including photocopying,
recording or otherwise, without the prior written permission of the publisher, or as expressed by law, or
under terms agreed with the appropriate Reprographics Rights Organization(s).

Trademarks
Microsoft Windows, Microsoft Word, Microsoft Excel, Microsoft PowerPoint, Microsoft Access, Scratch,

P
Photoshop, Animate, Stykz, etc. and all other brand names, product names, pictures and icons used in
this book are trademarks, registered trademarks or trade names of their respective holders. The Publisher
is not associated with any product or vendor mentioned in this book.
PM
ISBN : 978-93-87596-70-2

Edition : 2020

Printed at :

Published in India by :

PM PUBLISHERS PVT. LTD.


C-55, Sector-65, Gautam Budh Nagar, Noida-201 301 (U.P.)
Ph.: 0120-4300130-33, Fax: 91-120-4258070, Mob.: 9540990177
E-mail: [email protected]
URL: www.pmpublishers.in
PREFACE

In the educated world, knowing about computer and its intricacies is no more a luxury, but a
necessity. Therefore, we have created IT Planet (Gigabyte) Computer Series for classes 1 to 8,
keeping this necessity in mind. The name of this series symbolizes memory unit of computer.
You may have heard somebody talking about AI, social engineering, cloud computing, app
development, Raspberry Pi — a lot of jargon in that talk might have seemed Latin and Greek to
you, but not in this series. In this series, the concepts of computer will be as clear as you are
watching streaming media without any buffering.
This series is based on the latest software packages and operating system programs such as
Microsoft Office 2016 and Windows 10. Apart from these two, we have covered latest software
programs such as Scratch, Stykz, Animate, Photoshop, Spark, MIT App Inventor and Python.
To produce a visually appealing and easy to understand book, we have artfully combined the
latest technology, pictures, drawings and text in this series. Most of the pictures in this series
show a step-by-step pedagogy, which simplifies the more complex computer concepts. The terms

P
and examples described in this series are those which everyone will come across while using
computers in school as well as at home.
To make the chapters exciting, projects have been given that encourage the students to try out
for themselves, to instill in them the confidence before they embark on making their own project
PM
using that software. Each project in the chapter presents a practical problem and complete
solution in an easy-to-understand approach. Each of the tasks required to complete a project is
identified throughout the development of the project.
In a Nutshell is the section which summarizes the whole chapter and the Self-Evaluation section
examines the students' understanding of computer concepts. Different types of exercises and
activities have been included at the end of every chapter to inculcate the students with an urge
to seek answers.
The series also throws light on the cybercrimes and cyber security issues, thereby encouraging
students to be good digital citizens. It includes all the software programs required to be at par
with the current global education system.
The contents in this series are hand-picked by a panel of experts, including Ms. Nisha Batra, Jr.
Headmistress and HOD Computer Department, St. Mary’s School, Delhi and Dr. Richa Verma, Sr.
Headmistress, KIIT World School, Delhi. This selection of contents will answer the need of
students and shape their minds to stand apart from the crowd.
Humble acknowledgment to Prof. M.M. Pant for his invaluable contribution. A stalwart in the
world of computer technology, he is an internationally renowned expert specialising in pedagogy,
technology and the development of tools for the future learners.
We welcome constructive suggestions and any feedback to make this series more comprehensive,
relevant, updated and useful both for the teachers and the learners. You may mail us at
[email protected]

AUTHORS
CONTENTS
1 Computer Network 5 6 E-Commerce & Blogging 81

• Communication • E-Commerce
• Computer Network • E-Commerce Business Models
• Types of Network • E-Retailing • Security Concern
• Network Hardware • Top E-Commerce Websites
• Communication Channels • Blogging
• Network Architecture
• Network Topology
7 Artificial Intelligence (AI) 92
• Protocol
• Introduction
2 Access - Tables and Forms 19 • Artificial Intelligence
• Understanding AI Environment
• Working with Database Table • Timeline of Artificial Intelligence
• Filtering Data • Artificial Intelligence in Daily Life
• Creating Relationship between Tables • Future of AI
• Creating Forms • AI and Ethics

3 Access - Query & Report


• The Query
• Creating a Query
P 36 8 App Development

• Introduction to App
• Android and iOS • Types of Apps
104
PM
• Understanding Query Options • Categories of Apps • Working of Apps
• Using Criteria in Query • Developing an App
• Sorting Data in Query
• Creating a Report 9 Python - Introduction 127
• Programming Language
4 HTML - Form, Multimedia & CSS 48 • Introduction to Python
• Character Set • Tokens • Comments
• HTML
• Statements • Data Types • Variables
• Creating Forms
• Defining Input and Output in Python
• Adding Multimedia
• Error Handling • Programs in Python
• Cascading Style Sheets (CSS)

10 Python - Control Structures 145


5 Cloud Computing 67
• Control Structures
• Introduction • Conditional Control Structures
• Cloud Computing • Loop Control Structures
• Google Docs • Break Statement
• Google Drive • Continue Statement

Worksheet Project Work

Additional Information National Cyber Olympiad


1 Computer Network

Topics Covered
•Communication •Computer Network •Types of Network •Network Hardware •Communication
Channels •Network Architecture •Network Topology •Protocol

Communication
Communication is important for people to share their views and
opinions. It is a process in which two or more people share their
knowledge, information, resources and expertise among themselves.
Communication involves a sender transmitting an idea, information, or
feeling to a receiver. Effective communication occurs only if the receiver
understands the exact information that the sender intends to give.

COMPUTER COMMUNICATION

P
Computers were stand-alone devices when they were first introduced. With the rapid increase
in the uses of computers, the manufacturers began to design hardware and software that
would allow the computers to communicate with one another.
Computer communication is described as a process in which one computer transfers data,
instructions, and information to another computer(s). Earlier, only large computers had
PM
communication capabilities. Today, even the smaller computers and devices can communicate
directly with one another, with hundreds of computers on a company network, or with millions
of other computers around the globe—often via Internet. Some communications involve cables
and wires; others are sent wirelessly through the air. For successful computer communication,
you need the following components:
SENDER: It is a sending device that initiates to send data, instructions or information. It can
be a computer or mobile device.
COMMUNICATION CHANNEL OR TRANSMISSION MEDIA: It is a medium on which the data,
instructions, or information can travel. It can be cables, microwave stations, or satellites.

IT PLANET - 8 (GIGABYTE)
RECEIVER: It is a receiving device that accepts the transmission of data, instructions, or
information. It can be a computer or mobile device.
PROTOCOL: It is a set of rules that outlines characteristics of how two devices communicate.
Without protocol, two devices may be connected, but cannot transfer or exchange the data. A
protocol may define data format, coding schemes, and the sequence in which data transfers
among devices. For example, a person who knows only English language cannot communicate
with another who knows only Hindi language. For communication between two persons, the
knowledge of same language is a must.

Protocol
5
Communication Channel

Sender Receiver
Computer Network
A computer network is a collection of computers and
devices connected by communication channels. People
connect computers to a network for a variety of reasons,
including the ability to share hardware, software, data
and information, as well as to facilitate communication. Computer Network
A computer network can be as small as two computers
connected to each other, or it may be spread over
different parts of a city, or covering the whole world.

NEED FOR A NETWORK


You can share resources such as hardware devices, software programs, data and information
with the help of a network. Sharing resources saves time and money.
Data And Information Sharing
In a network environment, any authorized user can use a
computer to access data and information stored on other
computers in the network. A large company, for example

P
might store a database of customer information on the
hard disk of the server. Any authorized person can connect
to the network and can access this database. The capability
of providing access, and storage of data and information on
shared storage devices is an important feature of network.
Data and Information Sharing
PM
Hardware Sharing
In a network environment, each computer on a
network can access and use hardware available on the
network. Suppose, there are a number of personal
HUB
computers on a network and each one needs to use a
laser printer. If the personal computers and the laser
printer are connected in a network, each personal
computer user can access the laser printer over the
PM PUBLISHERS PVT. LTD.

Hardware Sharing network, whenever he or she needs it.

Software Sharing
Network lets people gain access to software
programs stored on a central computer. Using their
own computers, individuals can gain access to and
work with these programs. By sharing a program, a
company can avoid having to install a copy of the disc
PROGRAM
CD-ROM

program on each person's computer separately. Software Sharing

Transfer Funds
6 Network allows users to exchange money from one bank account to another via Electronic Fund
Transfer (EFT). Both business houses and consumers use EFT. Examples include, use of credit and
debit cards, direct deposit of funds into bank, online banking, and online bill payment.
NETWORK USER
When your computer is a part of a network, where two or more computers are connected
using a cable or some other communication channels, you can become a network user and
can share files, folders, and computer hardware such as printers attached from one computer
to other computers. These usual resources are referred to as local resources.

SERVER AND WORKSTATIONS


Powerful computers responsible for distributing files to network users are referred to as
servers. Other less powerful computers connected to a server are called workstations. Each
workstation contributes equally in the network and is often called peer.

Types of Network
There are many types of network: Local Area Network (LAN), Metropolitan Area Network
(MAN), Wide Area Network (WAN) and Personal Area Network (PAN). Each one of these is
discussed below:

LAN (Local Area Network)

P
A local area network (LAN) is a network that
connects the computers and the devices in a
limited geographical area, such as home, school
PM
computer laboratory, office building or closely
positioned group of buildings. These computers
are usually within 100 to 300 meters away from LAN
each other.
If you have a home network with two or more
computers, or if you are at your school where
more than 20 computers are connected to each
other, then you are on a LAN.

Each computer or device on the network is a node. Often, the nodes are connected to the

IT PLANET - 8 (GIGABYTE)
LAN via cables. LAN can either work with cables and hubs or wirelessly. A Wireless Local Area
Network is also known as WLAN.

WAN (Wide Area Network)


A wide area network (WAN) spans over a large
geographical area, such as an entire city, region, or
even an entire country or all over the world. Two
or more LANs that are relatively far apart are
typically connected by WAN so that users and
computers in one location can communicate with
users and computers in other locations. The 7
WAN
Internet is the world’s largest WAN.
MAN (Metropolitan Area Network)
MAN is a network that connects the Local Area Networks in a metropolitan area such as a city
or a town. A MAN typically includes one or more LANs but covers a smaller geographical area
than a WAN. Telephone companies, cable television operators, and other organizations use
MAN network.

MAN

PAN (Personal Area Network)


A personal area network (PAN) is a network that
connects personal devices like laptop, smartphones,
digital cameras, printers, etc. in an individual’s workspace
using wired and wireless technology. A PAN may connect
devices through a router using network cables or by
using Bluetooth or Wi-Fi technology. You can transfer PAN

P
files and songs from laptop to a smartphone using PAN.

Network Hardware
PM
Network hardware consists of physical devices used on a network. All networks need network
hardware to function.

COMPUTER
The most important job of a network is to link computers together.
When computers are linked, the people using the computers can work
more efficiently. Computers connected to a network do not have to
be the same type. For example, a network could contain desktop
computers, such as IBM-compatible and Macintosh or portable
PM PUBLISHERS PVT. LTD.

computers, such as notebooks and Tablet PCs.

NETWORK INTERFACE CARD (NIC)


An expansion card is used to provide network access to a computer or
other device, such as a printer. Network interface cards mediate
between the computer and the physical media such as cables over
which data travels.
CONNECTOR
A connector is a device that joins two networks together. The most common connectors are:
HUB: A hub offers a central location where all the cables on a network meet. It allows you to
8 connect multiple computers to a single network. It also provides the connection for all the
computers on a network, so that they can exchange data. Many types of network structures are
now using hubs as the primary method of connecting computers.
SWITCH: A switch is a device that provides a central point for cables in
a network. A switch receives data from many directions and then
forwards it to one or more destinations. A switch is considered more
advanced than a hub because switch sends the data to a device that
needs or requests for it. Switches can be used in place of hubs.

ROUTER: A router is a device that connects multiple computers


together and transmits data to its correct destination on a network
through a process known as routing. A router acts as a junction
between two or more networks like LAN and WAN to transfer data
packets among them. For example, it is used to connect your home
network (LAN) with the Internet (WAN).

CABLES
A network cable plugs into the NIC (Network Interface
Card) at the back of each computer on the network.
Information, shared files, and other network data travel
through the network cables. A fiber metal or fiber-optic
cable is used to connect computers and other devices on

material such as plastic or rubber.


RESOURCE
P
a network. These cables are insulated with special
PM
Any part of a computer system or a network such as a disk drive, printer, or
memory that can be allotted to a program or a process, while it is running,
is a resource.

Communication Channels
All networks are linked to each other through communication channels.
These are the medium on which the data, instructions, or information can
travel. When you send data from a computer or mobile device, the signal

IT PLANET - 8 (GIGABYTE)
that carries the data may travel over various transmission media. Most
commonly used media are physical and wireless.

PHYSICAL TRANSMISSION MEDIA


Physical transmission media use wire or cable to send communications signals. LANs often use
physical transmission media. There are three main types of physical transmission media. They
are twisted pair cable, coaxial cable and fiber optic cable.

Twisted-Pair Cable
Twisted-pair cable consists of one or more twisted-pair wires bundled
together. Each twisted-pair wire consists of two separate insulated copper 9
wires that are twisted together and is color-coded for identification.
Landline phone networks and LANs often use twisted-pair cable.
Twisted-Pair Cable
Coaxial Cable
Coaxial cable consists of a single copper wire surrounded by at least
three layers. The first one is an insulating material, the second is a
wire mesh, and the third is a plastic outer coating. On coaxial cables,
data travels through a copper wire. Cable TV network wiring uses
coaxial cable. Coaxial Cable

Fiber-Optic Cable
The core of a fiber-optic cable consists of hundreds of thin
strands of glass or plastic that use light to transmit signals..
Inside the fiber-optic cable, an insulating glass cladding and a
protective coating surrounds each optical fiber. Many big
companies use fiber-optic cables in high-traffic networks.
Fiber-Optic Cable

WIRELESS TRANSMISSION MEDIA


Wireless transmission media send communication signals through the air. Many people use this
media because it is more convenient than installing cables. Types of wireless transmission
media used in communications include infrared, broadcast radio, cellular radio, microwaves,
and communication satellites.

Infrared (IR)
P
Infrared (IR) is a wireless transmission medium that sends signals using infrared light waves.
PM
Infrared systems use the same technology as household remote controls. It is also used with
computers and devices like cordless keyboards and mouses.

Broadcast Radio
Broadcast radio is a wireless transmission
medium that distributes radio signals through the
air over long distances, such as between cities,
regions, and countries, and short distances, such
as within an office or home. Bluetooth and Wi-Fi
PM PUBLISHERS PVT. LTD.

Downloading
Files
communication technologies use broadcast radio
signals.

Broadcast Radio
Cellular Radio
Cellular radio is a wireless transmission medium that is used for mobile communications. It is
a form of broadcast radio. Several categories of cellular radio transmissions exist, such as 1G
(first generation of cellular transmissions), 2G, 3G, 4G and 5G.

Wi-Fi
10 Wi-Fi is short for wireless fidelity, which is a popular wireless networking technology
that uses radio waves to provide wireless high-speed network connections.
Microwave Earth-based dish

Microwaves provide a high-speed wireless signal


transmission. It involves sending signals from one
microwave station to another. A microwave station
is an earth-based dish that contains the antenna
and other equipment necessary for microwave
communications. Microwave transmission is used
in wide-open areas, such as deserts or lakes.
Microwave

Satellite Communication Satellite


A communication satellite is a space station that
receives microwave signals from an earth-based
station, amplifies (strengthens) the signals, and
broadcasts the signals back over a wide area to
any number of earth-based stations. Applications
such as television and radio broadcasts, weather

Communication Satellite

Network Architecture
P forecasting, videoconferencing, GPS, and Internet
connections use communication satellites.
PM
The network architecture refers to how computers are organised and how tasks are allocated
among these computers. It is mainly categorized into two major types:

PEER-TO-PEER NETWORK Computer


A network of two or more computers that uses
the same type of programs to communicate and
share data is called a Peer-to-Peer network. Each
Computer
computer or peer is considered equal in terms of

IT PLANET - 8 (GIGABYTE)
responsibilities, and each acts as a server to PEER
others in the network. Peer-to-Peer networks TO
PEER
work best in a small environment. These
networks are designed primarily for small to
medium local area networks. One should not use
Printer
peer-to-peer network if more than 10 computers
Computer
are to be connected together.

CLIENT/SERVER NETWORK
A network in which one or more computers are designated as server(s), and the other 11
computers on the network, called clients, can request services from the server, is known as
Client/Server Network.
Server
A server, sometimes called the host computer, controls access to the hardware and software
on the network and provides a centralized storage area for programs, data, and information.
When a user connects to the server, then applications, files, printers, etc. become available.
Some servers perform a specific task and are called dedicated
servers.
For example, a file server stores and manages files.
A print server manages printers and documents being printed.
A database server stores and provides access to a database.
A network server manages network traffic.
A web server is a computer that delivers requested web pages
to your computer.

Client
A Client is a computer system that relies on a
server for all the resources. For example, a
server might store a network version of word

P
processing program. Every client on the
network can access the word processing
program on the server. Client/Server Network
PM
Network Topology
In networking, the term topology refers to the layout structure of connected computers and
devices on a network. A network topology has two levels, i.e., physical and logical.
The physical level refers to the parts of a network that physically exist, such as computers,
cables and connectors. This level specifies where the computers on a network are located and
how all the parts of the network are connected. Cables are the most popular transmission
media to transfer information on a network.
The logical level refers to the path that the information takes to reach its destination on a
PM PUBLISHERS PVT. LTD.

network. The logical level of a network depends on many factors, such as the applications used
and the volume of information transferred over the network. Computers share information by
exchanging electrical signals. Signals are sent via the transmission medium that connects the
computers.

12
PHYSICAL LOGICAL

Bus, Star and Ring are the three main types of network topologies.
BUS TOPOLOGY
In this kind of topology, all the computers and their devices are connected to one single cable
called the Bus. This Bus network is also called linear network. It transmits data, instructions
and information in both directions.

Only one computer can communicate at a time in bus topology. A device, wanting to
communicate with another device on the network, sends a broadcast message onto the wire that
all other devices can see, but only the intended recipient accepts and processes the message.

Sending... Receiving...

P
PM
In this topology, computer system can be easily added or removed from the network. The
failure of single node does not affect the performance of the remaining network.

STAR TOPOLOGY
In this kind of topology, connector called a hub is placed at the centre to which all the other
nodes are connected. All the information that is transferred from one computer to another on
the network, passes via the hub. Star network is one of the most common computer network
topologies, because, it is easy to add or remove nodes. A failure in any star network cable will
only take down network access of one computer and not the entire network. When the hub

IT PLANET - 8 (GIGABYTE)
fails, then the network also fails.

13

Star Topology
RING TOPOLOGY
In ring topology, nodes are connected in a circular chain
in which each node is connected to the next one and
the last node is connected to the first one. Every device
has exactly two neighbours for communication purpose.
All messages travel through a ring in the same direction
(either "clockwise" or "counter clockwise"). Ring Topology
In this, if one node fails, the whole network goes off.
Computers are usually located close together. A ring
network is easy to set up because the computers are
attached to a single ring of cable and no central
connector, such as hub, is required. There is no
beginning or end in a ring network.

Protocol
A protocol is a set of rules that outlines characteristics of how two devices communicate over
the network. There are different protocols for different operations on the Internet.

P
HTTP (Hypertext Transfer Protocol): This is a set of rules that defines how pages transfer on
the Internet and what actions web servers and browsers should take in response to various
commands. Many web addresses begin with http:// as the protocol.
FTP (File Transfer Protocol): This is a set of rules that allows file uploading to and downloading
PM
from other computers on the Internet. Uploading is the process of transferring files from your
computer to a server on the Internet. Downloading is the process of transferring files from a
server on the Internet to your computer. Web page developers often use FTP to upload their
webpages to a web server.
TCP/IP (Transmission Control Protocol/Internet Protocol): This is a network protocol that
defines how the information or messages are routed from one end of a network to the other,
ensuring the data arrives correctly. It has been used as network standard for Internet
communications.
POP3 (Post Office Protocol version 3): This is an email protocol that stores email messages on a
PM PUBLISHERS PVT. LTD.

mail server and allows the user to view, access and manipulate the message after downloading
or storing it on their computer. Once the messages are downloaded onto your computer, they
are deleted from the mail server. This means that after the email is downloaded, it can only be
accessed using the same computer. If you try to access your email from a different device, the
messages that have been previously downloaded will not be available to you.
IMAP (Internet Message Access Protocol): This is also an email protocol that stores email
messages on a mail server and allows the user to view, access and manipulate the messages on
the mail server from their computer. When you read an email message using IMAP, you are not
actually downloading or storing it on your computer; instead, you are reading it on the mail
server from your computer. As a result, if you try to access your email from a different device,
the same messages will be available to you.
14 SMTP (Simple Mail Transfer Protocol): This is an email protocol for sending email messages
across the Internet. SMTP was originally developed in the early 1980s and remains one of the
most popular protocols in use worldwide. Most email software programs use SMTP for sending
mails and use either the POP3 or IMAP protocol for receiving mails.
CHECKLIST
S
Self-Evaluation

ee
agr
ree

Dis
After reading the chapter, I know these points:

Ag
$ I know that computer communication is described as a process in which one
computer transfers the data, instructions, and information to another computer(s).
$ I know that a network is a collection of computers and devices connected by
communication channels.
$ I know that there are many types of networks: Local Area Network, Metropolitan
Area Network and Wide Area Network and Personal Area Network.
$ I know that the network architecture is mainly catogorized into two major
types—Peer-to-peer network and Client/Server network.
$ I know that network topology refers to the layout structure of connected computers
and devices on a network.
$ I know that communication channel is a medium on which the data, instructions, or
information can travel.

A.
Exercises
Tick [ü ] the correct answer. P
1. A computer network is a collection of computers and devices connected by .......... channels.
PM
a. Internal b. Communication c. External
2. ........................ provide a high-speed wireless signal transmission.
a. Infrared b. Cellular Radio c. Microwaves
3. A network consisting of small and large computers over a vast geographical area is called
.................... .
a. LAN b. WAN c. MAN
4. The computer connected to the server is called ............................. .
a. Host b. Workstation c. Workgroup

IT PLANET - 8 (GIGABYTE)
5. ........................ network is designed primarily for small to medium local area networks.
a. Client b. Peer-to-Peer c. Server
6. ..................................... server manages printers and documents being printed on network.
a. Print b. Web c. Mail
B. Write ‘T’ for True and ‘F’ for False statements.
1. Each computer on a network cannot access hardware available on the network.
2. You can transfer songs from laptop to smartphone using PAN.
3. Landline phone networks and LANs often use twisted-pair cable.
4. A client is sometimes called the host computer.
5. A peer-to-peer network works best in a large working environment. 15
6. SMTP is an email protocol for receiving messages.
7. Network allows user to exchange money from one bank account to another via
Electronic Fund Transfer.
C. Fill in the blanks.
1. Each computer or device on the network is called a ................................ .
2. A …………………………. is a computer system that relies on a server for all the resources.
3. ………………… are powerful computers in the network.
4. A .................................. is a device that provides a central point for cables in a network.
5. ........................ transmission media use wire or cable to send communication signals.
6. Many big companies use .................................. cables in high-traffic networks.
D. Define the following.
1. Protocol: ....................................................................................................................................
....................................................................................................................................................
2. Router: .......................................................................................................................................
....................................................................................................................................................
3. FTP : ..........................................................................................................................................
....................................................................................................................................................
E. Differentiate between the following.
1. POP3
P
.................................................................
IMAP
.................................................................
PM
................................................................ .................................................................
................................................................ .................................................................
2. Hub Switch
................................................................. .................................................................
................................................................ .................................................................
................................................................ .................................................................
3. Star Topology Ring Topology
PM PUBLISHERS PVT. LTD.

................................................................. .................................................................
................................................................ .................................................................
................................................................ .................................................................
4. Twisted-Pair Cable Coaxial Cable
................................................................. .................................................................
................................................................ .................................................................
................................................................ .................................................................
F. Answer in 1-2 sentences.

16 1. What is a computer network?


.....................................................................................................................................................
.....................................................................................................................................................
2. What is network topology?
.....................................................................................................................................................
.....................................................................................................................................................
3. What are network communication channels?
.....................................................................................................................................................
.....................................................................................................................................................
4. Name the different types of wireless transmission media.
.....................................................................................................................................................
.....................................................................................................................................................
G. Answer Briefly.
1. What are the basic requirements for computer communication?
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
2. What are the different types of networks?
P
.....................................................................................................................................................
.....................................................................................................................................................
PM
.....................................................................................................................................................
.....................................................................................................................................................
3. What are the different types of network architecture?
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................

IT PLANET - 8 (GIGABYTE)
H. Application Based Question.
Two students, A and B, are working on separate computers in the school computer lab. A wants
to see a file created by B on his computer. Can A access the computer of B? If yes, tell him
which network he can use for this purpose.
...........................................................................................................................................................

Group Discussion
Divide the students into groups and discuss the various protocols.

Online Link 17
To learn more about working of Computer network, visit the website:
https://www.javatpoint.com/types-of-computer-network
Discover More
GPS (Global Positioning System)
GPS is a navigation system that consists of one or more earth-based
receivers that accept and analyze signals sent by satellites in order to
determine the receiver’s geographic location. Many mobile devices,
such as smartphones, have GPS capability built into the device. Some
users carry a handheld GPS receiver; others mount a receiver to an
object such as car, an airplane, or a computer or mobile device. A
GPS receiver is a handheld, mountable, or embedded device that
contains an antenna, a radio receiver, and a processor. Many include
a screen display that shows an individual’s location on a map.
Uses of GPS
The first and most used application of GPS technology is to assist people in determining where they are
located. The data obtained from a GPS, however, can be applied to a variety of other uses: locating a
lost person or stolen object, monitoring the movement of a person or object, determining altitude, and
calculating speed.
Many vehicles use GPS to provide drivers with directions or other information, such as alternate traffic
routes, and track the vehicle if it is stolen. Newer GPS receivers also give information to drivers about

P
nearby points of interest, such as fuel stations, restaurants, and hotels.

Running Multiple Operating System using Virtual Machine


A virtual machine enables a computer to run another operating system in
PM
addition to the one installed. Various reasons exist for using a virtual
machine. For example, if you are running the Windows OS on a computer but
need to work on Linux (Ubuntu) OS, you might set up a virtual machine
running the Windows OS so that you can run the desired OS (Linux).
To set up a virtual machine, you will need the required software, as well as
installation media for the operating system you want to install in the virtual
machine.
You can download virtual machine from the site “www.virtualbox.org ”.
PM PUBLISHERS PVT. LTD.

Technology Trailblazers
Tim Cook

? CEO: Apple YEAR: 2011

TTim Cook is the CEO of Apple and serves on its Board of Directors. He is a
lologistical mastermind with an ability to recollect facts and figures, which led
Apple
A climb up the profit charts to record levels.
TTim Cook was born in the small town of Robertsdale, Alabama, on November
1 1, 1960. He graduated from Auburn University with a Bachelor's degree in
IIndustrial Engineering and earned an MBA from Duke University. Following a
18
112-year career at IBM, Tim Cook went on to executive roles at Intelligent
EElectronics and Compaq, before joining Apple in 1998. In August 2011, Cook
wawas named Apple's new CEO, following the death of predecessor Steve Jobs.
2 Access - Tables and Forms

Topics Covered
•Working with Database Table •Filtering Data •Creating Relationship between Tables •Creating Forms

In the previous class, you have learnt about database, creating table and adding records in
it. Now, lets move further and learn some more about Access which is a database software.

Working with Database Table


A database table is composed of records and fields that hold data. Tables are also called
datasheets. In the previous chapter, you have created a database table and added records to
it. After creating table, you need to work on it.

SELECTING DATA IN A TABLE


Before performing any task in a Table, you need to select data in a table. The selected data
appears highlighted on your screen. To make a selection, perform the following steps:

Selecting a Field
P 1. Place your mouse pointer over
the name of the field you want to
PM
1 select. The mouse pointer
changes to ( ). Now click to
select the field.

To select multiple fields, position the mouse pointer over the name of the first field. Then drag the
mouse pointer ( ) until you highlight all the fields you want to select.

Selecting a Record 1. Place your mouse pointer over


the area to the left of the record
you want to select. The mouse

IT PLANET - 8 (GIGABYTE)
pointer changes to ( ). Now click
1 to select the record.
To select multiple records, place your
mouse pointer over the area to the
left of the first record. Then drag the
mouse ( ) until you highlight all the
records you want to select.
Selecting a Cell
1. Place your mouse pointer over
the left or right edge of the cell
you want to select. The mouse
1 pointer changes to ( ). Now
click to select the cell. 19

To select multiple cells, position the mouse pointer over the left edge of the first cell. Then drag the
mouse ( ) until you highlight all the cells you want to select.
USING THE FIND AND REPLACE FEATURE
You can find a particular record and replace the same record with some other text in a large
database.

Find Option
Find allows you to quickly search data in tables, queries, and forms for specified database task.
To search through all records in the current field only, you can select a field. This is usually fast,
especially if the field is indexed. To search through all the fields in all the records, you can select
the datasheet or form.
1. Open the table from
3 which you want to find
4 the information.
2
2. Select the field (column)
that you want to search.
3. Click on the Home tab
on the Ribbon.
4. Click on Find from the

P
The Find and Replace dialog box appears with the Find tab selected.
Find group or press
CTRL+F.
PM
5 6
PM PUBLISHERS PVT. LTD.

5. In the Find What text box, type ‘Hip-Hop’.


You can select the following options according to your requirement.
Look In drop down box allows you to search only the current field (faster) or all the fields in the
entire table (slower).
Match drop down box gives you the options to select any one of the match type. Click on any
part of the Field. This provides the broadest possible search.
Search drop down box allows you to search up or down from the insertion point, or search the
whole document.
Match Case check box allows you to find only text that has the same pattern of uppercase and
lowercase characters as the text you specified.
Search Fields as Formatted check box allows you to check the search based on the format
20 rather than the value.
6. Click on the Find Next button.
Access jumps to the
first (and only)
occurrence of the word
‘Hip-Hop’ that it finds
in the table.
7. To close the dialog box,
click on Cancel.
The Find and Replace
dialog box closes.
7 You can also replace
information in a database.

Replace Option
After finding the data, you can replace it with some other text you specify.

1. Open the table in which


3 you want to replace a
4

P 2
record.
2. Select the field (column)
that you want to search
and then replace.
3. Click on the Home tab
PM
on the Ribbon.
4. Click on Replace from
the Find group, or press
CTRL+H.

The Find and Replace dialog box appears with the Replace tab selected.

5 5. In the Find What text box type ‘Hip-Hop’.


In this example, we will replace every occurrence

IT PLANET - 8 (GIGABYTE)
of the phrase ‘Hip-Hop’ with the phrase
‘Bharatnatyam’.
6

7
6. Select the Replace With text box by clicking it and type ‘Bharatnatyam’.
7. Click on Replace All.
Access finds all the occurrences of the phrase ‘Hip-Hop’ in the table and replaces them with the
word ‘Bharatnatyam’.

CHANGING TABLE VIEW


Datasheet View and Design View are the two views in which you can view your table. In 21
Datasheet view, you can enter data. You can use Design view to modify the structure of the table.
Switch To Design View from Datasheet View
1. Click on Home tab.
1
2 2. Click on View button.
3. Click on Design View.
3 Access will display the design
of the table and show the
field properties.
Switch To Datasheet View from Design View
1. Click on Home.
1
2. Click on View button.
2
3. Click on Datasheet View.
3
By default, Access displays
Datasheet view of the table.

EDITING FIELDS IN A TABLE


You can edit the fields in a table by renaming, adding, and deleting them.

Renaming a Field
P
If you are not satisfied with the name of a field, you can rename the field of the Table to
describe the contents of the field more accurately.

1. Right-click the field whose name


PM
1
you want to change.
A menu will appear.
2. Click on Rename Field.
The field name is highlighted.
3. Type a new name for the field
and then press the Enter key.
2 The field displays the new name.
Adding a Field in The Table
PM PUBLISHERS PVT. LTD.

You can add a field to a table when you want to include an additional category of information.
1. Right-click the name of field that you want to be displayed after the new field. A menu appears.
2. Click on Insert Field.
The new field appears in the table.
Access will assign a name to the new
field as Field 1.
Now, you can rename the field name
and add information in it.

Deleting a Field in The Table


You can delete a field that you no longer need in a table.
22 1. Right-click on the field that you want to remove.
2. Click on Delete Field. A prompt box appears.
3. Click on Yes. Access removes the field and any record content for the field from the table.
SORTING RECORDS
Sorting means arranging the records in a particular order, ascending or descending. To sort the
records, select the field on the basis of which you want to arrange the records.
You can change the order of records in a table. This can help you find, organize, and analyze
data.

4 1. Open the table that you want to


3 sort.
2 2. Click on the column header for
the field that you want to sort.
3. Click on the Home tab on the
Ribbon.
4. Click on Ascending ( ) to sort
the records in ascending order.
OR
Click on Descending ( ) to sort
the records in descending order.

Filtering Data
P The records will appear in the new
order.
PM
You can filter data in a table to display only those records that contain data of interest.
Filtering data can help you review and analyze information in your database.

FILTERING DATA BY SELECTION


It is used to display only those records that contain exactly the same data. For example, if you
want to find all the students whose Dance mode is Bharatnatyam, you can use Filter Data
option in Access.

IT PLANET - 8 (GIGABYTE)
3 1. Click the data you want to use
2
to filter the records.
4
Access will display only those
records that contain exactly the
1 same data.
2. Click on Home tab.
3. Click on Selection to filter the
records.
4. Click on a criterion.
In this example, we have selected
Equal “Bharatnatyam”.
23
Access displays only the
records containing the
5 filtered data. All other
records are hidden.
The Filtered word
appears in this area to
indicate that you are
viewing filtered records.
5. When you finish
reviewing the filtered
records, click on Toggle
Filter once again to
display all the records.

FILTERING DATA BY FORM

P
Filtering by form enables you to filter by multiple fields and specify criteria for as many fields
as you like. When you filter by form, you can combine the criteria using AND, OR, or a
combination of the two. An AND combination finds records where both criteria are met; an OR
combination finds records where at least one of the criteria is met.
PM
Using ‘AND’
1. Open the table if it is
2 3 not already opened.
2. Click on Home tab on
4 Ribbon.
3. Click on Advanced
button.
4. Click on Filter By Form.
PM PUBLISHERS PVT. LTD.

Update Your Knowledge Update Your Knowledge


To sort by more than one column, highlight the Filter by Form can be advantageous when the table
columns by clicking and dragging the mouse over is too large and it is difficult to find the record that
24
the field labels, and select the sort method. contains the value you would like to filter.
The Filter by Form window
appears, which looks like an
empty replica of your table.
5
Now you have to select the
field and the value you want
to use as your criteria.
5. Click on Dance field.
A drop down arrow
appears in the field where
the cursor is placed.

6. Click on the drop down


arrow button of Dance to
see a list of values used in
this field.
7. Select Kathak from the

P 6

7
list.
This will display only those
records whose Dance field
contains ‘Kathak’.
PM
8. Click on the Name field,
click on the Name list
arrow, and select the name
9
of student (Parveen) from
8 the list.
9. Click on the Toggle Filter
button.

IT PLANET - 8 (GIGABYTE)
Access applies the filter
and displays only those
records whose Dance field
equals "Kathak" AND
whose Name field equals
"Parveen." Only one
record meets the filter
criteria.

You can create an AND criteria statement specifying more than one criteria on the same Filter
by Form tab. For example, you could filter for Name of the student who is learning Kathak AND 25
who is availing transportation by private van.
Using ‘OR’
2 1. Open the table if it is not
already opened.
3
2. Click on Home tab on
4 Ribbon.
3. Click on Advanced button
from Sort & Filter group.
4. Click on Filter By Form.

A Filter by Form sheet opens.


5. Open the list for a field
and select the value that
5 you want.

P 6. Click on the Or tab.


A blank Filter by Form page
PM
8 opens.
7. Repeat step 5 to select
another criterion.
8. Click on Toggle Filter to
apply the filter.
Access will apply the filter and
show you the result.
PM PUBLISHERS PVT. LTD.

Update Your Knowledge


If you have previously performed a filter operation, the last
filter that you ran appears in the form, for your Keyboard Shortcuts
convenience. Delete it from there if you do not want it by
26 clicking on the Advanced button and then clicking on Clear Ctrl + T Toggle AutoFilter
All Filters. If the Clear All Filters command is not available, Ctrl + 3 Move Selected field to view
there are no previously used filters to clear. the filter area
Creating Relationship Between Tables
Relational databases are powerful because they can be used to create relationship among
multiple related tables. For setting relationship, you need at least two tables. You have already
created Students Detail table in previous chapter. Similarly, you need to create one more
table. In this example, we have created one more table named Dance Practice.

For a relationship to exist between two tables,


they must have a common field. For example,
the Students Detail table may have a Student_ID
field, and the Dance Practice table may also have
a Student_ID field. The two tables could be
joined or related by that field. The Field Type
must be the same in both tables for a
relationship to exist.
Dance Practice Table
In most relationships, the primary key field in one table is related to a field in the other table
that is not its primary key. In one table, the field contains unique values, whereas in the other
table it does not. The relationship field in the other table is called foreign key.

P
Relationships are created and managed in a special database view called Relationships window.
You can create relationships between tables from there, dragging a field from one table onto a
field from another.
PM
1. Click on Database Tools tab.
1
2. Click on Relationships button
2 to display the Relationships
window.

IT PLANET - 8 (GIGABYTE)
The Relationships window
appears. If any relationship
3 already exists between the
tables in your database, a
box for each table appears in
the window.
The Show Table dialog box
may also appear, listing all
the tables in your database.
3. If the Show Table dialog box
does not appear, click on
Show Table button to display 27
the dialog box.
4. Click on a table you want to
add to the Relationships
window.

4 5. Click on the Add button to


add the table to the
window.
6. Repeat the steps 4 and 5 for
each table that you want to
add.
7. When you finish adding
tables to the Relationships
window, click on the Close
5
button to remove the Show
7 Table dialog box.

The Relationships window


displays a box for each
table.

P
PM
Now you can create a relationship between tables by identifying the matching fields in the tables.

8. Place your mouse pointer


over the field you want to
use to create a relationship
with another table.
PM PUBLISHERS PVT. LTD.

8
9. Drag the field with mouse
over the other table until a
9 small box appears over the
matching field.
The Edit Relationships dialog
box will appear.

Update Your Knowledge


28 Update Your Knowledge
The quickest way to make changes in Datasheet
view is through the shortcut menu that comes A Primary key field cannot be deleted
up when you right-click a field header. in Access.
Table/Query and Related
table/Query areas display
the names of the tables
you want to create a
relationship between and
the names of the matching
fields.
Relationship Type displays
10 the type of relationship.
10. Click on the Create button
to create a relationship.

A line connects the fields


in the two tables to show
that the relationship is
created.

P
PM
DELETING A RELATIONSHIP BETWEEN TABLES
If you no longer want the relationship between tables, you can delete it.

1. Click on the line for the


relationship you want to
delete.
2. Press the Delete key from
1
the keyboard.

IT PLANET - 8 (GIGABYTE)
A warning dialog box
appears, confirming the
deletion.
3 3. Click on the Yes button to
permanently delete the
relationship.

Update Your Knowledge


! A relationship works by matching the data in the key field.
29
! Primary key is a key which is used to identify the records uniquely. In a table, there can be only
one Primary key.
! Primary key does not allow to enter duplicate values, and primary key field can't be left blank.
Creating Forms
A Form is a view of one or more tables that are designed to be used for data entry and
editing. By creating forms, you can make your database more user-friendly for inexperienced
users who are likely to enter and edit records in it.

CREATING A SIMPLE FORM


Access 2016 makes it very easy to create several simple types of forms based on a table.

Creating a basic form


1. In the navigation Pane, click on
2
the table you want to use as a
3
form.
1 2. Click on the Create tab.
3. Click on Form.

The form appears.

P The default form shows the


fields as fill-in boxes for one
record at a time. This makes it
PM
easier for users to enter a
new record without getting
confused by the multiple rows
and columns of a datasheet
view.

Moving Through the Records


You can move through the records in a Form to review or edit any information you have made.
1. To move to another record, click
PM PUBLISHERS PVT. LTD.

on one of the following buttons:


( ) First record
( ) Previous record
( ) Next record
( ) Last record
2. To move to the specific record,
drag the mouse pointer over the
number of the current record
and then type the number of
1 the record you want to move
and press Enter key.
30 3
3. To start a new blank record,
2
click on New record button.
TYPES OF BASIC FORMS
Multiple Items: In the Multiple-Items form, you will see multiple records
appear at the same time in it.
Split Form: This form shows two parts. Upper part shows the Form, and
lower part shows the datasheet for the table.
Datasheet: This Form just looks like a regular datasheet, but it is actually a
form. It is useful when you want to show a datasheet on a subform.
Modal Dialog: This form is useful for creating navigational menu systems.
This form looks just like a dialog box, but it is actually a form.
Creating a Split Form
1. In the navigation Pane,
2
click on the table you
3 want to use as a form.
2. Click on the Create tab.
1
4 3. Click on More Forms.
4. Click on Split Form.

P Upper part of the screen


shows the Form.
PM
The lower part of the
screen shows the
datasheet for the table.

CHANGING THE VIEW OF FORMS IT PLANET - 8 (GIGABYTE)


You can customize your Form using Design and Layout Views. In Design View, each object
appears as a separate, editable element in the Form. In Layout View, you can re-arrange the
Form controls and adjust their sizes directly on the Form.
In Design View
1. Open the Form.
2
3 2. Click on Design tab.
3. Click on View button.
4. Click on Design View. 31
4 Access displays the Form
design.
In Layout View
1. Click on View button.

1 2. Click on Layout View.


Access displays the Form as it
2 originally appears, but each
element is editable.
To return to Form View, you can
click on View button, and then
click on Form View.

CHANGING FIELD FORMATTING OF FORM


You can add formatting to your field and field labels in the Form. You can change the font,
size, style, alignment, or color of the text. The Format tab appears only when you view the
Form in Layout view.

1. Open the Form in which you

P
3
want to format in Layout view.
2. Click on the field or label that
you want to format.
3. Click on Format tab.
PM
4
2 4. Click on the formatting that
you want to apply, such as fill
color.
You can also apply another
formatting in this field.
Access applies formatting to the
field.

APPLYING THEME
PM PUBLISHERS PVT. LTD.

You can change the theme of a Form using preset designs, fonts, and colors to give it a
different look.

1 1. Open the Form that you want


2
to format in Layout view.
3
2. Click on Design tab on the
Ribbon.
3. Click on Themes button.
The full palette of themes
4
appears.
4. Select a new theme by clicking
32 on it.
Access applies new format
(theme) to the Form.
CHECKLIST
S
Self-Evaluation

ee
agr
ree

Dis
After reading the chapter, I know these points:

Ag
$ I know that in a Table, the selected data appears highlighted on the screen.
$ I know that Find option is used to search a piece of record in Tables and Forms.
$ I know that Datasheet View and Design View are the two views of our table.
$ I know that Sorting means arranging the records in ascending or descending order.
$ I know that Filtering enables us to filter by multiple fields and specify criteria for as
many fields as we like.
$ I know that relationships are created and managed in a special database view called
Relationships window.
$ I know that a Form is a view of one or more tables that are designed to be used for
data entry and editing.

Exercises
A. Tick (ü) the correct answer.

P
1. The selected data appears .............................. on the screen.
a. Colored b. Highlighted c. Gray
2. The shortcut key for 'Find' option is ...................................... .
PM
a. Alt + F b. Ctrl + I c. Ctrl + F
3. You can modify the structure of the table in .................................. .
a. Datasheet View b. Design View c. Query View
4. Arranging records in a particular order is called .............................. .
a. Filtering b. Sorting c. Forming
5. .......................... is designed to enter and edit data in a table very easily.
a. Table b. Query c. Form
B. Write ‘T’ for True and ‘F’ for False statements.

IT PLANET - 8 (GIGABYTE)
1. Find option is used to search a piece of record in Tables and Forms.
2. Primary key field cannot be deleted in Access.
3. Filtering by form enables you to filter by single field.
4. A relationship works by matching the data in the key field.
5. You cannot move through the record in a form to review or edit any information.
C. Fill in the blanks.
1. .............................. check box allows you to find only text that has the same pattern of
uppercase and lowercase characters.
2. .............................. View and .............................. View are the two views in which you can
view your table.
3. ....................... data can help you review and analyze information in your database. 33
4. Primary key does not allow to enter .............................. values.
5. .............................. are created and managed in a Relationship window.
D. Differentiate between the following.
Sorting Filtering
................................................................. .................................................................
................................................................ .................................................................
................................................................ .................................................................
E. Answer in 1-2 sentences.
1. What is the use of toggle filter option?
....................................................................................................................................................
....................................................................................................................................................
2. What do you mean by Relationship window?
....................................................................................................................................................
....................................................................................................................................................
3. What do you mean by Form?
....................................................................................................................................................
....................................................................................................................................................
4. What is the use of Split Form?

F.
P
....................................................................................................................................................
....................................................................................................................................................
Answer Briefly.
PM
1. What is the use of Find and Replace feature in MS-Access?
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
2. What do you mean by Filtering data by Selection and by Form?
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
PM PUBLISHERS PVT. LTD.

G. Application Based Question.


Ruchi has created three tables. These tables are as follows:
Table 1 Table 2 Table 3
Emp_no, Emp_name Designation, Department Emp_no, Contact_no
Now tell between which two tables can she create a relationship and why?
...........................................................................................................................................................

Group Discussion
Divide the students into two groups and discuss the topic, ‘ Datasheet view vs Design view’.

34 Online Link
To learn more about Tables & Forms in Access, visit the website:
https://www.tutorialspoint.com/ms_access/ms_access_objects.htm
Activity Section
Lab Activity
Open Access and do the following:
1. Create a new database named ‘Student’.
2. Create a table using the Datasheet View, containing following fields in it:
Roll No. First Name Last Name Address Date of Birth Phone No. Postal code

3. Store the following records in the table:


1 Mahesh Kumar Delhi 06/08/1997 23456664 110005
2 Suresh Singh Faridabad 15/05/1998 32344333 110020
3 Kamal Sharma Noida 21/11/1996 26545556 201005
4 Rashmi Chawla Ghaziabad 10/10/1998 34355555 110001
5 Aman Gupta Delhi 25/12/1995 65456655 110015
4. Save the above table as ‘Personal Information’, selecting Roll Number as the Primary key field.
5. Select the fourth record and delete it.
6. Rename the field ‘Address’ as ‘Postal Address’.
7. Enter three more sets of records in the table.
8. Delete the field ‘Postal Code’.
9.
Tuition Fee
10. Store the following records in the table:

1 5000
P
Create another table in the same database with the following fields in it using the Design View:
Roll No. Dance Fee

700
Computer Fee

500
Late Fee

0
Total

6200
PM
2 4500 1000 500 100 6100
3 6000 900 1000 500 8400
4 5000 600 500 0 6100
5 6000 500 900 100 7500

11. Save the table as 'Fee Details' without keeping any of the fields as Primary key.
12. Using Form Wizard, make a form with any one of the above tables.
13. Save the Form.
14. Close the Database window and exit Access.

IT PLANET - 8 (GIGABYTE)
Discover More
Popular Database Management Systems
DATABASE DEVELOPER OPERATING SYSTEM COMPUTER TYPE
Access Microsoft Corporation Windows PC, Server, Mobile Devices
SQL Server Microsoft Corporation Windows, Linux, Server PC, Server
MySQL Oracle Corporation Windows, Linux, Mac OS PC, Server
Oracle Oracle Corporation Windows, Linux, Solaris PC, Server, Mainframe,
Mobile Devices
Essbase Oracle Corporation Windows, Linux PC, Server, Mobile Devices
FileMaker FileMaker Inc. Windows, Mac OS PC, Server 35
Sybase Sybase Inc. Windows, Unix PC, Server, Mobile Devices
Db2 IBM Windows, Linux, Unix PC, Server, Mainframe
3 Access - Query & Report

Topics Covered
•The Query •Creating a Query •Understanding Query Options —Using Criteria in Query, Sorting Data
in Query •Creating a Report

In your previous chapters, you learnt how to work in table, create relationship between
tables, and create forms. In this chapter, you will learn how to create Queries and Reports
in Access.

The Query
Query is a request for specific data from the database. The capability of querying a database is
one of the most powerful database features. In other words, a Query is simply a question
represented in a way that Access can understand. If you want to find the answer to a
question, you will have to create a corresponding query first. Once your query has been

P
created, you instruct Access to run the query that is to perform the steps through which you
can obtain your answer. The answer will then be displayed in the Datasheet View.

TYPES OF QUERIES
There are mainly four types of queries: Simple query, Unmatched query, Duplicate query, and
PM
Cross Tab Query.
Simple Query : Simple query is used to ask some particular questions about data in the
database.
Unmatched Query : Unmatched query is used to find the records from one table that do not
have corresponding values in the second table.
Duplicate Query : Duplicate query is used to display the records that have same values for
one or more of the specified fields.
Cross Tab Query : Cross Tab query is used to display the same data, but groups the data
PM PUBLISHERS PVT. LTD.

both horizontally and vertically so that the datasheet can be more


compact and easier to read.

Creating a Query
You can use Design View to manually create a selected query. When you use Design View, you
have more control over the details of the query design. Perform the following steps to begin
creating a query:
1. Click on Create tab.
1
2. Click on Query Design
2
button.
36
The Select Query window
and Show Table dialog box
appear.
Lists of all the tables in your
3 database are shown in this
area.
3. Click on a table that contains
information you want to use
in your query.
4. Click on Add button to add
the table to your query.

A box appears in the


Select Query window,
displaying the fields for
the table you selected.

P 5 5. Repeat steps 3 and 4


for each table you
want to use in your
query.
PM
6. Click on Close button
to hide the Show Table
dialog box.

In case of multiple tables, the field lists are joined by a line. These joined lines link key field that shares
the same field name. The joined lines indicate table relationships that relate the data in one table to

IT PLANET - 8 (GIGABYTE)
the data in the other.

Each box in this area


displays the fields for
one table.
If you add a table
accidentally to the
query and want to
delete it, click on the
table and then press
the Delete key. This
removes the table from
the query, but not from
37
the database.
7. Double-click with the
left mouse button on a
field you want to
include in your query.
7 You can also drag the field
into first empty column in
the query grid.
The field you selected
and the table that
contains the field are
displayed in this area.
8. Repeat step 7 for each
field you want to
include in your query.

RUNNING A QUERY
After the query is created, you need to run the query to produce the results. You should click
on the Run button in the database toolbar to achieve this purpose. Access will then perform
the steps that are necessary to obtain and display the answer. The set of records that make up

P
the answer will be displayed in Datasheet view. Though it might look like a table, it is not
actually so. The data stored in the existing table is used to construct the records. If you were
to change the data in the Students Detail table and then re-run this same query, the results
would reflect the changes.
PM
1. Click on Run button
( ) in the Result
1 group from Design tab
to run the query.

The results of the query


appear in Datasheet View.
This area displays the
names of the fields you
PM PUBLISHERS PVT. LTD.

included in the query.


The records that meet
the conditions you
specified appear in this
area.

SAVING A QUERY
Creating and running a query is a way of extracting information from a database without
changing the data that is stored in the database tables. A query does not store data; it
retrieves data that is stored in tables. Sometimes, to share that table with others, you may
want to save the results of the query as a new table.
38 1. Press Ctrl + S from the keyboard. The Save As dialog box appears.
2. Type a name for your query, and click on OK button to save your query.
When you finish viewing the results of your query, click on Close (x) button to close the query.
Understanding Query Options
The query window is divided into two panes. The top pane displays the tables selected for the
query. The bottom pane displays a design grid where you can add fields to the query and also
specify the criteria.

View button

Database Tables
Run button

Field lists

QBE grid
Field

Table

Sort

Show

Criteria or

P
Database Tables: While creating a query, you can pull fields from more than one table, provided
they have a relationship between them.
Field lists: The complete field list of each table appears in a separate window.
PM
View button: Clicking on this button will switch between Design view and Datasheet view.
Run button: Clicking on the Run button will produce the result of Query.
QBE grid: Query By Example grid contains the fields chosen to be in query—one field per column.
Field: The Field row shows the field name.
Table: The Table row shows the name of the table from where the field has been pulled.
Sort: The Sort row indicates the field(s) by which the results should be sorted.
Show: Any field can be omitted from the results by deselecting its checkbox.

IT PLANET - 8 (GIGABYTE)
Criteria: The Criteria rows hold the filters you want to apply.
Or: Additional criteria can be entered in the Or row.

USING CRITERIA IN QUERY


You can find specific records in your database by using criteria. Criteria are conditions that
identify the records you want to find.

Using Text Data


While using queries, you usually look for the records that satisfy some criterion. You might
want to find the list of students who are learning Kathak dance. To enter criteria, enter the
name of dance in the Criteria row in the design grid below the field name to which the
criterion applies. For example, to indicate that the name of the dance must be Kathak, you 39
must first add the dance field to the design grid. You would then type Kathak in the Criteria
row below the Dance field, and click on Run button in the Ribbon to run the Query.
1 1. Open the query in
Design View.
3
2. Click in the Criteria field
and type the data that
you want to view.
In this example, we list a
Dance name (Kathak) as the
criterion.
3. Click on Run button to
see the results.
2

The table now shows only the


records matching the query.
This example lists records
in which only Kathak is
listed as the Dance name.

Using Wildcards in Query


P
Wildcards are symbols that represent any character or combination of characters. Access
provides two special wildcards. The asterisk (*), which is the first of the two wildcards,
represents any collection of characters. Thus, R* represents the letter R, followed by any
PM
collection of characters. The other wildcard symbol is the question mark (?), which represents
any individual character. Thus R?vi represents the letter R, followed by any single character
that follows the letter, such as in ‘Ravi’.
1. Click on the Criteria area
for the field you want to
3 use to find specific
records.
2. Type the criteria R* and
then press the Enter key.
PM PUBLISHERS PVT. LTD.

Access may add


quotation marks (“ ”) or
number signs (#) to the
criteria you type.
2 3. Click on Run button.
1

The result is displayed.


Only the students whose
names start with R are
included.
40

Activity Time: Try the usage of second wildcard (?) in the lab.
Using Compound Criteria
Often, more than one criterion might be available to satisfy the data you are searching. This is
called compound criteria. There are two types of compound criteria.
In the AND criterion, each individual criterion must be true in order for the compound criteria
to be true. The OR criterion is true provided either of the individual criterion is true.
Using Compound Operator
If you do not specify a criteria, Access assumes that the criteria you have entered involve
equality (exact matches). If you want something other than the exact match, you can specify
ranges of value by using comparison operator. The comparison operators are > (greater than),
< (less than), >= (greater than or equal to), <= (less than or equal to), and <> (not equal to).

Let us find the students whose Total Fee is more than 2500.

1. Click the Criteria


area for the field
3 you want to use to
find specific

P records.
2. Type the criteria
(>2500).
3. Click on Run
button.
PM
1 2

The result of the


query appears.
In this example, Access
found students whose

IT PLANET - 8 (GIGABYTE)
total fee amount is
more than 2500.

SORTING DATA IN QUERY


Sorting can be very important in queries. For example, you may want to see the dance forms in
which the students are participating and would like them to be arranged in an alphabetical order.
You have to sort the records to order them in the answer to a particular query. The field or
fields on which the records are sorted is called the sort key. If you are sorting on more than one 41
field, the more important field is called the major key (also called the primary sort key), and the
less important field is called the minor key (also called the secondary sort key).
Let us find the Dance forms in alphabetical order.
1. Click on the Sort area for
the field you want to
4 use.
A drop down arrow button
appears.
2. Click on the drop down
arrow button.
3. Click the way you want
to sort (Ascending,
1 2
Descending, Not Sorted).
3
4. Click on Run button.

The records appear in


the order you specified.
In this example, the
Dance is sorted in
ascending order.

P Repeat steps 1 to 3,
selecting (not sorted) in step
3, if you do not want to use
a field to sort the query
PM
results any longer.
DELETING A FIELD IN A QUERY
You can delete an unwanted field from your query. Deleting a field from a query does not
delete the field from the table you used to create the query.

1. Position the mouse


directly above the field
2 you want to delete.
Mouse pointer changes
to ( ).
PM PUBLISHERS PVT. LTD.

Then click to select the


field.
1 2. Click on Delete Columns.
The field disappears from
your query.

HIDING A FIELD IN A QUERY


You can hide a field without removing it from the query grid.
1. Deselect the check box for the field you want to hide in the Update Your Knowledge
Show row of query grid.
42 You can sort data in a specified
2. Click on Run.
sequence—alphabetically, numerically, or
The datasheet opens, showing the query results. The field you by data.
hide does not appear.
Creating a Report
A report is a database object used to display data from a query and/or table in an appealing
way. Reports are specially designed to be printed. A report can have more elaborate formatting
and layouts than other objects you can print.
You can create basic reports with default settings, or you can create custom layouts by using
the exact settings that work best for your situation.
The portion at the top of the report called page header contains a custom title. The contents
of this page header are displayed at the top of each page. The detail lines, which are the lines
printed for each record contain only those fields you specify and in the order you specify.
A report consists of information that is pulled from tables or queries. The tables or queries
that provide the underlying data are also known as the record source of the report.

CREATING SIMPLE REPORT USING REPORT TOOL


You can create a simple report using Report tool as it generates a report immediately, without
prompting you for information. The report displays all the fields from the underlying table. You
can save the report, and modify it in Layout View or Design View so that it better serves your
purpose.

2
P 3
1. Click on the table or
query on which you
want to base the
report from the
PM
Navigation Pane.
1 2. Click on Create tab.
3. Click on Report from
Reports group.

Access builds the report


and displays it in Layout

IT PLANET - 8 (GIGABYTE)
View.
After viewing the report,
you can save it, and then
close both the report
and the underlying table
that you used as a
record source.

43
CREATING A BLANK REPORT
Blank Report is a very quick way to build a report if you want to put only a few fields on your
report.
1. Click on Create tab.
1
2 2. Click on Blank
Report from Reports
group.

A blank report is
displayed in the Layout
View, and the Field List
pane is displayed on the
right side of the Access
window.
3
3. Click on Show all
tables.
4. In the Field List
pane, click on the

P 4
plus sign that
precedes the table
name the fields of
which you want to
PM
see on the report.

5. Drag each field onto


the report, one at a
time, or hold down
Ctrl key and select
several fields and
5 then drag them onto
the report at the
same time.
PM PUBLISHERS PVT. LTD.

After dragging all the fields, you can use the tools in the Controls group on the Format tab to add a
logo, title, page numbers, or the date and time to the report.

Update Your Knowledge


! You can design your own reports from scratch by using either Layout view or Design view. However, Layout
view is much easier to work with because it resembles the actual appearance of report more closely.
44 ! The default page size for a report is the Letter size, which is 8.5 inches × 11 inches. You can set the page to
any size you like as well as switch between portrait and landscape.
CHECKLIST
S
Self-Evaluation

ee
agr
ree

Dis
After reading the chapter, I know these points:

Ag
$ I know that a query is a question represented in a way that Access can understand.
$ I know that there are mainly four types of queries: Simple query, Unmatched query,
Duplicate query, and Cross Tab query.
$ I know that after creating a query, we need to run it for producing the result.
$ I know that Criteria are conditions that identify the records we want to find.
$ I know that a report presents the data in an organized manner.
$ I know that the top portion of the report is called Page Header.
$ I know that a simple report can be created using Report tool as it generates a
report immediately, without prompting us for information.

Exercises
A. Tick [ü] the correct answer.

a. Form

a. Cross tab
P
1. A question represented in a way that Access can understand is called a ...................... .
b. Query

b. Simple
c. Datasheet
2. ……....… query displays the same data, but groups the data both horizontally and vertically.
c. Duplicate
PM
3. ……………......... window displays the fields for the table you selected to apply query.
a. Select Query b. Show table c. Show Query
4. While sorting more than one field, the more important field is called .......................... .
a. Minor key b. Enter key c. Major key
5. The two special wild cards for Query provided by Access are ................................ .
a. * and / b. * and ? c. + and ?
6. A database object for displaying data from a table in an appealing way is known as ........... .
a. Report b. Query c. Datasheet

IT PLANET - 8 (GIGABYTE)
B. Write ‘T’ for True and F’ for False statements.
1. In Microsoft Access there are mainly four types of queries.
2. You cannot remove the table from the query once it is added.
3. You can sort data in a specified sequence— alphabetically, numerically, or by data.
4. Wildcards are conditions that identify the records we want to find.
5. Page header provides the data for creating reports.
C. Fill in the blanks.
1. A query can be created using ............................. and ............................. .
2. The conditions that identify the records you want to find are called ............................. .
3. .......................... are symbols that represent any character or combination of characters. 45
4. The field on which the records are sorted is called the ............................. .
5. The lines that are printed for each record are called ............................. in Report.
D. Differentiate between the following.
Major Key Minor Key
................................................................. .................................................................
.............................................................. .................................................................
.............................................................. .................................................................
E. Answer in 1-2 sentences.
1. What do you understand by query?
...................................................................................................................................................
...................................................................................................................................................
2. What do you mean by Compound Criteria?
...................................................................................................................................................
...................................................................................................................................................
3. Why do we need sorting?
...................................................................................................................................................
...................................................................................................................................................
4. What do you mean by report?

P
...................................................................................................................................................
...................................................................................................................................................
PM
F. Answer Briefly.
1. What is the use of wildcards in a query?
..................................................................................................................................................
..................................................................................................................................................
...................................................................................................................................................
2. Explain the components of Reports.
..................................................................................................................................................
..................................................................................................................................................
PM PUBLISHERS PVT. LTD.

...................................................................................................................................................
G. Application Based Question.
The librarian of your school has asked you to make a database table in Access so that he could
quickly enter the records of books which are taken by the students to their homes and then
submitted back after a few days. Make a list of fields you would like to add to your table.
..........................................................................................................................................................
Group Discussion
Divide the students into groups and discuss the importance of Query in the database.

46 Online Link
To learn more about Query & Report in Access, visit the website:
https://www.multisoftsystems.com/assessments/ms-access-practice-test
Activity Section
Lab Activity
Create a table ‘Employee’ in Design View and enter the following data.
Field name Data type Description
Emp. No. Number Employee's identification number
Emp. Name Short Text Employee's name
Designation Short Text Designation of the employee
Pay-Scale Number Pay scale of the employee
a. Select ‘Emp. No.’ as the Primary key and save the table structure.
b. Create a Form for the table and enter the data as given below.
Emp. No. Emp. Name Designation Pay-Scale
101 Mr Harish Manager 60,000
102 Mr Praveen Sr. Executive 50,000
103 Mr Kamal Tech. head 75,000
104 Mr Gopal Production Manager 60,000
105 Mr Aman Designer 40,000
106 Mr Rajesh
P Sales Manager 50,000
c. Click on the Create tab and click on the Query Design button in the Database window.
d. Click on the table name ‘Employee’ and click on Add button.
PM
e. Click on Close button.
f. In the Query Design window, click and drag the fields to the ‘fields’ row in the bottom half
portion of the window.
g. Run the query and save the query as ‘Query 1’.
h. Close the window.

Technology Trailblazers
IT PLANET - 8 (GIGABYTE)
Edgar Frank Codd

? Created: Relational Database Design

Edgar Frank (E. F.) Codd created relational database design which is the
structure for most of the small and large databases used today.
After attending college in England and serving in the Royal Air Force, he
began working at IBM as a programming mathematician. He developed and
promoted his relational model in a series of research papers beginning with
his 1969 IBM report, “Derivability, Redundancy, and Consistency of Relations
Stored in Large Data Banks.” 47
As a result of his research, IBM introduced the first version of Structured
Query Language (SQL) in 1982.
4 HTML - Form, Multimedia & CSS

Topics Covered
•HTML •Creating Forms •Adding Multimedia •Cascading Style Sheets (CSS)

Hello Friends! Till now you have learnt about creating, formatting, linking, adding images and
tables in the web page using HTML5 language. In this chapter, you will move ahead and learn
more about HTML5 like adding Forms, Multimedia and CSS to web pages.

HTML
HTML (Hyper Text Markup Language) is a language in which you can make web pages on the
Internet and view them using a web browser. HTML documents are made up of text content
and special codes known as Tags that tell web browsers how to display the content.

Creating Forms

P
You can use forms to collect information from the people who visit your website. A form has
input fields to remind users to enter information and limits choices to valid options to avoid
incorrect data entry. Forms provide an easy way to collect required information from web page
visitors.
PM
Web page forms have three important parts: a <FORM> tag, form input elements, and a
Submit button. While designing and building a form, you write HTML to define the different
objects that allow users to type or select information. These objects can include text fields,
radio buttons, check boxes and more. All forms should include a Submit button for sending
the data to a web server for processing.

INPUT CONTROL
An input control is a type of input mechanism on a form. A form may contain several different
types of input controls classified as data or text input controls.
PM PUBLISHERS PVT. LTD.

A data input control can be a Radio button (Radio), a Check box (Checkbox), a Submit button
(Submit), a Reset button (Reset), or a Selection menu (Select).
A text input control allows the user to enter text through the following:
1. a text box (text), for small amount of text.
2. a textarea box (textarea), for larger amount of text.
3. a password text box (password), for entering a password.
A text control creates a text box that is used for a single line of input. The text control has two
attributes:
1. Size, which determines the number of characters that are displayed on the form.
2. Maxlength, which specifies the maximum length of the input field.
48
A password control also creates a text box used for a single line of input, except that the
characters entered into the field can appear as asterisks or bullets. A password text box holds
the password entered by a visitor.
A radio control limits the web page visitor to only one choice from a list of choices. Each
choice is preceded by a radio or option button, which typically appears as an open circle.
A checkbox control allows a web page visitor to select more than one choice from a list of
choices. Each choice in a checkbox list can be either on or off. By default, all checkboxes are
deselected.
A select control creates a selection menu from which the visitor selects one or more choices.
This prevents the visitor from having to type information into a text or textarea field.
A textarea control creates a field that allows multiple lines of input. Textarea fields are useful
when an extensive amount of input is required from or desired by a web page visitor.
The Submit button sends the information to the appropriate location for processing. A web
page form must include a Submit button.
The Reset button clears any input that was entered in the form, resetting the input controls
back to the default. A web page form must also include a Reset button.

SETTING UP A FORM
You must set up a form before you can add information to the form. To set up a form, we need
to specify two important information, i.e., METHOD and ACTION property of <FORM> tag.

property, which are: P


METHOD property tells the form how to transfer the data to the form processor, which is your
CGI script or your e-mail address. We can assign either of the two values to the METHOD

a. GET - If the METHOD property of FORM is set to GET, then the data in the form is given
to the form processor in the form of an environment variable (QUERY_STRING). If no
PM
METHOD property is given in <FORM> tag, the default property is set to GET.
b. POST - If the METHOD property of FORM is set to POST, then the data in the form is
given to the form processor as the standard input to the program.
ACTION property of the <FORM> tag tells what action the form should take when the user
presses the SUBMIT button.
Note: If you like to receive the e-mail without an attachment in a text form, then in the
<FORM> tag type ENCTYPE = “TEXT/PLAIN”.
1. Type <FORM METHOD = “post” where

IT PLANET - 8 (GIGABYTE)
<!DOCTYPE html>
<HTML> you want the form to appear on your
<HEAD> web page. Then press SPACEBAR.
<TITLE> Creating Text Box </TITLE> 2. Type ACTION = “?”>, replacing ? with
</HEAD> the location of your CGI script on your
<BODY> web server that will process the
1 2
information submitted by your form.
<FORM METHOD=“POST” ACTION = “mailto: Or
[email protected]” ENCTYPE=“TEXTPLAIN”> If you like to get the information to
your e-mail address, type ACTION =
</FORM> 3 “mailto: ?”>, replacing ? with your e-
</BODY> mail address.
</HTML>
49
If you want to receive the information as text in your e-mail, in the <FORM> tag, type ENCTYPE =
“TEXT/PLAIN”
3. Type </FORM> to complete the form.
CREATING A TEXT BOX
You can create a text box that allows readers to enter a line of text. Text boxes are normally
used for entering names and addresses.

<!DOCTYPE html> 1. Between the <FORM>


<HTML> and </FORM> tags,
<HEAD> type the text you want
<TITLE> Creating Text Box </TITLE> to appear beside the
</HEAD> text box. Then press
<BODY> SPACEBAR.
<H2>Please1 provide the following information</H2> 2. Type <INPUT TYPE =
2
<FORM METHOD=“POST” ACTION=“mailto:[email protected]”> “text”, and then press
<P>Enter Your Name: <INPUT TYPE=“text” Name=“urname” 3 SPACEBAR.
SIZE=“30” MAXLENGTH=“20”>
3. Type NAME = “?”,
4 5 6 replacing ? with a
</FORM>
word that describes
</BODY>
the text box. Then
</HTML>
press SPACEBAR.

P 4. To define the width of


the text box, type SIZE
=“?”, replacing ? with
the width you want to
use for the text box.
PM
5. If you want to define
the maximum number
of characters that
visitor can enter in a
text box, type
MAXLENGTH = “?”,
replacing ? with the
maximum number of
characters.
6. Type > to complete
PM PUBLISHERS PVT. LTD.

the text box.

The web browser displays the text box.

Adding a default value to a text box


A default text value appears in the text box when the user views the form. You can use
default values to display instructions about the type of data required, give users an
50
example of the data you are looking for, or show a popular choice or response. To
specify a default, you can add the VALUE attribute to the <INPUT> tag.
For example: <INPUT TYPE=“text” NAME=“email” VALUE=“Enter your e-mail address”>
CREATING A PASSWORD BOX
You can create a password box that allows readers to enter confidential or secret information,
such as credit card number or password. It differs from standard text box in a manner that
when a user types in any character, an asterisk (*) or a bullet (•) appears for each character on
screen. So, it prevents others from reading the information.
1. Between the <FORM> and
<!DOCTYPE html>
</FORM> tags, type the
<HTML>
<HEAD>
text you want to appear
<TITLE> Password Box </TITLE>
beside the password box.
</HEAD>
Then press SPACEBAR.
<BODY> 2. Type <INPUT TYPE =
<H2>Please provide the following information</H2> “password” and then press
<FORM METHOD=“POST” SPACEBAR.
ACTION=“mailto:[email protected]”> 3. Type NAME = “?”,
<P>Name: <INPUT TYPE=“text” NAME=“urname” SIZE=“30” replacing ? with a word
MAXLENGTH=“20”></P> that describes the
<BR> password box. Then press
Address: <INPUT TYPE=“text” NAME=“address” SIZE=“60”
SPACEBAR.
MAXLENGTH=“50”>
<BR>

MAXLENGTH=“20”>
<BR>
P
City: <INPUT TYPE=“text” NAME=“city” SIZE=“20”

Pin Code: <INPUT TYPE=“text” NAME=“Pincode” SIZE=“6”


4. To define the width of the
password box, type SIZE =
“?”, replacing ? with the
width you want to use in
characters.
PM
MAXLENGTH=“6”> 5. If you want to define the
<BR> maximum number of
Mobile: <INPUT TYPE=“text” NAME=“mobile” SIZE=“10” characters that visitor can
MAXLENGTH=“10”> enter in a password box,
<BR> 1 type MAXLENGTH = “?”,
2 3
<BR> replacing ? with the
Credit Card Number: <INPUT TYPE=“password” NAME=“credit” maximum number of
SIZE=“20” MAXLENGTH=“15”>
characters.
</FORM>
4 5 6
</BODY> 6. Type > to complete the

IT PLANET - 8 (GIGABYTE)
</HTML> text box.

The web browser displays


the password box.
When a user types characters
in the password box, a bullet
( . ) or an asterisk ( * )
appears for each character, in
the password box, on screen.

51
CREATING A LARGE TEXT AREA
You can create a large text area that allows visitors to enter several lines of text. A large text
area is ideally used for getting comments or feedback from the visitors.
1. Between the <FORM> and
<!DOCTYPE html>
</FORM> tags, type the
<HTML>
text you want to appear
<HEAD>
beside or above the text
<TITLE> Large Text Area </TITLE>
area. Then press the
</HEAD>
SPACEBAR.
<BODY>
<H2>Please provide the following information</H2> 2. Type <TEXTAREA and then
<FORM METHOD=“POST” press the SPACEBAR.
ACTION=“mailto:[email protected]”> 3. Type NAME = “?”,
<P>Name: <INPUT TYPE=“text” NAME=“urname” SIZE=“30” replacing ? with a word
MAXLENGTH=“20”></P> that describes the text
<BR> area. Then press the
Address: <INPUT TYPE=“text” NAME=“address” SIZE=“60” SPACEBAR.
MAXLENGTH=“50”>
<BR> 4. Type ROWS =“?”, replacing
City: <INPUT TYPE=“text” NAME=“city” SIZE=“20” ? with the height for the
MAXLENGTH=“20”> text area in rows. Then
<BR>

MAXLENGTH=“6”>
<BR>
P
Pin Code: <INPUT TYPE=“text” NAME=“Pincode” SIZE=“6”
press the SPACEBAR.
5. Type COLS =“?”, replacing
? with the width for the
text area in characters.
PM
Mobile: <INPUT TYPE=“text” NAME=“mobile” SIZE=“10” Then press the SPACEBAR.
MAXLENGTH=“10”>
1 6. Type WRAP> if you want
<BR><BR>
to have the text that
Comment:
2 3 4 5 6 visitor types, automatically
<BR>
wrapped within the text area.
<TEXTAREA NAME=“comments” ROWS=“4” COLS=“50” WRAP>
</TEXTAREA> 7 7. Type </TEXTAREA> to
</FORM> complete the text area
</BODY> </HTML> and skip step 4 if you do
not want other checkbox
to be selected.
PM PUBLISHERS PVT. LTD.

The web browser


displays the text
area.

Another way to keep users from typing text into a large text area
52 If you want to display default text in a text area and do not want users to move or edit
the text, you can use the READONLY attribute. For example, you might use a large text
area to explain something about your form or offer detailed instructions. You can place
the READONLY attribute without assigning it a value within the <TEXTAREA> tag.
CREATING CHECKBOXES
You can include checkboxes in a form if you want visitors to be able to select one or more
options. While creating checkboxes, you need to specify some information:
! You need to specify a word that describes the group of checkboxes. This is done using the
NAME attribute.
! You need to specify a word that describes each checkbox. This is done using the VALUE
attribute.
! You need to specify the text you want to appear beside each checkbox on your web page.

1. Between the <FORM>


<P>Name: <INPUT TYPE=“text” NAME=“urname” SIZE=“30”
MAXLENGTH=“20”></P> and </FORM> tags, type
<BR>Address: <INPUT TYPE=“text” NAME=“address” SIZE=“60” <INPUT TYPE =
MAXLENGTH=“50”> “checkbox” and then
<BR>City: <INPUT TYPE=“text” NAME=“city” SIZE=“20” press the SPACEBAR.
MAXLENGTH=“20”> 2. Type NAME = “?”,
<BR>Pin Code: <INPUT TYPE=“text” NAME=“Pincode” SIZE=“6” replacing ? with a word
MAXLENGTH=“6”> that describes the group
<BR>Mobile: <INPUT TYPE=“text” NAME=“mobile” SIZE=“10” of checkboxes you want
MAXLENGTH=“10”> to create. Then press
<BR><BR>

CHECKED>Cricket
<INPUT
4
1
Which Sports You Like?

TYPE=“checkbox”
5 6
P 2

NAME=“sports”
3
<BR><INPUT TYPE=“checkbox” NAME=“sports” VALUE=“Cricket”
the SPACEBAR.
3. To specify the
information for one
checkbox, type VALUE =
PM
VALUE=“Football”>Football “?”, replacing ? with a
<INPUT TYPE=“checkbox” NAME=“sports” word that describes the
VALUE=“Hockey”>Hockey checkbox.
<INPUT TYPE=“checkbox” NAME=“sports” VALUE=“Badminton”> 4. If you want the checkbox
Badminton to be selected
<INPUT TYPE=“checkbox” NAME=“sports” automatically, press the
VALUE=“Tennis”>Tennis SPACEBAR and then
<BR><BR> type CHECKED.
Comment:
<BR> 5. Type > to complete the
checkbox.

IT PLANET - 8 (GIGABYTE)
<TEXTAREA NAME=“comments” ROWS=“4” COLS=“50” WRAP>
</TEXTAREA> 6. Type the text you want
</FORM> to appear beside the
</BODY> </HTML> checkbox on your web
page.
7. Repeat steps from 1 to
6 for each checkbox you
want to create and skip
step 4 if you do not
want other checkboxes
to be selected.
The web browser
displays the checkboxes. 53
CREATING RADIO BUTTONS
You can include radio buttons in a form if you want visitors to select only one of the several
options. While creating radio buttons, you need to specify some information.
! You need to specify a word that describes the group of radio buttons by using the NAME
attribute.
! You need to specify a word that describes each radio button. This is done using the VALUE
attribute.
! You need to specify the text you want to appear beside each radio button on your web page.
1. Between the <FORM> and
<BR>City: <INPUT TYPE=“text” NAME=“city” SIZE=“20”
</FORM> tags, type <INPUT
MAXLENGTH=“20”>
TYPE = “radio” and then
<BR>Pin Code: <INPUT TYPE=“text” NAME=“Pincode”
SIZE=“6” MAXLENGTH=“6”>
press the SPACEBAR.
<BR>Mobile: <INPUT TYPE=“text” NAME=“mobile” 2. Type NAME = “?”, replacing
SIZE=“10” MAXLENGTH=“10”> ? with a word that describes
<BR><BR> the group of radio buttons
1 2 3
How do you rate this Web site? you want to create. Then
<BR><INPUT TYPE=“radio” NAME=“rate” VALUE=“Superb” press the SPACEBAR.
CHECKED>Superb
3. To specify the information for
<INPUT
4 TYPE=“radio”
5 6
Good”>Very Good
P
NAME=“rate” VALUE=“Very

<INPUT TYPE=“radio” NAME=“rate” VALUE=“Good”>Good


<INPUT TYPE=“radio” NAME=“rate”
VALUE=“Average”>Average
one radio button, type VALUE
= “?”, replacing ? with a
word that describes radio
button.
PM
<BR><BR> 4. If you want the radio button
Tips/Suggestions for improvements: to be selected automatically,
<BR> press the SPACEBAR and
<TEXTAREA NAME=“comments” ROWS=“4” COLS=“50” then type CHECKED.
WRAP> 5. Type > to complete the radio
</TEXTAREA> button.
</FORM>
6. Type the text you want to
</BODY> </HTML>
appear beside the radio
button on your web page.
7. Repeat steps from 1 to 6 for
PM PUBLISHERS PVT. LTD.

each radio button you want to


create.

The web browser


displays the radio
buttons.

Giving radio buttons in a set of different names


54 ! When radio buttons have different NAME attributes, the browser treats them as parts of different radio
button sets. This means, the user is able to turn on more than one of them on at a time by clicking.
Make sure all the radio buttons in a set have the same NAME attribute to avoid this.
! You can use the CHECKED attribute to show one radio button in the group as selected by default.
CREATING A LIST BOX (Menu)
You can create a List Box that offers visitors a list of options to choose from. Normally, List Boxes
are used to display lists of products, states, age groups, etc. While creating a List Box, you need to
specify some information.
! You need to specify a word that describes the List Box. This is done using the NAME attribute.
! You need to specify a word that describes the content. This is done using the VALUE attribute.
! You need to specify the text you want to appear for each List Box option on your web page.
1. Between the <FORM> and
<P>Name: <INPUT TYPE=“text” NAME=“urname” SIZE=“30”
MAXLENGTH=“20”></P> </FORM> tags, type
<BR>Address: <INPUT TYPE=“text” NAME=“address” SIZE=“60” <SELECT NAME = “?”,
MAXLENGTH=“50”> replacing ? with a word
1 2 that describes the List Box
<BR><BR>City/State:
3<BR><SELECT NAME=“city” SIZE=“5”> you want to create. Then
<OPTION VALUE=“Amritsar”>Amritsar 4 press the SPACEBAR.
<OPTION VALUE=“Karnal”>Karnal 2. Type SIZE = “?”, replacing ?
<OPTION VALUE=“Noida”>Noida with the number of
6 7
<OPTION VALUE=“Ghaziabad”>Ghaziabad options you want visitors
<OPTION VALUE=“New Delhi” SELECTED>New Delhi</SELECT> to see in the List Box

P
<BR><BR>Pin Code: <INPUT TYPE=“text” NAME=“Pincode”
SIZE=“6” MAXLENGTH=“6”>
<BR>Mobile: <INPUT TYPE=“text” NAME=“mobile” SIZE=“10”
MAXLENGTH=“10”>
<BR><BR>
without having to use the
Scroll bar.
3. To specify the information
for one List Box option,
type <OPTION VALUE =
PM
How do you rate this Web site? “?”>, replacing ? with a
<BR><INPUT TYPE=“radio” NAME=“rate” VALUE=“Superb” word that describes the
CHECKED>Superb
List Box content.
<INPUT TYPE=“radio” NAME=“rate” VALUE=“Very Good”>Very
Good 4. Type the text you want to
<INPUT TYPE=“radio” NAME=“rate” VALUE=“Good”>Good appear for the List Box
<INPUT TYPE=“radio” NAME=“rate” VALUE=“Average”>Average option on your web page.
<BR><BR> 5. Repeat steps 3 and 4 for
Tips/Suggestions for improvements: each List Box option you
<BR> want.
6. If you want a List Box option

IT PLANET - 8 (GIGABYTE)
to be selected automatically,
press the SPACEBAR and
then type SELECTED after
the VALUE attribute for the
List Box option.
7. Type </SELECT>.
The web browser displays the List Box.

Displaying the entire List box list on the form


Type the number of List Box entries as the SIZE attribute value. This makes
the List Box appear as a rectangular box that displays all the items in the list. 55
If the List Box list is long, it may take up more room on the form than you
want, making users scroll to view the selections. If you prefer to save room
on your form, keep the List Box size as 1. This creates a drop-down list.
CREATING A SUBMIT BUTTON
You can create a submit button that visitors can click to send the information, they entered in
your form, to your web server or your e-mail.

<BR> 1. Between the <FORM> and


<TEXTAREA NAME=“comments” ROWS=“4” COLS=“50” WRAP> </FORM> tags, type
</TEXTAREA> 1
2 <INPUT TYPE = “Submit”.
<P><INPUT TYPE=“Submit” VALUE=“SUBMIT”></P> Then press the SPACEBAR.
</FORM> 2. Type VALUE = “?”,
</BODY> replacing ? with the text
</HTML> you want to appear on the
Submit button.

The web browser displays


the Submit button.

When the user clicks the


Submit button, the data in the
form is processed and sent to

P the destination specified in the


<FORM> tag.
PM
CREATING A RESET BUTTON
You can create a reset button that visitors can click to clear the information they entered in
your form.
<P> 1. Between the <FORM> and
<INPUT TYPE=“Submit” VALUE=“SUBMIT”> </FORM> tags, type <INPUT TYPE
<INPUT TYPE=“Reset” VALUE=“RESET”> 2 = “Reset”. Then press SPACEBAR.
PM PUBLISHERS PVT. LTD.

</P> 1 2. Type VALUE = “?”, replacing ? with


</FORM> the text you want to appear on
</BODY> the Reset button.
</HTML>

The web browser displays the


Reset button.

When the user clicks the Reset button,


the form is reset to its original
56 setting.
Adding Multimedia
You can incorporate multimedia elements into your own HTML pages to enhance your site
message, illustrate a product or service, or simply entertain.
You can deliver multimedia files to your Website visitors in several ways. You can link to an
external media file, embed the file into your page, or stream the file. Make sure the files you
use are in a format commonly used on the Web. Whenever possible, you should use small files.
Large files take a long time to transfer to a computer.
HTML5 features include native audio and video support without the need for Flash player. The
HTML5 <audio> and <video> tags make it simple to add media to a website. You need to set
src attribute to identify the media source and include controls attribute so the user can play
and pause the media.

EMBEDDING AUDIO
HTML5 supports <audio> tag which is used to embed sound content in an HTML document.

<!DOCTYPE html> 1. Type <AUDIO SRC=“?”,


<HTML> replacing ? with the
location or name of the
<HEAD>
<TITLE>AUDIO</TITLE>
</HEAD>
<BODY> P
<H1 ALIGN="center"><FONT COLOR="#FF0000">Welcome To The
sound file.
2. Press Spacebar, and
type AUTOPLAY
CONTROLS>.
PM
Musical Section</FONT></H1>
3. Type </AUDIO>.
<P ALIGN="CENTER"> <IMG SRC="musical.jpg"></P>
1
<H2 ALIGN="LEFT"><U><I>Music</I></U></H2>
<AUDIO SRC="song.mp3" AUTOPLAY CONTROLS> 2
</AUDIO> 3
</BODY>
</HTML>

The web browser displays


the music controls and

IT PLANET - 8 (GIGABYTE)
starts playing the audio
song because we have
given Autoplay option.
In some browsers, you
need to click on play
button to start the video

Update Your Knowledge


The <audio> tag might not work in
some browsers that do not support
HTML5 and the file format.
Currently, the file formats supported 57
are WAV, Mp3, and Ogg.
EMBEDDING VIDEO
HTML5 supports <video> tag which is used to embed video content in an HTML document.

<!DOCTYPE html> 1. Type <VIDEO SRC=“?”, replacing


<HTML> ? with the location or name of
<HEAD> the video file.
<TITLE>VIDEO</TITLE> 2. Type WIDTH=“?”, replacing ?
</HEAD> with the width measurement
<BODY> you want to set.
<H1 ALIGN="LEFT"><FONT COLOR="#FF0000">Welcome 3. Give a space by pressing the
To The Movie Section</FONT></H1>
Spacebar key.
<P ALIGN="LEFT"> <IMG SRC="video.jpg"></P>
1 2
<H2 ALIGN="LEFT"><U><I>Video</I></U></H2>
4 4. Type HEIGHT=“?”, replacing ?
<VIDEO SRC="cow.mp4" WIDTH="300" HEIGHT="200" with the height measurement
AUTOPLAY CONTROLS> 5 you want to set.
</VIDEO> 6 5. Press Spacebar, and type
</BODY> AUTOPLAY CONTROLS>.
</HTML>
6. Type </VIDEO>.

P The web browser displays the video


and starts playing it because we
have given Autoplay option.
In some browsers, you need to click
on play button to start the video.
PM
When you place your mouse
pointer on the video, controls will
appear.

Update Your Knowledge


The <video> tag might not work in
some browsers that do not support
HTML5 and the file format.
PM PUBLISHERS PVT. LTD.

Currently, the file formats supported


are MP4, WebM, and Ogg.

The HTML5 audio and video tags can have a number of attributes to control the look and feel.

ATTRIBUTES DESCRIPTION
AUTOPLAY Plays the audio or video file automatically when the web page is loaded

CONTROLS Display the controls on the web page

SRC Specifies the URL of audio or video file

LOOP Replays the file once it is finished


58 Specifies the height of the video player displayed on the web page
HEIGHT
WIDTH Specifies the width of the video player displayed on the web page
Cascading Style Sheets (CSS)
In HTML, you use tags to alter the style (or look) of a Web page. Altering the style of
individual elements on a Web page is an easy Web development technique to use. With large
Websites, however, it is better to use Cascading Style Sheets to change the style of the Web
page elements. With Cascading Style Sheets or CSS, you write code that allows you to control
an element within a single Web page or throughout an entire Website. For example, changing
a heading color from black to red in a Website that contains hundreds of pages is much easier
to do using a CSS instead of changing the individual headings.
A style sheet is usually a text file that is separate from your HTML document. Style sheets can
also be internal, residing within your HTML code. A style sheet holds formatting codes that
control your Web page appearance.
You can use style sheets to change the look of any Web page element, such as paragraphs,
lists, backgrounds, and more. Anytime you want to apply the formatting from an external style
sheet to an HTML document, you can attach the style sheet to the page using a LINK tag. Style
sheet files have a .css file extension.
Controlling Multiple Pages

P
You can link every page in your Website to a single style sheet. Any changes you make to the
style sheet formatting are reflected in every HTML document linked to the sheet. By storing all
the formatting information in one place, you can easily update the appearance of your site
pages in one fell swoop. This can be a real time-saver if your site consists of lots of pages.
PM
Style Sheet Syntax
Style sheets are made up of rules, and each rule has two distinct parts: a selector and a
declaration. The selector specifies the element to which you want to apply a style rule, and
the declaration specifies the formatting for the selector. For example, in the style rule H2
{color: silver}, the selector is H2 and {color: silver} is the declaration. When applied to a page,
this rule will make all level 2 headings appear in silver.
DIV tag
DIV tag is used for defining a section of your document. With this tag, you can group large

IT PLANET - 8 (GIGABYTE)
section of HTML elements together and format them with CSS. The DIV tag also allows you to
define characteristics for several types of elements at once. For example, you can use the DIV
tag to centre headings and paragraphs at the same time.
INLINE, INTERNAL, AND EXTERNAL STYLE SHEETS
You can connect an HTML document to an inline, internal, and external style sheet.
Inline style sheet is used to apply a unique style to a single HTML element. It uses the style
attribute of an HTML element. E.g. <h1 style = “color: blue”> This is a blue heading. <h1>. It
sets the text color of the <h1> element to blue.
Internal style sheets exist within an HTML page between the <HEAD> and </HEAD> tags while
external style sheets are separate files.
59
External style sheets are useful because you can link them to more than one HTML document.
You might use an internal style sheet if your site consists of a single page.
INTERNAL STYLE SHEET
An internal style sheet is used to define a style for a single HTML page. You can create an
internal style sheet that resides within the <head> tags of your HTML5 document. The styles
of an internal style sheet are defined by <style> and </style> tags, and apply only to the HTML
in that document.
1. On the Web page,
<!DOCTYPE html>
type <STYLE>
<HTML>
between <HEAD> and
<HEAD>
</HEAD> tags to use
<TITLE>INTERNAL STYLE SHEET</TITLE>
a style sheet.
<STYLE> 1
H1{ 3 2. Type a tag you want
</HEAD> to define
2
<BODY> characteristics for.
<H1><CENTER>COMPUTER SYSTEM</CENTER></H1> You can define
<P>A computer is an electronic machine that works under the characteristics for
instructions given by you. It can accept data (input), manipulate the data tags, such as H1(H1
according to specified rules (process), produce results (output), and store headings),
the results for future use.</P>
P(paragraphs), and B
<P>Today, in the age of electronic revolution the computer has become
(bold text).

P
the integral part of our life. We can say that computers have entered into
each and every walk of life either it is home, at work or at school. Most
of our daily activities either involve the use of or depend upon the

<!DOCTYPE html>
3. Type { to begin the
characteristics for the
tag.
4. Type } to end the
PM
characteristics for the
<HTML>
tag.
<HEAD>
<TITLE>INTERNAL STYLE SHEET</TITLE> Enter characteristics
<STYLE> for the tag between
H1{text-align:center;color:red} 4 the brackets { }. A
P{color:blue} 5 semicolon (;) must
</STYLE> 6 separate each
</HEAD> characteristic.
<BODY> 5. Repeat steps 2 to 4
<H1><CENTER>COMPUTER SYSTEM</CENTER></H1> for each tag you want
PM PUBLISHERS PVT. LTD.

<P>A computer is an electronic machine that works under the to define


instructions given by you. It can accept data (input), manipulate the data characteristics for.
according to specified rules (process), produce results (output), and store
the results for future use.</P> 6. Type </STYLE> to
<P>Today, in the age of electronic revolution the computer has become complete the style
sheet.

60

The web browser displays the style specified for the web page.
EXTERNAL STYLE SHEET
You can use an external style sheet to define formatting and layout instructions, and then link
it to more than one HTML document. You can save the style sheet as a text file and assign the
.css file extension to identify the file as a Cascading Style Sheet.

Set up a style sheet for multiple web pages


2 1. Create a new document in a text editor or word processor.
2. Perform steps 2 to 5 of the section of previous page
(Internal Style Sheet) to set up the information for style
sheet.
3. Click on File menu.
3
4. Click on Save.
The Save As dialog box
4
appears.

5 5. Navigate to the folder that contains your


HTML pages.
6. Type a unique file name for your style sheet
and a .css extension. In this example, we

P have given a name as stylesheet.css.


7. Click on Save. Your text editor saves the new
style sheet.
PM
6
7

Link to a Style Sheet


You can link to a style sheet to assign a set of formatting rules to your HTML document. You
can link multiple documents to the same style sheet to give all the pages in your site a
consistent look and feel.
1. Type <LINK REL =
<!DOCTYPE html>
stylesheet TYPE =
<HTML>

IT PLANET - 8 (GIGABYTE)
“text/css” between
<HEAD>
1 2 the <HEAD> and
<TITLE>EXTERNAL STYLE SHEET</TITLE>
</HEAD> tags. Then
<LINK REL = stylesheet TYPE =“text/css” HREF = stylesheet.css>
press SPACEBAR.
</HEAD>
<BODY> 2. Type HREF=?>
<H1><CENTER>COMPUTER SYSTEM</CENTER></H1> replacing ? with the
<P>A computer is an electronic machine that works under the name or location of
instructions given by you. It can accept data (input), manipulate the data the style sheet.
according to specified rules (process), produce results (output), and

The web browser


displays the style
specified for the 61
web page.
INDENTING TEXT THROUGH CSS
An indent is the space between your margin and your text. The indent feature is often used to
set a first-line indent for paragraphs. You can indent the first line of all the paragraphs of the
text on your Web page that uses text-indent property in style sheet.
First set up a style sheet.
<!DOCTYPE html>
<HTML> 1. To indent the first line of all the
<HEAD> paragraphs of the text that uses a
<TITLE>INDENTING TEXT</TITLE> specific tag, position the cursor
<STYLE> between the brackets { } for the
1
H1{font-family:kids;text-align:center;color:red} tag.
P{text-indent:20%} 3 2. Type text-indent: and then press
</STYLE> 2 SPACEBAR.
</HEAD>
3. Type the amount of space for the
<BODY>
indent as a percentage of the
<H1><CENTER>COMPUTER SYSTEM</CENTER></H1>
window (example, 20% or 30%) or
<P>A computer is an electronic machine that works under
the instructions given by you. It can accept data (input), in pixels (example, 20px or 30px).

The first line of all the

P paragraphs in the text


that uses the tag can be
indented by the Web
browser.
PM
CHANGING MARGIN THROUGH CSS
The amount of space that appears around an element is referred to as Margin. Margins can be
set for any Web page element with the margin property. This property can accept four values
for the top, right, bottom, and left edges. You can include two values as an alternative to four
values. These two values set the top and bottom margins to the first value, and the right and
PM PUBLISHERS PVT. LTD.

left margins to the second value. The values can be measured in pixels (px) or as a percentage
of the window. For example, margin: 50px would create a margin that is 50 pixels in width.

First set up a style sheet.


<!DOCTYPE html>
<HTML> 1. To change the margin for every
<HEAD> element that uses a specific tag,
<TITLE>SET MARGIN</TITLE> position the cursor between the
<STYLE> brackets { } for the tag.
1
H1{font-family:Comic Sans MS;text-align:center;color:red} 2. Type margin-?: replacing ? with
P{margin-left:50px} 3 the margin you want to change
</STYLE> 2 (left, right, top, or bottom), and
</HEAD> then press SPACEBAR.
62
<BODY>
3. Type the amount of space for
<H1><CENTER>COMPUTER SYSTEM</CENTER></H1>
the margins in pixels (example
<P>A computer is an electronic machine that works under the
50px).
You can see
every element
that uses the
tag with the
margin you
specified is
displayed in the
Web browser.

CHANGING MARGIN USING DIV TAG


If three values are included, the top edge gets the first value, the left and right edges get the
second value, and the bottom edge gets the third value. If only one value is listed for the
margin property, this value is applied equally to all four edges.

<STYLE>
1. Add the margin style
H1{font-family:Comic Sans MS;text-align:center;color:red} property in div{.
1
P{color:blue} 2 2. Set the margin property
div{color:green;margin:50px 100px 50px 100px} by assigning values to
</STYLE>
</HEAD>
<BODY>
3
P
<H1><CENTER>COMPUTER SYSTEM</CENTER></H1>
<P><div>A computer is an electronic machine that works under the
top, right, bottom and
left margins.
3. Type <div> in the front
of the text you want to
PM
instructions given by you. It can accept
4 data (input), manipulate the display as a margin.
data according to specified rules (process), produce results (output),
and store the results for future use.</div></P>
4. Type </div> after the
<P>Today, in the age of electronic revolution the computer has
text you want to display
as a margin.

The first paragraph


now has margins on
each side.

IT PLANET - 8 (GIGABYTE)
The following table shows you how to apply formatting to your HTML5 elements
using Style Sheet properties in a paragraph.
HTML Formatting Elements Property in Style Sheet Example
Bold text font-weight Property P{font-weight: bold}
Italic text font-style Property P{font-style: italic}
Font Size font-size Property P{font-size: 12pt}
Font font-family Property P{font-family: “Arial”}
Change Case text-transform Property P{text-transform: uppercase}
Text Alignment text-align Property P{text-align: center}
Line Spacing line-height Property P{line-height : 2.0}
63
Text Color color Property P{color: red}
Background Color background Property P{background: blue}
Bullet list-style Property UL{list-style: square}
Number list-style Property OL{list-style: decimal}
CHECKLIST
S
Self-Evaluation

ee
agr
ree
After reading the chapter, I know these points:

Dis
Ag
$ I know that Forms provide an easy way to collect required information from web
page visitors.
$ I know that web page forms have three important parts: a <FORM> tag, form input
elements, and a Submit button.
$ I know that HTML5 supports audio tag and video tag, which is used to embed audio
and video in a Web page.
$ I know that we can add CSS in our HTML documents to exercise precise control over
the appearance.
$ I know that we can connect an HTML document to an Inline, Internal, and External
Style Sheet.

Exercises
A. Tick (ü) the correct answer.

a. Link P
1. ........................ provides an easy way to collect required information from web page visitors.
b. Form c. Image
2. ........................ control limits the web page visitor to only one choice from a list of choices.
PM
a. Radio b. Checkbox c. Select
3. ................... button is used to send the information entered in your form to the web server.
a. Reset b. Close c. Submit
4. To add media to a website, ............................ attribute is used to identify the media source.
a. IMG b. HREF c. SRC
5. ............. attribute is used to display default tags in a text area, which is not edited by users.
a. Read Only b. Text c. Wrap Text
PM PUBLISHERS PVT. LTD.

B. Write ‘T’ for True and ‘F’ for False statements.


1. A text control creates a text box that is used for a single line of input.
2. A Password text box displays the characters entered by a user as asterisks (*).
3. The Reset button sends the information to the appropriate location for processing.
4. By adding multimedia, website messages will get enhanced.
5. External style sheets exist within web page and can link one HTML document.
C. Fill in the blanks.
1. The ............................... button is used to clear the already entered data in a form.
2. ...................... control attribute is used to play the media when the web browser is displayed.
64 3. ........................... attribute is used to replay the file once it is finished.
4. ..................... Style Sheet is used to apply a unique style to a single HTML element.
5. ..................... is the space between your margin and your text.
D. Define the following.
1. Text Box: ......................................................................................................................................
......................................................................................................................................................
2. Password Box: .............................................................................................................................
......................................................................................................................................................
E. Differentiate between the following.
1. Checkbox Radio Button
................................................................. ....................................................................
................................................................ ....................................................................
................................................................ ....................................................................
2. Internal Style Sheet External Style Sheet
................................................................. ....................................................................
................................................................ ....................................................................
................................................................ ....................................................................
F. Answer in 1-2 sentences.
1. What is the use of a Form in HTML?

P
......................................................................................................................................................
......................................................................................................................................................
2. Name the various input controls of a Form.
......................................................................................................................................................
PM
......................................................................................................................................................
3. Why do we add multimedia in web pages?
......................................................................................................................................................
......................................................................................................................................................
4. What is the use of DIV tag?
......................................................................................................................................................
......................................................................................................................................................

IT PLANET - 8 (GIGABYTE)
G. Answer Briefly.
1. Which attributes are used to control Audio and Video tag?
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
2. What are the benefits of using CSS with HTML documents?
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
3. What are the uses of Submit and Reset buttons in the Form?
65
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
H. Application Based Question.
Abhinav has been asked to create a form in HTML to get feedback from the users about the
web page created by him. The feedbacks should be based on four choices— Excellent, Good,
Average, and Poor. Which control, Radio control or Checkbox control, should he use in his form
and why?
........................................................................................................................................................

Group Discussion
Divide the students into groups and discuss the pros and cons of using CSS in HTML.

Online Link
To learn more about Form, Multimedia & CSS in HTML, visit the website:
https://codeclubprojects.org/en-GB/webdev/project-showcase/

Activity Section
Lab Activity
P
Write HTML code to get the given output in your web browser.

GENERAL ENQUIRY FORM


PM
First Name Last Name

Address
City Pin code
Mobile
Email
PM PUBLISHERS PVT. LTD.

Technology Trailblazers
Mar issa Mayer
Marissa M
Maa

? Former CEO: Yahoo YEAR: 2012


Marissa Mayer was born on May 30, 1975, in Wausau, Wisconsin. She led the
M
d
development of Google's most successful products for more than 10 years and
wa
was appointed CEO of Yahoo in 2012, at the age of 37.
PPrior to joining Yahoo, she spent 13 years at Google, where her work in
pproduct development largely contributed to Gmail, a free e-mail service;
C
Chrome, a Web browser; Google Maps, a mapping and directions service; and
66 G
Google Earth, which provided detailed satellite images of Earth.
AAt the time of Mayer's Yahoo appointment, she was one of the only 20 female
CCEOs in charge of a Fortune 500 company. In 2017, Mayer resigned from
YYahoo! when its core assets were sold to Verizon Communications.
5 Cloud Computing

Topics Covered
•Introduction •Cloud Computing •Google Docs •Google Drive

Introduction
Just think, what all things you need if you want to setup an IT company. First, you need an
office space, hardware like computers and servers, and software to run the hardware. Then
you need round-the-clock electricity for power and cooling system, and IT experts for
managing the infrastructure. All of these require a lot of capital expense.
If your work increases, you need more space, more computers & servers, more software, more
cooling system and more IT experts. Again lot of capital expense. If your work decreases and
you need to shut down your business, all this infrastructure will be of no use.
You eliminate these headaches by using cloud computing.

Cloud Computing
P
Cloud computing is a technology that provides resources and services over the Internet.
Resources include email messages, schedules, music, photos, videos, games, websites,
PM
programs, web apps, servers, storage, and more. Services include accessing software and
storing files online. Instead of accessing these resources and services locally on your computer,
you access them on the cloud. For example, some users choose cloud storage instead of
storing data locally on a hard drive or other media. Cloud Storage is an Internet service that
provides storage facility to computer users.
Some of these resources and services are free, and some are paid. If you are using paid
service then you pay only for the service that you actually use. As a result, you need not make
large investments in equipment or the staff to support it.
People are choosing cloud computing for a variety of

IT PLANET - 8 (GIGABYTE)
c
ils ontact
ema
reasons: e s document
s
gam storage programs
we
Accessibility: Data and applications are available s
app backups
bsi
tes
servers music
worldwide from any computer or
device with an Internet connection.
Cost Savings: The expense of software and high-end
hardware shifts away from the user.
Space Savings: Floor space required for servers and
other hardware shifts away from the
user.
Scalability: Provides the flexibility to increase or With cloud computing, users can access files 67
decrease computing requirements as and use applications from any device that
per need. can access the Internet.
ADVANTAGES OF CLOUD COMPUTING
There are many advantages of cloud computing:
! It is probably the most cost-efficient method to use, maintain and upgrade. It eliminates the
capital expense of buying hardware and software and other infrastructure.
! It allows users to get large storage capacity for storing information.
! It allows users to access files on the Internet from any computer that has Internet access.
! Users can allow others to access their files on the Internet so that others can listen to an
audio file, watch a video clip, or view a photo instead of sending the file to them via an
email message.
! It makes data backup easier and less expensive.
! It allows users to view time-critical data and images immediately while away from the main
office or location; for example, doctors can view X-ray images from another hospital, home,
office or while on vacation.
! It provides up-to-date versions of software, as well as upgrades to servers and computer
processing power.
SERVICE PROVIDER

P
Cloud Computing is an Internet technology that provides services to computer users. There are
service providers that provide various types of services for free or charge a fee.
Many organizations like Amazon Web Services (AWS), Google Cloud Platform, and Microsoft
ne
Azure have started implementing cloud services like storage, network, hardware, and software.
PM
If a user doesn't have storage on a personal computer, storage on the cloud can be utilized. The
same type of service is provided by Flickr.com, which can be used to upload images on Flickr's
server. The service can be used on a desktop, but the Internet is required when images are to
PM PUBLISHERS PVT. LTD.

be processed on the desktop. Google Docs is used to create documents online. Google Drive is
used to store your work online. These types of services are available on the cloud.

CHARACTERISTICS OF CLOUD COMPUTING


Using cloud computing, an organization can run its applications on a shared data center. To use
an application that run on the cloud, all that needs to be done is to login with a username and
a password, customize it, and start using it. That's the power of cloud computing.
ON DEMAND SELF SERVICE: Users are able to get the cloud computing resources for almost
68 any type of workload on demand and without requiring human interaction, mostly done
through a web-based self-service portal. This eliminates the traditional need of IT experts to
manage these resources. With a cloud app, you just open a browser, log in, and start working.
ELASTICITY: Suppose, you have an e-commerce business and you are running your business
with four servers. At the time of Diwali sale, which comes once in a year for a month, your
demand increases. You need three more servers to cater your needs. If you purchase three
more servers, what will happen after the sale? You need to lock your servers for next year
sale. This is a major blockage of large investment. With cloud computing, companies can scale
up the resources as computing need increases and scale down the resources as computing
need decreases. This eliminates the need of large investments in the infrastructure, which may
or may not remain active.
PAY PER USE: In the cloud computing, your computer resources are measured, and you only
pay for the resources and workloads you use.
RESOURCE POOLING: Resource pooling allows cloud providers to pool large-scale IT resources
to serve multiple cloud consumers. The cloud enables many users to enter and use data within
the particular software hosted in the cloud at the same time, from any location, and at any
time. This is an attractive feature for multiple business offices and sales teams that are usually
outside the office.

TYPES OF CLOUD
PRIVATE CLOUD: A private cloud is a proprietary architecture subscribed to by an organization. It

P
provides hosted services to the users within the organization. This is protected by a security to
form a barrier against the outside world and to access hosted services from the private cloud.
PUBLIC CLOUD: A public cloud is not proprietary of any organization. The services provided in
these clouds can be accessed by any organization or individual.
PM
HYBRID CLOUD: In a hybrid cloud, the services are offered to a limited and well-defined number
of users. The hybrid cloud allows the Internet to be used as a desktop. It is a combination of
private and public cloud.
COMMUNITY CLOUD: In community cloud, the services are offered to a group of organizations
and community with common interests.

SERVICES OF CLOUD COMPUTING


Cloud computing services are based on a “pay as you go” model. Consumers and organizations
rely on cloud computing services to manage IT infrastructure (infrastructure as a service),

IT PLANET - 8 (GIGABYTE)
provide software applications (software as a service), and create, test, and deploy applications
using web-based development tools (platform as a service).
INFRASTRUCTURE AS A SERVICE (IaaS): IaaS provides IT infrastructure like servers, storage,
networks operating systems over the Internet on pay as you go basis. It is the most flexible
cloud computing model and allows companies to scale storage, processing power, or bandwidth,
up or down as needed. For example, retailers may need to increase these capabilities to
accommodate additional traffic to their websites during holiday shopping seasons. When the
season ends, retailers can easily reduce these settings.
SOFTWARE AS A SERVICE (SaaS): SaaS is a method for delivering software applications over the
Internet, on demand and typically, on a subscription basis. Users connect to the application over
the Internet, usually through a web browser on their phone, tablet or PC.
69
PLATFORM AS A SERVICE (PaaS): PaaS provides a cloud platform and allows developers to
create, test, and run their program, website, web app, etc. without having to purchase the
hardware and software.
Google Docs
Till now, you have learnt about cloud computing. Now, you will work practically on cloud
computing by using Google Docs. Google Docs (or Google Documents) is an online Office Suite,
in which you can create, edit and share three types of documents. These include Document,
Spreadsheet and Presentation. Each of the three document types has common operations
applicable to them including loading, saving, renaming, and sharing.
! The Document component of Google Docs allows you to create fully-featured, rich
documents.
! The Spreadsheet component of Google Docs allows you a basic manipulation and
formatting of spreadsheets, adding charts and the use of formula.
! The Presentation component of Google Docs enables you to create professional looking
presentations.
The advantages of using Google Docs are given below:
! Google Docs is free for the individual user. It doesn’t need to be installed on any computer.
! We can access the applications and all documents wherever we have access to the Internet
and a web browser.
!
! P
There are no compatibility issues; everyone is on the same version.
Documents are stored online, and there is no need to carry any media with us while we
travel, including USB drives, discs, etc.
PM
! The data stored online is very much secure and well-protected.

STARTING GOOGLE DOCS


To start Google Docs, open Google page in the web browser.

1. In the Google page,


1
click on Sign in.
Google account page will
appear.
PM PUBLISHERS PVT. LTD.

2. Type your login ID and


the password.
Password will appear in
the form of black dots.
Your login ID and password
2
are same as that of your
Gmail account.
70
3 3. Click on Next button.
Google page appears again with your login details.

4 4. Click on Google Apps button.


A list of all Google Apps appears.
5. Click on Docs.

Docs App appears.


This area shows you Template
Gallery, which includes blank
and pre-designed documents.
You can select and work on it.
6

P 6. Click on Blank to start a new


document.
This area shows the list of
existing documents.
PM
An empty document will appear
on your screen.

The text you type will appear


where the insertion point
flashes on your screen.
You can click on this button to

IT PLANET - 8 (GIGABYTE)
return to Docs App home.

7. Type your text.


All your text is automatically
saved as you type. This document
will be saved in Google Drive.
7 Google Drive is an online storage
used to store your data.
When you return to Docs App
home, the new document will be
71
displayed in the Google Docs
listing.
RENAME THE DOC
By default, the name of the blank document appears as Untitled document, but you can
rename it and give it a new name.

1. Click on File menu.


2. Click on Rename.
1

A text box will open.

3 3. Type the name you desire in


the box.
4. Press the Enter key.
The new name will appear in

P Docs App.
The new name will also appear in
Google Drive.
PM
SHARE YOUR FILE WITH SPECIFIC PEOPLE
After creating the file, you can share it with your friends, family, relatives, etc. through email.

1. Click on Share button.


1 Share with others dialog box
appears.
2. Type the e-mail ID of the
PM PUBLISHERS PVT. LTD.

receiver.
2 You can share the file to more
people by typing their e-mail ID.
3. Click on Send.
The email is sent to the people
you shared with.
3

SHARE A LINK TO ANYONE


After creating the file, you can share it with other people through a link.
72 1. Click on Share button. Share with others dialog box appears.
2. At the top right, click on Get shareable link. A link of your file will appear.
3. Copy and paste the link in an email or any other place you want to share it.
SIGN OUT FROM GOOGLE DOCS
After finishing your work in Google Docs, you must logout from it.
1 1. Click on Google Account.
A pop-up window appears.
2. Click on Sign out button.
2 The Google Docs window will
close.

Google Drive
When you create a document in Google Docs, it will automatically saves in
Google Drive. Google Drive is cloud storage developed by Google. You can
store your files online in Google Drive and can access them from anywhere
in the whole world. Drive gives you 15 GB of free Google online storage, in
which you can keep files, folder, backups and everything that is important.

OPENING GOOGLE DRIVE


P
To start Google Drives, open Google page in the web browser.
PM
1 1. In the Google page, click on Sign
in.
Google account page will appear.

2. Type your login ID and the


password.
Password will appear in the form of
2
black dots.

IT PLANET - 8 (GIGABYTE)
Your login ID and password are same
3 as that of your Gmail account.
3. Click on Next button.

4 Google page appears again with your


login details.
4. Click on Google Apps button.
A list of all Google Apps appears.
5. Click on Google Drive.
5

73
Google Drive window appears.
The file you created in Google
Docs, in previous section, is
stored in Google Drive.
You can also share this file to others
usingg Google Drive.

Update Your Knowledge


After finishing your work in Google Drive, you must
logout from it. Google was founded by Larry Page and
Sergey Brin in the year 1996.

UPLOAD FILE OR FOLDER


You can easily upload any file or folder from your computer hard drive to Google Drive.

1. Click on New button.


A drop-down menu appears.

2 P 2. Click on File upload.


PM
Choose Files to upload dialog box appears.
3. Navigate and click on the file you want to
upload.
4. Click on Open.

3
PM PUBLISHERS PVT. LTD.

The selected file is uploaded


to Google Drive.

74
ORGANISING FILE AND FOLDER
Folders help you organize the files in Google Drive. In the folder, the files are easier to find
when you need them. Most folders contain files and folders.

Creating a Folder
1. Click on New button.
1 A drop-down menu appears.
2 2. Click on Folder.

New folder box appears.


3. Type the name of the folder.
3
4. Click on Create.

P A new folder is created in


Google Drive.
PM
Moving a File to Folder
2 1. Select the file you want to
move.
2. Click on More action button.
3 A drop-down menu appears.
3. Click on Move to.

1 IT PLANET - 8 (GIGABYTE)

4. Click on the folder in which


you want to move the file.
4 5. Click on Move.
The file will move in the
particular folder.
75
5
When you open the folder, you
will see that the file is stored in
it.

Delete a File
You can delete a file which is no longer needed in Google Drive. Whenever you delete any file,
it goes into Trash folder. If you want to delete the file permanently, you have to delete it from
Trash.
2 1. Select the file you want to
delete.
2. Click on Remove button.
1
The file moves to the Trash folder.

Restore the Deleted File

P
As explained, the file you delete goes into Trash, where it stays for a few days or a few weeks,
depending on how often you empty the Trash. You can again restore the files which are in
Trash to their original location from where you had deleted them.

1. Click on Trash.
PM
Trash displays all the files you
3 have deleted.
2. Click on the file you want to
restore.
1 3. Click on Restore from Trash
button.
2 The file disappears from the Trash
and reappears in its original place.
PM PUBLISHERS PVT. LTD.

Delete the files permanently from Google Drive


Whenever you want to remove any file permanently, you have to delete that file from the
Trash. After deleting the file from Trash, it cannot be restored again.

3 1. Click on Trash.

2 Trash displays all the files you


have deleted.
2. Select the files you want to
1 delete forever.
76 3. Click on Delete forever button.
The Delete forever dialog box appears.
4 4. Click on DELETE FOREVER to permanently delete all the files.

SHARING FILE OR FOLDER


After uploading and organizing the files in Google Drive, you can also share these files with
your friends, family, relatives, etc.

1. Select the file or folder you


2 want to share.
1 2. Click on Share button.

3
P Share with others dialog box appears.
3. Type the e-mail ID of the receiver.
PM
You can share the file to more people by typing their
e-mail IDs.
4. Click on Send.

A pop-up will appear to confirm the process.

SIGN OUT FROM GOOGLE DRIVE IT PLANET - 8 (GIGABYTE)

After finishing your work in Google Drive, you must logout from it.

1. Click on Google Account


1 icon.
A pop-up window appears.
2. Click on Sign out button.
The Google Drive window will
2 close. 77
CHECKLIST
S
Self-Evaluation

ee
agr
ree
After reading the chapter, I know these points:

Dis
Ag
$ I know that Cloud computing is a technology that provides resources and services
over the Internet.
$ I know that characteristics of cloud computing are on demand self service, elasticity,
pay per use, and resource pooling.
$ I know that types of clouds are private cloud, public cloud, hybrid cloud, and
community cloud.
$ I know that services of cloud computing are infrastructure as a service, software as
a service and platform as a service.
$ I know that Google Docs (or Google Documents) is an online Office Suite, in which
we can create, edit and share three types of documents.
$ I know that Google Drive is cloud storage developed by Google in which we can
store our files online and access them anywhere in the whole world.

A.
Exercises
Tick [ü ] the correct answer.
P
1. ......................... is a technology that provides resources and services over the Internet.
PM
a. Cloud Computing b. Antivirus c. Soft Computing
2. ......................... include accessing software and storing files online.
a. Resources b. Services c. Server
3. ......................... allows cloud providers to pool large-scale IT resources to serve multiple
cloud consumers.
a. Elasticity b. Service Provider c. Resource Pooling
4. ......................... is an online office suite, in which you can create, edit and share Document,
Spreadsheet and Presentation.
PM PUBLISHERS PVT. LTD.

a. Google Docs b. Google Drive c. YouTube


5. ...................... is free online storage that provides access to email, contacts and much more.
a. Facebook b. YouTube c. Google Drive
B. Write ‘T’ for True and ‘F’ for False statements.
1. SaaS is a method of delivering software over the Internet.
2. In community cloud, the services are offered to a group of organizations.
3. A public cloud is not proprietary of any organization.
4. AWS is not a service provider of cloud computing.
5. Google Drive gives you 15 GB of free Google Online Storage.
78
6. You cannot delete a file permanently from Google Drive.
C. Fill in the blanks.
1. .......................... Cloud offers the services to a limited and well-defined number of parties.
2. Cloud computing services are based on a ................................................. model.
3. .......................... provides a cloud platform and allows developers to create, test, and run
their program, website, web app, etc.
4. In .......................... , you can keep files, folders, backups and everything important, online.
5. Whenever you delete any file, it goes into ......................... folder.
6. After finishing your work in Google Drive, you must ......................... from it.
D. Define the following.
1. IaaS: ............................................................................................................................................
....................................................................................................................................................
2. SaaS: ..........................................................................................................................................
....................................................................................................................................................
3. PaaS: ..........................................................................................................................................
....................................................................................................................................................
E. Differentiate between the following.
Public Cloud
P
..............................................................
Private Cloud
.................................................................
PM
.............................................................. .................................................................
.............................................................. .................................................................
F. Answer in 1-2 sentences.
1. What is Cloud Computing?
.....................................................................................................................................................
.....................................................................................................................................................
2. What are Service Providers?

IT PLANET - 8 (GIGABYTE)
.....................................................................................................................................................
.....................................................................................................................................................
3. What is Google Drive?
.....................................................................................................................................................
.....................................................................................................................................................
G. Answer Briefly.
1. Write the reasons for choosing cloud computing.
.....................................................................................................................................................
.....................................................................................................................................................
79
.....................................................................................................................................................
.....................................................................................................................................................
2. What are the characteristics of cloud computing?
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
3. Write the advantages of Google Docs.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
H. Application Based Question.
Riya has to create her project on urgent basis but there is no MS-Office installed in her system.
She wants to complete her project for which she needs word processor and spreadsheet. She
has Internet connection at her home. Help her to complete the task.
...........................................................................................................................................................

Group Discussion
P
Divide the students into two groups and discuss the topic, ‘Advantages and Disadvantages of Cloud
PM
Computing’.

Online Link
To learn more about working of Cloud, visit the website:
https://data-flair.training/blogs/cloud-computing-tutorial/

Technology Trailblazers
PM PUBLISHERS PVT. LTD.

Jack Ma

? Co-Founder: Alibaba.com YEAR: 1999


Jack Ma is one of those self-made billionaires with humble beginnings. Jack Ma
Ja
wa
was born in Hangzhou, located in the South-Eastern part of China. Once a poor
la
lad who survived by guiding tourists, Ma left no stone unturned to rise above
h
his humble condition and achieve success. He was one of the few individuals
w
who saw Internet as a business opportunity even at a time when the rest of the
w
world didn't believe in his thoughts. The venture based on e-commerce,
'A
'Alibaba', which he founded in the early 2000s catapulted this entrepreneur to
80 gglobal fame. He is one of the world's greatest living examples of
eentrepreneurship today.
6 E-Commerce & Blogging

Topics Covered
•E-Commerce •E-Commerce Business Models •E-Retailing •Security Concern •Top E-Commerce
Websites •Blogging

E-Commerce
Electronic Commerce (e-commerce), also known as e-business, is a financial business
transaction that occurs over an electronic network.
Anyone who has a computer connected to the Internet and has the means to make an online
payment (through credit card, debit card, net banking, etc.) for goods or services purchased
online can participate in e-commerce. Two popular types of e-commerce are shopping and
trading in stocks.
There are thousands of websites devoted to online shopping. Some websites focus on one
product or service, such as books or travel, whereas other sites offer a wide range of

P
products. The web is a great place to sell your goods and services. E-commerce eliminates
the blockage of time and distance that slows down traditional business transactions. Now
transactions can occur quickly and globally with e-commerce, and a lot of time is saved.
Initially, e-commerce transactions were conducted primarily through desktop computers. Today,
PM
many hand-held computers and smartphones can access the web wirelessly. The e-commerce
that takes place using mobile devices is called m-commerce (mobile commerce).

ADVANTAGES OF E-COMMERCE
E-commerce is a big part of the web which enables online buying and selling of goods and
services. Its advantages are given below:

For Buyers

IT PLANET - 8 (GIGABYTE)
$ They have the convenience of shopping at home.
$ They can compare the price of items easily.
$ They can read reviews of other users about the products.
$ Door step delivery of the desired goods and services.
$ They can also give instant feedback.
For Sellers
$ The web offers low overhead expenses.
$ Free or low-cost marketing activities.
$ Potential buyers can be millions of people.

E-Commerce Business Models 81

The four basic models of e-commerce business are Business-to-Consumer, Consumer-to-


Consumer, Business-to-Business, and Business-to-Employee.
BUSINESS-TO-CONSUMER E-COMMERCE
Business-to-consumer (B-to-C or B2C) e-commerce consists of the sale of products or services
from business concern to the general public or end users. In this model, the seller is the
business concern, and the buyer is the consumer (public). Products for sale can be physical
objects, such as books, flowers, computers, groceries, medicines, automobiles, etc. With B2C
business model, the sellers can sell products directly to consumers, without using traditional
retail channels. This enables some companies to sell products at a lower cost with quick
service.

CONSUMER-TO-CONSUMER E-COMMERCE
In Consumer-to-Consumer (C-to-C or C2C) e-commerce, the individuals use the Internet to sell
products and services directly to other individuals. Online auction is the most popular vehicle
for C2C e-commerce, in this, one consumer auctions goods to other consumers. If you are
interested, you place a bid on an item. The highest bidder, as in any other auction, buys the
item. OLX is the example of C2C e-commerce.

BUSINESS-TO-BUSINESS E-COMMERCE
In a Business-to-Business (B-to-B or B2B) e-commerce, the sale or exchange of products and services

P
takes place between firms. For example, a company that manufactures cars might use the Internet to
purchase tyres from their supplier or tyre manufacturer.

BUSINESS-TO-EMPLOYEE E-COMMERCE
PM
Business-to-Employee (B-to-E or B2E) e-commerce, also known as intra business e-commerce,
refers to the use of Intranet technology to handle activities that take place within a business.
Unlike the previously discussed types of e-commerce business models, B2E e-commerce does
not generate revenue. Instead, it increases profits by reducing expenses within a company. For
example, using B2E e-commerce, employees collaborate with each other, exchange data and
information, and access the in-house databases, sales information, and market news.

E-Retailing
PM PUBLISHERS PVT. LTD.

Once you have researched about your product, read the reviews and found the best price, you
are ready to purchase the product. E-retail occurs when retailers use the web to sell their
products and services.

MAKING AN ONLINE PURCHASE


A customer (consumer) visits an online business portal at the electronic storefront. An
electronic storefront, also called an online catalog, is the website where an e-retailer displays
the products. It contains descriptions, graphics, and sometimes product reviews.
After going through the products, the customer makes a selection. This activates the second
area of the store known as the shopping cart. The shopping cart allows the customer to
82
collect the items for purchase. Items in the shopping cart can be added, deleted, or even
saved for a future visit.
When the item is ready for the purchase, the customer proceeds to the checkout. At this
time, the customer enters his/her personal and financial information through a secure web
connection. The transaction and the financial data are automatically verified at a banking
website. If the bank approves the transaction, the customer receives a confirmation of the
purchase. Then, the e-retailer processes the order and sends it to the fulfillment center, where it
is packaged and shipped to the customer. Shipping information is posted on the website and e-
mailed to the customer, so that the customer can track the order. The order may take a few
days, after the purchase, to reach the customer.
When you are purchasing online, make sure that you have entered all the required
information. Typically, you need to type your full address, including the ZIP or postal code,
your phone number, and your credit/debit card number, its expiry date and the security code.
Many retailers require you to open an account on their website. Therefore, before making a
purchase, you should set up your account and then log into the website.
These days many online companies are providing the facility of ‘Cash On Delivery’ or ‘COD’. It
means you can pay through cash for the goods you have purchased only after the goods are
delivered to you. There is also a return policy; if you don’t like the product you can return it
within the stipulated time.

Path of an Authorized E-Retail Transaction


Step 1
Customer views e-retailer's electronic
storefront.
P
Step 2
He/She collects items in an
electronic shopping cart.
Step 3
He/She enters his/her personal and
financial information on a secure
website. E-retailer sends financial
PM
information to the concerned bank.

Step 4
Bank performs security checks
B
A and sends authorization back
N
K
to the e-retailer.
E-RETAILING

Step 8

IT PLANET - 8 (GIGABYTE)
Package(s) in the order is/are
Step 7 Step 6 Step 5
delivered to the customer.
While order travels to Fulfillment center E-retailer's web server
the customer, shipping packages the order, Rewritable

24x10x40

sends confirmation to the


information is posted prepares it for taile
E-reeb
r
customer, processes the
W r
on the website. shipment, and then Serv
e
order, and then sends it
sends a report to the to the fulfillment center.
server where the
records are updated.

Shopping Cart
While shopping online using e-commerce, you usually add the items that you want to purchase to
a virtual shopping cart that keeps track of these items and the quantity. Most websites have a
View Cart link that enables you to view the items of your shopping cart. The cart usually has a link 83
of Proceed to Checkout that takes you to that page where you will provide the information about
your address and payment.
Research Before You Purchase Online
Whether you are looking for a laptop or a video camera or any other product, you should
research for the information about that product on the Internet before purchasing. On the
web, you can find many reviews of the products which are quite useful. The web has plenty of
places that offer in-depth, unbiased reviews by professionals that really put products to the
test and tell you the advantages and the disadvantages of using each item.

Security Concern
Shopping online nowadays is very secure and reliable. When you purchase goods or services
online, the vendor asks you to provide accurate payment information. This means typing your
credit or debit card number, its expiry date and the security code, along with your name and
address details. It is vital that this sensitive data does not fall into the wrong hands; therefore,
you need to ensure that you provide the payment information only to a secure site.
The website and your web browser display various indicators to ensure that you are entering
your confidential data on a secure site. On the website, look for “https” instead of “http” in
the site address, and also look for a security icon, such as “VeriSign Secured.” In the web
browser, look for a lock icon in the browser window. In some browsers, the address bar shows

MODE OF PAYMENT P
a green background for a secure site.

Mode of payment is a way that a buyer chooses to pay the seller for a good or service that is
PM
also acceptable to the seller. E-commerce sites use e-money to do electronic payment.
Electronic payment refers to paperless monetary transactions. There are various ways of
making electronic payments through electronic modes such as credit card, debit card,
electronic wallet, and netbanking.

Credit Card
A credit card is a plastic card issued by the bank that allows you to borrow pre-approved fund
in order to complete the purchase. Credit card is most widely used for making online
payments. Many e-commerce sites allow you to pre-store your credit card number securely so
PM PUBLISHERS PVT. LTD.

that you don’t need to type in the number each time. You only need to enter the CVN (Card
Verification Number) or CVV (Card Verification Value) which is printed at the back of the card.

Debit Card
A debit card, also known as bank card, is a plastic card issued by the bank that allows you to
complete the purchase. It looks and works in the same way as the credit card. The only
difference is that when you use debit card for any transaction, the money for that transaction
comes directly out of your bank account.
Electronic Wallets (e-wallet)
E-wallet, also called digital wallet, allows you to store your credit card and bank account
numbers in a secure environment, and eliminates the need to enter account information while
84
making your payment. Once you have registered and created E-wallet profiles, you can make
online payments faster and with less typing.
NetBanking
NetBanking is a system of banking in which a customer may perform banking transactions
electronically without visiting the bank personally. When you choose netbanking option for
transaction in e-commerce, it will redirect to your bank's website, where you need to sign in
by entering the user ID and password. The amount for transaction will be deducted from your
bank account.

Top E-Commerce Websites


AMAZON.COM
Amazon was founded by Jeff Bezos in late 1994. In the
beginning, Amazon.com sold books but today Amazon.com
is a vast Internet-based electronic commerce site that sells
books, music, movies, housewares, electronics, toys, and
many other goods, either directly or as the middleman
between other retailers and the customers.

P FLIPKART.COM
Flipkart Pvt Ltd. is an Indian electronic commerce
company based in Bengaluru, India. Founded by Sachin
PM
Bansal and Binny Bansal in 2007, the company initially
focused on book sales, before expanding into other
product categories such as consumer electronics and
lifestyle products.

SNAPDEAL.COM
Snapdeal is an online marketplace located at New Delhi,
India. The company was started by Kunal Bahl and
Rohit Bansal in February 2010. Snapdeal has grown to

IT PLANET - 8 (GIGABYTE)
become one of the largest online marketplaces in India
offering an assortment of 4 million+ products, shipping
to 4,000 towns and cities in India.

ALIBABA.COM
Alibaba Group was established in 1999 by 18 people led
by Jack Ma, a former English teacher from Hangzhou,
China. Today, Alibaba.com is the leading platform for
global wholesale trade. It serves millions of buyers and
suppliers around the world. It brings you millions of
products in over 40 different categories, including 85
consumer electronics, machinery and apparel.
Blogging
Blogging is an exciting and dynamic medium by which you can publish
your ideas, opinions, and stories online. It is a place to express yourself to
the world. A place to share your thoughts and your passion.

A blog is a website that consists of a frequently updated collection of information and entries.
Most blogs focus on a particular topic or subject area, although in a majority of blogs the
‘subject’ is the person writing the blog. The entries that appear on a blog are called posts, and
the act of publishing a blog is called posting. A single person who maintains many blogs is
known as a blogger.
The term blogosphere refers to the worldwide collection of blogs. There are over 100 million
blogs on the web; you can read what others have published.
A blog that contains video is sometimes called a video blog or vlog.
A microblog allows users to publish short messages, usually between 100 and 200 characters,
for others to read.
Some of the main blog hosting services are Blogger (www.blogger.com), TypePad
(www.typepad.com), and Twitter (www.twitter.com).

USES OF BLOG
P
Similar to an editorial section in a newspaper, blogs reflect the interests, opinions, and
personalities of the blogger, and sometimes website visitors. Blogs have become an important
means of worldwide communications.
PM
Businesses create blogs to communicate with employees, customers, and vendors. They may
post announcements of new information on a corporate blog.
Teachers create blogs to collaborate with other teachers and students.
Home users create blogs to share aspects of their personal lives with family and friends.

CREATING A BLOG
In this example, for creating a blog, we are using Blogger. The Blogger is a product of Google.
PM PUBLISHERS PVT. LTD.

1. Open www.blogger.com site.


2. Click on Sign In.
2
Google Sign In page will appear.

3. Type your login ID and the password. Password will appear in the form of black dots. (not shown)
Your login ID and password are same as that of your Gmail account.
4. Click on Next button. (not shown)

5. Click on Create New Blog.


86

5
Create a New blog window appears.
6
6. Type the name for your blog, which will
appear at the top of each page.
7. Type the address you want to use.
7
This address uses the form
8 http://youraddress.blogspot.com, where
‘youraddress’ is the address you typed.
Check Availability will ensure the address is
available.
8. Click on the theme you want in the blog.
9. Click on Create blog!.
9
Blogger creates your blog. Now, you can add your post in it.

POST TO YOUR BLOG


1. Click on New post.
1 The new window will appear.

2 P 4
2. In the Title text box, type a post title.
3. In the large text box, type the body of
PM
the post.
You can format the text by using these
icons on the toolbar.
4. When you are done, click on Publish.
Blogger will publish your post.
3

VIEW YOUR POST

IT PLANET - 8 (GIGABYTE)
1. Select your post by clicking on the
checkmark option.
2. Click on View.
1

You can view your post.


From outside the Blogger site, use Web browser
to navigate to your BlogSpot address:
http://youraddress.blogspot.com, where
youraddress is the address you specified when 87
you created the blog.
CHECKLIST
S
Self-Evaluation

ee
agr
ree

Dis
After reading the chapter, I know these points:

Ag
$ I know that E-commerce is a financial business transaction that occurs over an
electronic network.
$ I know that there are four basic models of e-commerce business: Business-to-
Consumer, Business-to-Business, Consumer-to-Consumer, and Business-to-Employee.
$ I know that Mode of payment is a way that a buyer chooses to pay the seller for a
good or service that is also acceptable to the seller.
$ I know that Blogging is an exciting and dynamic medium by which we can publish
our ideas, opinions, and stories online.
$ I know that Amazon was founded by Jeff Bezos in 1995.

Exercises
A. Tick (ü) the correct answer.

a. B2C
P
1. .................. is an e-commerce model used by individuals to sell products and services
directly to other individual.
b. B2E c. C2C
2. ..................... can be used if you have a popular product and not sure what price to charge.
PM
a. Online Catalog b. Online Auction c. Virtual Shopping Cart
3. A customer enters his/her personal and financial information through a ........... connection.
a. Secure Web b. Insecure Web c. Common Web
4. A blog is a ......... that consists of a frequently updated collection of information and entries.
a. Software b. Website c. App
5. ..................... is an Indian e-commerce company based in Bengaluru, India.
a. Snapdeal b. Flipkart c. Amazon
PM PUBLISHERS PVT. LTD.

B. Write ‘T’ for True and ‘F’ for False statements.


1. Customers can compare the price of items easily in Online shopping.
2. Before purchasing online, there is no need of doing research about that product.
3. A secure website has 'https' instead of 'http' in web address.
4. The blog that contains video is sometimes called video blog or vlog.
5. Snapdeal has grown to become one of the largest online marketplaces in India.
C. Fill in the blanks.
1. The e-commerce that takes place using mobile device is called .................................. .
2. Online auction is the most popular vehicle for ............................... e-commerce model.
88 3. The .................................. allows the customer to collect purchases.
4. The term .................................. refers to the world wide collection of blogs.
5. In the web browser, look for a .................... icon for security concern.
D. Define the following.
1. Shopping Cart: .............................................................................................................................
......................................................................................................................................................
2. COD: ............................................................................................................................................
......................................................................................................................................................
E. Differentiate between the following.
B2B B2C
................................................................... ...................................................................
................................................................... ...................................................................
................................................................... ...................................................................
F. Answer in 1-2 sentences.
1. What do you mean by e-commerce?
......................................................................................................................................................
......................................................................................................................................................
2. What is e-retailing?

P
......................................................................................................................................................
......................................................................................................................................................
3. What do you mean by mode of payment?
PM
......................................................................................................................................................
......................................................................................................................................................
4. What do you mean by Blogging?
......................................................................................................................................................
......................................................................................................................................................
G. Answer Briefly.
1. What are the advantages of e-commerce?

IT PLANET - 8 (GIGABYTE)
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
2. What are the security concerns one should consider while using e-commerce?
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
3. What is a Blog? Write down its uses.
......................................................................................................................................................
89
......................................................................................................................................................
......................................................................................................................................................
H. Application Based Question.
Riya wants to buy some books from a retail website. But she is unable to make online payment.
So, she wants to pay for the books only after the books are delivered. By which facility will she
pay for the books that she wants to purchase?
..........................................................................................................................................................

Group Discussion
Divide the students into two groups and discuss the topic, ‘The precautions one should take while
doing online shopping to avoid online fraud’.

Online Link
To learn more about working of E-commerce, visit the website:
https://www.shopify.com/encyclopedia/what-is-ecommerce

Activity Section
Activity Quiz
P
Haqe and Ayush are playing a quiz on online services. Help Haqe answer all the
questions correctly.
PM
Ayush: Hi Haqe! Do you know about the online services?
Haqe: Yes Ayush! Our teacher told us about different types of online services like e-commerce and
Blogging.
Ayush: Great! Then let’s play a quiz. I will give you clues and you have to tell me the correct
answers.
Haqe: It will be fun! Let us start the quiz quickly.
Ayush: It enables online buying and selling of goods and services.
Haqe: I have guessed it. It is called ................................................................................................... .
PM PUBLISHERS PVT. LTD.

Ayush: Now, the second one. It is an e-commerce model where the individuals use the Internet to
sell products and services directly to other individuals.
Haqe: It is a ........................................................................................................ .
Ayush: Wonderful! Next question for you. While shopping online, you usually add the items that
you want to purchase in it, to keep track of them.
Haqe: It is called a ........................................................................................................ .
Ayush: Now answer this. It is a plastic card issued by the bank that allows you to borrow pre-
approved fund in order to complete the purchase.
Haqe: It is called a .................................................................................. .
Ayush: Now answer this. He is a single person who maintains many blogs.
Haqe: He is known as a ............................................................................. .
90 Ayush: Now the last one. This e-commerce site was established
by 18 people led by Jack Ma.
Haqe: It is known as .................................................................................... .
Activity Write
Write the steps for an authorized e-retail transaction.
Step 1
............................................................................................................................................
............................................................................................................................................
Step 2
...................................................................................................................................................
...................................................................................................................................................
Step 3
............................................................................................................................................
............................................................................................................................................

B
A
Step 4
N
K
...................................................................................................................................................
...................................................................................................................................................
Step 5 Rewritable

24x10x40

............................................................................................................................................

P
............................................................................................................................................

Step 6
...................................................................................................................................................
taile
E-reeb
W r
Serv
e
r
PM
...................................................................................................................................................
Step 7
............................................................................................................................................
............................................................................................................................................
Step 8
...................................................................................................................................................
...................................................................................................................................................

Technology Trailblazers
Jeffrey Preston Bezos IT PLANET - 8 (GIGABYTE)

? Founder: Amazon YEAR: 1994


Jeffrey Preston Bezos is an American technology entrepreneur, investor, and
Jeff
philanthropist, who is best known as the founder, chairman, and chief
ph
executive officer of Amazon, the world's largest online shopping retailer.
ex
As a child, he spent his days laying pipes, vaccinating cattle and fixing
w
windmills at his grandfather's Texas ranch. He attended Miami Palmetto
Se
Senior High School and took his B.Sc. degree in Electrical Engineering and
Co
Computer Science from Princeton University. He worked on Wall Street and
91
be
became the youngest Vice President at D. E. Shaw & Co. Despite success,
he decided to quit the field of finance. He founded Amazon.com, an online
sto
store. He has constantly been improving his website and introducing
improved facilities for his customers.
im
7 Artificial Intelligence (AI)

Topics Covered
•Introduction •Artificial Intelligence •Understanding AI Environment •Timeline of Artificial
Intelligence •Artificial Intelligence in Daily Life •Future of AI •AI and Ethics

Introduction
Till now, we have been learning that computer is a machine which cannot work on its own. It
takes our command and instructions, and performs the task accordingly.
What if your computer starts thinking and doing work itself?

Imagine a car without a driver that drops you to school, says


you, “Good bye” and comes back in the afternoon to pick you
up from school. Wouldn't that be great! All this is possible by
the technology, called Artificial Intelligence (AI). In this
chapter, we will study about how Artificial Intelligence started
and how it will change the world.

Artificial Intelligence P
Artificial Intelligence (AI) is a way of making a computer, a robot, or software think
PM
intelligently, in a similar manner as humans think. It is the simulation of human intelligence
processed by machines, especially computer systems. This includes learning, reasoning,
planning, self-correction, problem solving, knowledge representation, perception, motion,
manipulation, and creativity. Now machines itself can perform numerous tasks, which
otherwise require human intelligence to accomplish.
AI is a controversial topic; some would call it a blessing in disguise for businesses, while for
some it is a technology that can become harmful for humankind as it is potentially capable of
taking over and dominating human being. But in reality, AI has affected our lifestyle either
directly or indirectly and shaping the future of tomorrow.
PM PUBLISHERS PVT. LTD.

INTELLIGENCE
You become intelligent when you learn and solve problems by yourself.
Suppose, you touch a hot metal object, you will pull your hand away immediately. When this
happens to you the first time, the sequence of events and the result (the burning of your
hand) gets stored in your brain. This is called an experience.
When you see a hot metal object next time, you will not touch it. You will use
the knowledge of your previous experience and decide not to repeat it again.
This process of learning, comparing a previous experience, making a decision
and acting upon is the key to human intelligence. You can make more and
more complicated decisions by learning from your past experiences.
92
In the same way, when a computer or a machine starts thinking and using its experience for
doing things correctly, you call it Artificial Intelligence (AI).
To make an intelligent machine, all you need is a memory or a space where
experiences can be stored. Then you can use a method to apply these
experiences to new one and compare all these experiences to come to
logical conclusions, like holding the hot object with a glove on. That would
be an intelligent machine.
Scientists and researchers are creating new software
programs which try to recreate the process of
human learning in a computer, in an attempt to
make them 'think' and behave like human. These
programs try to copy the functioning of the human
brain. Hence through Artificial Intelligence (AI),
robots can play, talk and even guide us to do things
in a better way.

COMPUTATIONAL THINKING
Computational thinking is a set of problem-solving methods that
involve expressing problems and their solutions in ways that a
computer could execute.

Let's begin with a teaser.


Read the following sentence:
P
PM
"The trophy would not fit into the suitcase because it is too small."
Pause for a moment to make sure that you understand it.
Now answer the question:
What was too small?
What does it refer to?
Clearly it refers to the suitcase, not the trophy.
How did you get the right answer?

IT PLANET - 8 (GIGABYTE)
Observe that there is nothing in the sentence itself that gives away the answer. To
demonstrate this, let us change just the last word from small to big, and nothing else.
So the sentence now becomes:
"The trophy would not fit into the suitcase because it is too big."
Now, what was too big?
Suddenly it refers to the trophy and not the suitcase. This is an example of thinking.
Thinking is an internal mental process that uses information as input and integrates the
information with previous learned material resulting in new knowledge.
Computational thinking is yet another way of thinking which combines the previous-mentioned 93
ways of thinking. It allows us to take a complex problem, understand what the problem is and
develop possible solutions. We can then present these solutions in a way that a computer, a
human, or both, can understand.
There are four key techniques to computational thinking:
! Decomposition – breaking down a complex problem or system into smaller, more
manageable parts
! Pattern recognition – looking for similarities among and within problems
! Abstraction – focusing on the important information only, ignoring irrelevant detail
! Algorithms – developing a step-by-step solution to the problem, or the rules to follow to
solve the problem
Each technique is as important as the others. They are like legs on a table - if one leg is
missing, the table will probably collapse. Correctly applying all four techniques of
computational thinking will help in programming a computer.

Understanding AI Environment
Imagine you have lost your wristwatch, and you are searching for
it in your bedroom. You walk around the room and look at
everything until you find your watch.
All this happens because from the day you are born, your eyes are

P
sending signals to your brain. You have tiny little cells in your brain
called 'Neurons'. The neurons take these signals as their food.
You've seen so many watches in your life that means you have lots
of neurons in your brain that know what a watch looks like and
PM
feels like.
Now, if your father says, “Go to bedroom I think I have seen your watch in bedroom.”
You have many groups of neurons in your brain which know how your bedroom looks like and
how your watch looks like; you never get confused between your Bedroom and Fridge. This
smart work that these neurons do is referred to as intelligence. The neurons in your brain help
you understand all those things and get happy when they do their job right and help you find
your watch.
Since you're tired of losing your things all the time, why don’t you teach a computer (and
PM PUBLISHERS PVT. LTD.

build a robot) to find them for you?


You can make computers intelligent if they have neurons, like those in your brain; you could
train a computer by giving it lots of neurons in the form of neuron network.
If a computer has a camera and wheels to move around, it could take
a video of everything around it and give the video to its neurons. To
help find your watch, you need to teach the neurons to like finding
your things. They need to be happy while finding the right things and
avoid the wrong things. So, you can give neurons a reward every time
they find the right watch. Also, don't give them the reward if they find
the wrong things. More importantly, you can teach them to find the
94 right things by giving lots of examples.

After a while, the computer would have enough groups of neurons that know how your
different watches look like and where to find them. This is one type of AI.
COMPONENTS OF INTELLIGENT COMPUTER
1. Machine Learning: Machine learning is an application of Artificial Intelligence that provides
capability to computers to automatically learn and improve from experience without being
explicitly programmed. It focuses on the development of computer programs that can
access data and use it to learn by themselves.
AI is all about data and algorithms. Algorithm is a set of rules used to help computers
perform decision-making operations through large volumes of data, which help computers
to learn. Accuracy of decision-making capability is purely based on how accurately it has
been trained and by using authentic data. Generally, the more data a machine learning
algorithm is provided, the more accurate it becomes.
2. Natural language processing (NLP): It is a very dynamic sector in the area of machine
perception which is majorly associated with automatic speech recognition. It is nothing but
imparting the ability to understand human language as it is spoken to computer program.
3. Deep Learning: Deep learning is the subset of machine learning. It is a function of Artificial
Intelligence that imitates the workings of the human brain in processing data and creating
patterns for making decisions. Deep learning programs are able to make decisions by using
network of our brain cells, called neurons.
4. Neural Networks: Neural networks are a set of algorithms, modeled loosely after the

P
human brain, that are designed to recognize patterns.
All these components get together and form smartest generation of computers, called AI
computers.

Timeline of Artificial Intelligence


PM
The field of AI is not new, it has its roots in the 1950s.

In 1955, John McCarthy, a young Assistant Professor of Mathematics at


Dartmouth College, in Hanover, New Hampshire, decided to organize a group
to clarify and develop ideas about thinking machines. He picked the name
Artificial Intelligence for the new field and was known as the father of Artificial
Intelligence (AI).
John McCarthy

IT PLANET - 8 (GIGABYTE)
For more than 50 years, scientists have been trying to make a machine with artificial intelligence
that is close to human intelligence. But achieving an artificial intelligence wasn't so simple as large
volume of data was not easily available. After several disappointments in AI, a period from 1974–93
was known as the AI winter.
But research began to pick up again after that, and in 1997,
IBM's Deep Blue became the first computer to beat the
Russian chess grandmaster Garry Kasparov.

Watson

In 2011, the computer giant's question-answering system 95


Watson won the quiz show Jeopardy by beating reigning
human champions Brad Rutter and Ken Jennings.
In 2019, the new A13 chips announced by Apple for
their iPhone 11, literally are bringing the power of AI to
the hands of the consumer. Other manufacturers are
also developing mobile phones with AI chips.

It is expected that by the year 2050, Artificial Intelligence will be


able to perform many of the intellectual tasks that a human can
perform, according to the projection by several experts on AI.

Artificial Intelligence in Daily Life


Artificial Intelligence has already become an intrinsic part of our daily lives and has greatly
impacted our lifestyle. It is all around us and we are dealing with it. But how close are we to
that all-powerful machine intelligence?

VIRTUAL PERSONAL ASSISTANTS


P
These assistants are used to answer the queries and perform actions via a voice command.
How can it instantly answer your queries which you have asked in natural language? These
PM
assistants use AI to answer and perform various tasks.

Google Assistant
Google Assistant is an artificial intelligence-powered virtual assistant
developed by Google that is primarily available on mobile and smart
home devices. Your Google Assistant is always ready to help when
and where you need it.
Apple Siri
PM PUBLISHERS PVT. LTD.

Apple Siri is an artificial intelligence-powered virtual assistant which


is similar to Google Assistant, developed by Apple and is primarily
available on Apple devices.

Cortana
Cortana is your personal digital assistant developed by Microsoft. It
works for Windows 10, Windows 10 Mobile, Microsoft Band, Surface
Headphones, Xbox One, iOS, Android, etc.

Amazon Alexa
Amazon Alexa, known simply as Alexa, is a virtual assistant developed
96
by Amazon. It was first used in the Amazon Echo and the Amazon
Echo Dot smart speakers. Now it works with many devices like Amazon
fire stick.
SOCIAL NETWORKING
It is an online platform which is used by the people to build social networks with other people
who share similar personal or career interests, activities, backgrounds or real-life connections.

Facebook
When you upload photos on Facebook, it automatically
highlights faces and suggests friends to tag. How can it
instantly identify which of your friends is in the photo?
Facebook uses AI to recognize faces.

Snapchat
Facial filters in Snapchat track facial movements and allow
users to add animated effects or digital masks that adjust
when their faces move.

RIDESHARING APP
Rideshare platforms use a smartphone app which connects drivers with passengers in the
area. The process is very simple. Just open the app, request a ride, your driver arrives within

Ola / Uber P
minutes. These apps use AI to work for them.

Cab service of Uber and Ola are going head-to-head to make artificial
intelligence work for them. With the enhancement of virtual reality, riders are
PM
able to view where their cab will pull up and see the vehicle’s make/model,
beforehand to avoid vehicle confusion. It even assists drivers in the drop-off
visualization, based on congestion in real time. When the driver reaches the
end destination, fare payments get generated in the app automatically.

ONLINE SHOPPING
Online shopping is the process whereby consumers directly buy goods or services from a seller
in real-time, over the Internet. Amazon, Flipkart, eBay, etc. are the best online shopping apps.

Search and Recommendations

IT PLANET - 8 (GIGABYTE)
When you search for any product, your searches show all the
relevant products. You see recommendations for products
you’re interested in as ‘customers who viewed this item also
viewed’ and ‘customers who bought this item also bought’, as
well as via personalized recommendations on the home page
or at bottom of the item page.
INTERNET ADS
Almost everyone sees the ads (that is similar to their last
searches or interests) while scrolling up the Internet. You have
often noticed, when you scroll a web browser on your
computer after searching an item on any e-commerce site, the
97
item still flashes continuously on your current web browser,
even after you have closed the e-commerce site. These types
of ads are known as Internet ads.
AI PASSING STANDARD TEST
The AI system called Aristo, developed by the Allen
Institute, passed an eighth-grade science test, a
benchmark in AI development that scientists had been
aiming to reach for years. Aristo didn’t just pass the test,
it got an A for correctly answering more than 90% of the
questions on the test designed for New York students,
and then it went on to answer questions an exam for
12th graders, earning a solid B (80%).

Future of AI
Artificial Intelligence has gained importance in the last decade with a lot dependence on the
development and integration of AI in our daily lives. The future for AI is extremely promising
and it isn’t far from when we may have our own robotic companions.

AUTOMATED TRANSPORTATION
An autonomous car is also known as a driverless car. It is a
vehicle that is capable of sensing its environment and moving

P
safely with little or no human input.
Google began testing a self-driving car in 2012. Since then,
the U.S. Department of Transportation has released
definitions of different levels of automation with Google’s car
PM
and classified it as the first level down from full automation.
Many major automotive manufacturers, including General
Motors, Ford, Mercedes, Audi, Toyota, BMW, and Volvo, are
in the process of testing driverless car systems.

SMART CITY
There is no universally accepted definition of a Smart City. It means different things to
different people. The conceptualization of Smart City, therefore, varies from city to city and
country to country, depending on the level of development, willingness to change and reform,
PM PUBLISHERS PVT. LTD.

resources and aspirations of the city residents.


The core infrastructure elements in a smart city would include:
$ safety and security of citizens, particularly women, children and the elderly,
$ good governance, especially e-Governance and citizen participation,
$ sanitation, including solid waste management,
$ efficient urban mobility and public transport,
$ affordable housing, especially for the poor,
$ robust IT connectivity and digitalization,
$ adequate water supply,
98 $ assured electricity supply,
$ sustainable environment,
$ good health and education system.
SMART HOME
New home builders and existing homeowners are
integrating features that automate a wide variety of
tasks and enhance the overall at-home environment.
Wouldn't you love if you could switch on air conditioner
before reaching home or switch off lights even after you
have left home or unlock the doors to friends for
temporary access even when you are not at home?
Don't be surprised, companies are building products to
make your life simpler and convenient.

You are perhaps aware that today Amazon (through its Alexa)
and Google (through Google Home) are providing home
automation solutions that can manage lights, music, air-
conditioning, etc. Orient has introduced smart ceiling fans
that can be controlled through a remote and also an App.

Smart home has become the revolutionary ladder of success in the residential spaces, and it is

P
predicted that Smart homes will become as common as Smartphone one day.

Do You Know?
PM
A Famous Smart Home: Xanadu 2.0
When we talk of a Smart Home, the most well known is of Bill Gates. It is named Xanadu 2.0.

IT PLANET - 8 (GIGABYTE)

Some of its features are :


$ A high-tech sensor system that helps guests monitor a room's climate and light.
$ You can change the artwork on the walls with just the touch of a button.
$ The home theatre can accommodate 20 guests in plush seats.
$ Without a doubt, one of the most impressive parts of Bill Gates’ smart home is that he built it in the
1990s. Back then, smart technology wasn’t a term anyone knew. We didn’t have the Internet on our
phones, much less lighting preferences that followed us everywhere. Bill Gates has had an insight into the
future for decades, and his innovative home is one example.
Please follow this link to learn about the home of Bill Gates: 99
https://aconnectedhome.com/the-ultimate-smart-home-a-look-into-the-smart-technology-in-bill-gates-home/
TAKING OVER DANGEROUS JOBS
Robots are already taking some of the most hazardous
jobs available including bomb defusing. Welding, well
known for producing toxic substances, intense heat,
and earsplitting noise, can now be outsourced to robots
in most cases.

SOLVING CLIMATIC CHANGE


Machines have more access to data than a person ever could be. Using big data, AI could one
day identify trends and use that information to come up with solutions to the world’s biggest
problem Climatic change.

IMPROVED ELDER CARE


For many seniors, everyday life is a struggle, and they have
to hire outside help or rely on family members. Home
robots could help seniors in everyday tasks and allow them
to stay independent in their homes, which will improve their
overall well-being.

AI and Ethics
P
The motivation for teaching AI and Ethics to school students are:
PM
$ The average age at which a child receives his/her first
cell phone is decreasing.
$ The average age at which a child makes his/her
presence on social media is also decreasing.
$ We are teaching children about AI at class 8 itself, and
most of them may build AI systems by the time they
reach classes 11 and 12.
This is therefore the right stage to impart a sense of ethics. The purpose of an AI code of
PM PUBLISHERS PVT. LTD.

ethics is to provide you with guidance when faced with an ethical decision regarding the use
of artificial intelligence. The AI code of ethics mandates that:
$ AI systems should be safe and secure throughout their operational lifetime.
$ AI systems should be designed and operated so as to be compatible with ideals of human
dignity, rights, freedoms, and cultural diversity.
$ AI technologies should benefit and empower as many people as possible.
$ Use of weapons should be avoided.
$ if an AI system causes harm, it should be possible to ascertain why.
$ the data we use to train the machine should not be biased to color, gender, physical
100
appearance of people.
CHECKLIST
S
Self-Evaluation

ee
agr
ree

Dis
After reading the chapter, I know these points:

Ag
$ I know that Artificial Intelligence is a way of making a computer, a robot, or software
think intelligently, in a similar manner as humans think.
$ I know that Computational thinking involve expressing problems and their solutions
in ways that a computer could execute.
$ I know that John McCarthy, an American computer scientist pioneer and inventor,
was known as the father of Artificial Intelligence (AI).
$ I know that Machine learning provides capability to computers to automatically learn
and improve from experience without being explicitly programmed.

Exercises
A. Tick [ü] the correct answer.
1. In Artificial Intelligence timeline, the period from 1974–93 was known as ………...
a. AI summer

Pb. AI winter c. A I Cold


2. ………….. is personal digital assistant developed by Microsoft and works for Windows 10.
a. Google Assistant b. Apple Siri c. Cortana
3. Facial filters in …... application track facial movements and allow users to add animated effects.
PM
a. Ola b. Snapchat c. Facebook
4. Which AI system passed an eighth-grade science test developed by the Allen Institute?
a. Deep Blue b. Sophiya c. Aristo
5. Who owns the smarthome named Xanadu 2.0?
a. Bill Gates b. Steve Jobs c. Mark Zuckerberg

B. Write ‘T’ for True and F’ for False statements.


1. Those machines which work automatically are not truly intelligent.

IT PLANET - 8 (GIGABYTE)
2. There are five key techniques to computational thinking.
3. Neural networks are a set of algorithms, modeled loosely after the human brain.
4. Orient has introduced smart ceiling fans that can be controlled through an App.
5. Google began testing a self-driving car in 2015.

C. Fill in the blanks.


1. In 1997, IBM's .............................. became the first computer to beat the Russian chess
grandmaster Garry Kasparov.
2. ............................, an American computer scientist pioneer and inventor, was known as the
father of Artificial Intelligence (AI).
3. .................... learning is the subset of machine learning. 101
4. Facebook uses ........................ to recognize faces of people in a photo.
5. ........................ platforms use a smartphone app which connects drivers with passengers in the
area.
D. Answer in 1-2 sentences.
1. What do you mean by Artificial Intelligence?
...........................................................................................................................................................
...........................................................................................................................................................
2. Why Machine Learning is used in computers?
...........................................................................................................................................................
...........................................................................................................................................................
3. What is Deep Learning?
...........................................................................................................................................................
...........................................................................................................................................................
4. Write any two core infrastructure elements needed in a smart city.
...........................................................................................................................................................
...........................................................................................................................................................
E. Answer Briefly.
1. What was AI winter?
...........................................................................................................................................................

P
...........................................................................................................................................................
...........................................................................................................................................................
2. What is Computational thinking?
...........................................................................................................................................................
PM
...........................................................................................................................................................
...........................................................................................................................................................
3. What are virtual personal assistants? Give any one example.
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
4. Write any two AI ethics.
PM PUBLISHERS PVT. LTD.

...........................................................................................................................................................
...........................................................................................................................................................
..........................................................................................................................................................
F. Application Based Question.
Your elder brother is playing basic rock, paper and scissors game online where the machine tries to
win ahead by learning from the participant’s previous moves. On which concept this game is based?
..........................................................................................................................................................

Group Discussion
Discuss the topic ‘Is depending on AI for our day to day activities helpful’?
102
Online Link
To learn more about Artificial Intelligence, visit the website:
https://www.tutorialspoint.com/artificial_intelligence/artificial_intelligence_overview.htm
Discover More
Quick, Draw! with Google
If you have ever wanted to play Pic onary with AI (Ar ficial Intelligence), now is your chance!
The new game, Quick Draw! developed by Google prompts players to speedily draw six different
objects. As you start to draw the object, Quick, Draw!'s so ware automa on will start yelling out words
and phrases it thinks you're trying to illustrate. The result is a fun that makes machine learning
accessible, all while teaching Google's neural network to recognize different doodles.
The Quick Draw dataset is a collec on of millions of drawings, and you can be one of the contributors
to the dataset for AI. Your drawings can be used to help developers train new neural networks and
help ar sts create things they haven't begun to think of.
So what are you wai ng for — try it out yourself!
h ps://quickdraw.withgoogle.com/#

P
PM

Technology Trailblazers

IT PLANET - 8 (GIGABYTE)
Marvin Minsky

? Co-founder: MIT’s AI lab YEAR: 1960


Marvin Minsky was an American scientist in the field of artificial intelligence
(AI), co-founder of MIT's AI laboratory, author of several texts on AI and
philosophy, and winner of the 1969 Turing Award.
Marvin Minsky was born in New York, on 9 August, 1927. He holds a B.A.
degree from Harvard University (1949) and a Ph.D. degree from Princeton
University (1954), both in mathematics. Minsky has been a leading figure in
computer science since 1950s.
In the early 1960s, Minsky, along with John McCarthy, founded the MIT 103
Artificial Intelligence Laboratory.
8 App Development

Topics Covered
•Introduction to App •Android and iOS •Types of Apps •Categories of Apps •Working of Apps
•Developing an App

Introduction to App
An app, sometimes called application software, consists of
sist
programs designed to make users more productive and/or assist
them with personal tasks. It can run on our mobile phone,ne,
computer, Internet or any other electronic device.
The app is a modern name for the word application or
bile
software. The term ‘app’ is originally referred to as any mobile
or desktop application. But as more app stores have emerged d to
sell mobile apps to smartphone and tablet users, you probably bly
only hear the word ‘app’ in reference to a mobile app and web

P
app, which is a small piece of software running on a website. Apps
There are thousands of apps designed to run on today's smartphones and tablets. Some apps
can be downloaded for free, while others must be purchased from an app store. Apple's App
Store and Google's Play Store are two examples of popular app stores.
PM
Apple’s App Store Google’s Play Store

Android and iOS


Most of the mobile devices run on iOS or Android.
iOS is an operating system developed and supported by Apple and is
PM PUBLISHERS PVT. LTD.

used only on their own iPhones and iPads. In other words, in the
Apple universe, they control both the hardware and the software.
Android is an operating system for mobile computing devices
developed by Google. It is widely used on smartphones and tablet
computers. Google sells a few devices of its own but various hardware
manufacturers install Android as the operating system for their devices.

Types of Apps
Apps are software programs that provide specific functionality to your phone or tablet in a
simple, more user-friendly way. Nowadays, there seems to be an app for everything. Whether
it is checking up on breaking news, chatting with friends via social networking or even booking
104
last minute holidays, there’s an app out there to help you. But these apps are divided into
three main types.
1. Native App 2. Web App 3. Hybrid App
NATIVE APP
Native Apps are developed for a particular
platform or device. Apps built for systems like iOS, Native
Android, Windows phone, and Blackberry cannot App
be used on a platform other than their own. In
other words, you won’t be able to use Android
app on iPhone. The majority of the apps on your
mobile device are native apps. They’re installed
directly onto the device. These apps are distinctly
accessible from app stores of their kind. Native
apps offer the fastest, most reliable and most
responsive experience to users.
Native apps have access to various devices of a phone, such as its camera, microphone,
compass and address book. It is still possible to use the alternatives, but using native is the
easiest. In addition, users can use some apps without an Internet connection.

WEB APP

P
Web apps are actually websites that provide a user with experience similar to native apps.
Web apps are not deployed to an app store; rather, they are deployed to a web server and
users access them in a web browser from any device, whenever there is an Internet
connection. Developers write the Web app by using technologies including HTML5, CSS, and
PM
JavaScript. Many web apps use responsive design, which means the app displays properly on
any computer or mobile device.
Both the website and web app run on browser, but the major difference is that website
generally gives information whereas a web app provides functionality. For example, Wikipedia
is a website; it provides information, and Facebook is a web app; it provides functionality.
In contrast, a mobile app is a software you download from app store of a mobile device or
other location on the Internet to a smartphone or other mobile device. A mobile web app is a
web app that is optimized for display in a browser or on a mobile device, regardless of screen
size or orientation.

HYBRID APP IT PLANET - 8 (GIGABYTE)


A hybrid app is the combination of both native and web app elements. Native is developed for
specific platform and installed on the computing device. Web app is generalized for multiple
platforms and not installed on computing device but made available over the Internet through
browser.
Like native apps, hybrid apps are developed for specific platforms and deployed to an app
store. They can access many hardware features of a device, such as its camera. Like web apps,
they are built with HTML5, CSS, and JavaScript. Developers use development tools to package
this code with a browser and prepare it as a native app to deploy to popular app stores.
105
In this way, hybrid apps are cross-platform, it means the same code can run on many mobile
platforms. This approach often saves development time and costs, but may not provide a
consistent user experience or fast performance on all devices.
Categories of Apps
Nowadays, mobile phones are affordable across the world, so the app industry has absolutely
exploded in the last few years. The persons who were not using the app in the past are now
using it. Apps have become an integral part of today’s life. People are using mobile phones not
only to make calls, but mainly for using apps. They tend to do business, communicate,
entertain and play games, educate themselves, etc. by using apps. This has lead to the
development of many different types of apps.
Apple's App Store and Google's Play Store are two popular app stores which contain many
app categories as well as subcategories.
Now, we will discuss some of the popular app categories and their uses.

GAMING APPS
Gaming app helps the user improve their cognitive skills, such as attention and focus. Some
gaming apps encourage children to learn through play. Game apps also help find friends who
play the same game and post their scores on social media.
Examples of game apps you can play by yourself or with friends or others are:
Clash of Clans Candy Crush Saga Angry Birds Go
Temple Run

BUSINESS APPS OR PRODUCTIVITY APPS


P Solitaire Trivial Crack

Modern-day smartphones are capable of performing many complex tasks on the run.
PM
Productivity apps are developed to help us be more productive.
Examples of productivity apps are:
Google Calendars Translators To-do-list
Evernote Image Editing Dropbox

ENTERTAINMENT APPS
Entertainment apps are designed to entertain the users. These apps have a tendency to keep
the users engaged, logged in, and always checking for updates. Entertainment apps are
PM PUBLISHERS PVT. LTD.

distinguished from gaming apps because they often have quite different goals, even though
both of them seek to entertain the user.
Examples of entertainment apps are:
Netflix TikTok Talking Tom Cat
Amazon Prime Video YouTube Hotstar

UTILITY APPS
Utility app is used by everyone of us on a daily basis. These are handy tools and help you
perform simple tasks.
106 Examples of utility apps are:
Flashlight QR or Barcode Reader Internet Speed
Calculator SHAREit Camscanner
TRAVEL APPS
The main purpose of Travel apps is to make your traveling easier, more comfortable, fun and
informative. You can book your flights, hotels, trains, taxis, in fact all modes of transport with
the use of a Travel App. These apps also help you find unknown locations.
Examples of travel apps are:
Google Earth Google Maps MakeMyTrip
Goibibo Ola Uber
Google Trip TripAdvisor Airbnb
EDUCATIONAL APPS
Educational apps are making things easier for children to understand. These apps can make
children more interactive. Kids can learn while playing educational game apps. Moreover, many
educational apps are useful for teachers as well—organizing a teaching process, better
educating themselves, etc.
Examples of educational apps are:
Ted Duolingo Khan Academy
Lynda PhotoMath SoloLearn
Udacity

SOCIAL NETWORKING APPS P YouTube Coursera

Social networking apps enable you to connect with people, who share similar personal or
PM
professional interests. The main purpose of using social networking apps is to keep track of
what is going on in the lives of friends, family and colleagues, especially the people whom you
do not meet regularly. It also helps us expand the circle of friends and business contacts.
Examples of social networking apps are:
Facebook LinkedIn Google +
Instagram WhatsApp Telegram
GroupMe Twitter Snapchat

COMMUNICATION APPS

IT PLANET - 8 (GIGABYTE)
Communication apps enable you to impart or interchange thoughts, opinions, or information
by speaking, writing, or through signs.
Examples of communication apps are:
WhatsApp TrueCaller Imo
Skype hike FaceTime

SHOPPING APPS
Shopping apps enable you to purchase product by placing the order and pay through
credit/debit card on the Internet so that the product is delivered at your home.
Examples of shopping apps are: 107
Amazon Flipkart Snapdeal
Paytm Mall ShopClues ebay
Working of Apps
Apps are used to do specific function in your computer and mobile device. Mobile apps mostly
run on Android, Apple and Windows phone. Android has a huge market and lots of people are
using it, so in this chapter we will take the example of Android phone.
Your android phone comes with some apps built in, and you can install further apps to make
your device perform the tasks you need. You can download apps from Google’s Play Store or
other sources, run them as needed, and switch quickly among them.

RUNNING AN APP
If you need to use an app on your mobile device, you have to run it. You can run any app
from the Apps screen of Android mobile phone. You can run multiple apps at once. Each app
appears full screen, so you work in a single app at a time, but you can switch from one app to
another as needed. You can switch apps quickly by using the Recent Apps list.
1. Tap All Apps button from the Home Screen. The Apps screen appears.
If necessary, swipe The app opens
2 left to display in full screen.
more apps. Now, you can
2. Tap the app use it.

1
P you want to
use.
In this example,
we are using
PM
Calculator app.

INSTALLING AN APP USING GOOGLE PLAY STORE


Google Play Store has many types of apps available for your Android device to install and
work. If you need to install a particular app (Temple Run), you can navigate that app in the
Google Play store in Game category. You can also use the Search feature of Play store for
saving time. Searching returns a list of matches that you can explore in detail. When you find
an app you want, you can install it.
PM PUBLISHERS PVT. LTD.

1. Tap the Play Store icon on Apps screen.


The Play Store app opens and displays Google Play screen.
2. Type the name of the App (Temple Run) in the Search.
2
A list of matching results will appear.
3. Tap the app you want to install.
3 App info page
will appear.
1
4. Tap on
4 Install.
Downloading
108 and installing
the app process
The icon of app will appear in the App Screen. will start.
Now, you can run this app by touching its icon.
INSTALLING A NEW APP MANUALLY
The normal way to install an app on your Android phone is by downloading it from the Google
Play Store. But you can also load an app onto your device manually. For that, you acquire a
package file containing the app you want to install. You then transfer the package file to your
phone and install the app.
To allow installing the apps manually in your phone, you need to enable the option of
installation of apps from unknown sources by using Settings > Security > Unknown sources.
Android apps are saved with .apk extention.

Settings icon
P Security option Unknown sources option
PM
REMOVING AN APP
Every app you install takes up some of your device storage space and appears on the Apps
screen. When you no longer need an app you have installed, you can remove it from your
device. The app remains available to you on Google Play store, so you can easily reinstall it if
you want. You can remove an app by following these steps.

1. Tap the Settings icon on the Home screen or the Apps screen.
Settings screen will appear.

IT PLANET - 8 (GIGABYTE)
2. Tap or select Apps Management.
Apps Management screen will appear.
3. Scroll down the list until you find
the app you want to remove and
select it.
1 2 App info screen appears.

4. Tap on
3 4 Uninstall.
The app will
be removed.
109

Note: You should not remove the apps that come pre-installed in Android, you can only
remove the apps you have installed.
Developing an App
Mobile app is an application you download from application store of a mobile device or other
location on the Internet to a smartphone or other mobile device. You can also create an app for
your android mobile device.
There are many free app development software available on the Web. These software helps you
to build your own apps. In this section, we are using the app builder called MIT App Inventor.

MIT APP INVENTOR


MIT App Inventor is an open-source web application originally provided by Google, and now
maintained by the Massachusetts Institute of Technology (MIT). It lets you develop apps or
applications for Android phones using a web browser. It is very easy and user friendly. The App
Inventor programming environment has three key parts:
1. Component Designer: You use it to select components and specify their properties.
2. Blocks Editor: You use it to specify how the components will work.
3. Android Device (phone/tablet) or Emulator: You use it to run and test your app as you are
developing it. If you don’t have an Android device, you can test the apps you build by using
the Android emulator that comes with the system.

P
Note: MIT App Inventor is compatible with Google Chrome, Mozilla Firefox and Safari. In this
chapter, we will use Google Chrome as a Web browser.
Creating an App for Android
Follow the instructions and steps to develop your first android app called HelloWorld. In this
PM
app, you will see five components on the screen—TextBox, Button, label, TextToSpeech and
Image.
! Textbox component is used to enter the text.
! Button component is used to initiate an action.
! Label component is used to show text on the screen.
! TextToSpeech enables your Android device to speak the text.
! Image will enhance the appearance of the app.
PM PUBLISHERS PVT. LTD.

1. Create a Google Account.


With your Google account,
1 you can use all the services of
Google like gmail, Google
Drive, etc.
If you already have a Google
Account, skip this step.

2. In the Address bar of your


2 Web browser, type
www.appinventor.mit.edu
3
and press the Enter key.
110
The home page of app
inventor appears.
3. Click on Create apps!.
Google Sign in page will appear.
4. Type your user name and password that you have created in step 1 and click on Sign in.
The Welcome to App Inventor page appears.
5. Click on Continue.
6. Click on Projects option.
A menu will appear.
6
7. Click on Start new
7 project.
5 Create new App Inventor
project box appears.

8
8. Type the name for your project in the Project name box.
In this example, we have given the name ‘HelloWorld’.
9. Click on OK.
9 App Inventor opens the Component Designer window.

In Component Designer window, you will create the look and feel of your app. You can choose

P
components like Buttons, Images, and Text boxes, and functionalities like Text-to-Speech.

The Component Designer window is divided into four areas:


PM
Components Components Components
Palette Viewer List Properties

IT PLANET - 8 (GIGABYTE)

• Components Palette: On the left, there is a Palette, which is a list of components from
which you can select.
• Viewer: To the right of the Palette is the white area called the Viewer. Here you can
place the components to map out how you want your app to look like.
• Components Lists: To the right of the Viewer is the Components list. Any component
that you place into the Viewer will also show up in this list.
• Components Properties: To the far right is the Properties of components; when you
111
click a component in the Viewer, you will see its Properties listed here. Properties are
details about each component that you can change.
10. In Components Palette, open the
User Interface drawer if it is not
10 open.
11. Click and hold on the word TextBox
in the Palette.
13 12. Drag your mouse over to the Viewer.
12
13. Release the mouse.
A new TextBox will appear on the
11 Viewer. It will also appear in
Components List and Properties.

14. Click and drag the word Button from


14 the Palette to the Viewer.
A new Button will appear on the Viewer.
It will also appear in Components List
and Properties.

P
PM
15. Click and drag the word Label from
the Palette to the Viewer.
A new Label will appear on the Viewer.
15 It will also appear in Components List
and Properties.
PM PUBLISHERS PVT. LTD.

In the Components List, Button is


displayed as ‘Button1’. You can rename
it.
16
16. Click on the word Button1 in
Components List.
17. Click on Rename.
Rename Component dialog box appears.
18
19 18. Type the new name for the
112
component. In this example, we
17 have given WelcomeButton as new
component name.
19. Click on OK.
The new name for the button will appear in the Components List. You might have also noticed
that in the Viewer, Button still has the words ‘Text for Button1’ displayed on it. You probably
don’t want that in your app, so go ahead and change it in the Text Properties.

20. Click on the Button in Viewer.


21. In the Components Properties,
click the area under Text and type
20 the name for the button. You’ll
see the text changes in the
Viewer.
In this example, we have changed the
name as Welcome.
You can also change other properties
21 of the selected component, e.g. font
size, font shape, color of the text, etc.

In the Viewer, the Label has the words ‘Text for Label1’ displayed on it. You probably don’t
want that in your app, because it is used to show your text on screen, so go ahead and
remove it in the Text Properties.

22
P 24
22. Click on the Label component in
Viewer.
23. In the Components’ Properties,
PM
click the area under Text and
remove the text written in it.
You’ll see that the text will be
removed from Viewer.
24. Click the area under FontSize, and
23 change the font size from 14 to
25.
It will show the final message in a
new font size.

IT PLANET - 8 (GIGABYTE)
25. In Palette, open the Media drawer.
26. Click and drag the word
TextToSpeech from the Palette to
25 the Viewer.
This component will not appear in
the Viewer.
It will drop down under ‘Non-visible
26 components’ because it is not
something that will show up on the
app's user interface. It's more like a
tool that is available to the app.
It will also appear in Components List 113
and Properties.
27. In Components Palette, open the
27 User Interface drawer.
28. Click and hold on the word Image
28 in the Palette.
29. Drag your mouse over to the
29 Viewer.
30. Release the mouse.
A new Image will appear on the
Viewer. It will also appear in
Components List and Properties.

31. Click on Upload File in Media


32 section.
32. Click on Choose File.
31 Open Dialog box will appear.

33. Navigate the file you want to upload and click on it.

33
P Note: You should upload the small size picture as bigger
picture will cover the whole screen.
34. Click on Open.
PM
34

The name of uploaded picture appears here.

35 35. Click on OK.

The name of uploaded picture will


appear in Media section.
36 37 36. Click on Image1 in the Components
PM PUBLISHERS PVT. LTD.

38 list.
37. Click on Picture box in the
39 Properties panel.
A box will appear with the name of
uploaded image.
38. Click on the image name.
39. Click on OK.
The image file will appear in the
Viewer pane.
You can adjust the setting of image
from the Properties pane.
114
The components we have added to the HelloWorld app
Component type Palette group Name of component Purpose
TextBox User Interface TextBox1 Enter the text
Button User Interface WelcomeButton Press to show the message
Label User Interface Label1 Show the message
TextToSpeech Media TextToSpeech1 Speak the message
Image User Interface Image1 Show the image

Testing your app in Android device


You can view and test your app on an Android device as you create it. If you have an Android
device and an Internet connection with WiFi, do the following:
1. Tap the Play Store icon on Apps screen.
Play Store app opens and displays the Google Play screen.
2. Type MIT AI2 Companion in the Search.
2
App info page will appear.
3. Tap on Install.
Downloading and installing the app
1 3 process will start.

P The icon of app will appear in the App


Screen.
Now, you can run this app by tapping
its icon.
PM
App appears in the device after tapping its icon.

4 4. In App Inventor (in the browser), click on


5 Connect.
5. Click on AI Companion.

IT PLANET - 8 (GIGABYTE)
Connect to Companion dialog box appears showing the QR code (quick
response code) and six digits code.
6. On your device, If everything is
QR code Six digits launch the app you done, you
code
installed and select should see the
Scan QR Code, and HelloWorld app
then hold your device running on your
up to the QR code on mobile device.
the computer screen
to scan it.
6
OR Enter the six
115
digits code shown on
Now, whatever changes you will do
the computer screen
in the App Inventor, those changes
into the mobile
will appear on the device as well.
device.
Testing your app in Emulator
If you don’t have an Android device, you’ll need to perform some additional
setup in order to use the emulator. For that, you have to download and
install app inventor software into your computer.
You can download the app inventor from:
“http://appinventor.mit.edu/explore/ai2/windows.html”
Typically, it will go into your Downloads folder. From there, you can install it.
After installing in Windows, aiStarter icon may appear on your Desktop or
you can get it from the Start menu. If you want to use the emulator with
App Inventor, you will need to manually launch aiStarter on your computer,
when you log in. You can start aiStarter by clicking the icon on your desktop
or using your Start menu or using the path.
The software is installed under the path:
C:\Program Files\Appinventor\commands-for-Appinventor

1. After downloading,
installing and launching
1
2
P the software, click on
Connect in App
Inventor (in the
browser).
2. Click on Emulator.
PM
After some time,
depending upon the
speed of your
computer, the emulator
will appear on the
screen showing
HelloWorld app. Now
PM PUBLISHERS PVT. LTD.

whatever changes you


will do in the App
Inventor, those changes
will also appear on the
emulator.

116 Until now, both your connected mobile device and emulator can only show the App but cannot do any
thing in it as we haven’t instructed it to do anything in the app. To allow every component you add in
the Component Designer work, you have to move over to the Blocks Editor. In blocks editor, you
create the code to make that component work according to you.
Blocks Editor
In the Component Designer, you have added TextBox, Button, Label, TextToSpeech and Image
components as the building blocks for your first app. Now, let’s make your app work when you
tap the button. You do this with the Blocks Editor by instructing the components what to do
and when to do it.
1. Click on
1 Blocks.
The App
Inventor
opens Block
Backpack Editor
Built-in
window.
Blocks
Block Viewer

Components
Blocks

P
Main parts of Blocks Editor are given below:
Trash
PM
Built-in Blocks: These blocks are always available for you to use in your app.
Components Blocks: These are the blocks you have chosen for your app.
Block Viewer: This is the place where you assemble the blocks for your app.
Trash: It is used for deleting unneeded blocks.
Backpack: You can drag blocks into the Backpack icon so that you can use them later by
dragging items out of the backpack and use them between the apps. Backpack retains a copy
of your blocks even when you exit App Inventor.

IT PLANET - 8 (GIGABYTE)
1. Click on WelcomeButton component.
A bunch of blocks related to your
component appears in the viewer so that
you can use them to build the behaviour of
2 button.
2. Click on when WelcomeButton.Click do
block.
1 Here block is showing WelcomeButton,
because we have renamed the components
from Button1 to WelcomeButton. Otherwise
it will show ‘when Button1.Click do’.
117
When you click on any block, only that
block will remain in the viewer, all other
blocks will disappear.
You will notice that
the word when is
included on the
block. Which means
that this block will be
launched when the
button on your app is
clicked. It is called an
Event Handler.

3. Click on Label1
component.
A bunch of blocks related
to your components
appears in the viewer.
4. Click on set

3
4 P Label1.Text to
block.
This block instructs your
app to display the text.
PM
The selected block will
appear on the Viewer.
6 5. Click on set
Label1.Text to block
again.
6. Drag this block and
snap it into when
5
PM PUBLISHERS PVT. LTD.

WelcomeButton.Click
do block.

7. Click on Text block in


the Built-in area.
A bunch of blocks related
7 to Text component
8
appears.
8. Click on Join block.

118
9. Drag the Join block and snap
9 it into set Label1.Text to
block.
Join block appends all of the
inputs to make a single string.
By default, Join block has two
place folder to snap the
blocks, but we need three for
the app.

10. Click on the blue setting


10 icon of Join block.
A pop-up balloon appears
showing two strings in the
11 Join block. In this app, we
need three strings.
12 11. Click on the string block.
12. Drag and snap it under
two strings in the Join

P block.
You can click anywhere to
remove the popup balloon.
PM
You will notice that the
Join block now has three
14 placeholders to snap the
block.
13 13. Click on Text block in the
Built-in area.
14. Click on String block.
This string block can contain
characters.

IT PLANET - 8 (GIGABYTE)

15 16 15. Drag and snap it in the


first placeholder of Join
17 block.
16. Right-click on the String
block. A menu appears.
17. Click on Duplicate.

119
A duplicate of String block
appears.
18. Drag and snap it in the
third placeholder of Join
block.
18

19. Type the text in both


strings.
In this example, we have
19 written Hello in first string
block and, how are you!! in
second string block.

P
PM
20. Click on TextBox1
component.
A bunch of blocks related to
your components appears in
the viewer. Now search for
TextBox1.Text block by
20 scrolling down.
21. Click on TextBox1.Text
block.
PM PUBLISHERS PVT. LTD.

21
This block lets the users
enter text in a text box.

22. Drag and snap the


selected block in the
22 second placeholder of
Join block.

120
23. Click on TextToSpeech1
component.
A bunch of blocks related to
your components appears in
the viewer.
24 24. Click on call
TextToSpeech1.Speak
23 message block.
TextToSpeech block will make
the phone speak the text.

25. Drag and snap the


selected block inside the
WelcomeButton block
under the Label1 block.
25

P As this block is inside the


Button block, it will run
when the button on your app
is clicked.
PM
26 26. Right-click on the join
block. A menu appears.

27 27. Click on Duplicate.


A duplicate of Join block with
all three strings appears.

IT PLANET - 8 (GIGABYTE)

28. Drag and snap the Join


block in the TextToSpeech
block.
Now, whatever is shown in
the Label is audible in your
28 mobile device.

121
Running the App
After completing the app, you can run and test it in your connected android device or
emulator.
In this example, your device will show a Text box, button (Welcome) and an image.
When you write any text (students) in the Text box and press the button, the app will show a
message Hello students, how are you!! and speak this message too.
1. Go to the connected android device or
emulator.
You have already learnt how to connect
with android device and emulator.
In the emulator, you will use mouse to
click and work.
In the android device, you will use your
finger to tap and work.

Emulator Android device

4
2
P 4
2 2. Click or tap the Textbox.
A virtual keyboard will appear.
PM
3. Type the text (Students) with the
keyboard.
4. Click or tap the Welcome button.
PM PUBLISHERS PVT. LTD.

After clicking or tapping the button, a


message Hello students, how are you!! will
appear along with sound of message.

122
CHECKLIST
S
Self-Evaluation

ee
agr
ree

Dis
After reading the chapter, I know these points:

Ag
$ I know that an App consists of programs designed to make users more productive
and/or assist them with personal tasks.
$ I know that apps are divided into three main types — Native app, Web App and
Hybrid App.
$ I know that Apple's App Store and Google's Play Store contain many app categories
as well as subcategories.
$ I know that App Inventor is an open-source web application. It lets us develop
apps or applications for Android phones using a web browser.
$ I know that App Inventor programming environment has three key parts:
Component Designer, Blocks Editor, Android device or emulator.
$ I know that Blocks Editor is used for instructing the components what to do and
when to do it.

Exercises

A. Tick [ü] the correct answer. P


1. iOS is developed and supported by .......... and is used only on its own devices.
PM
a. Google b. Apple c. Android
2. ........................ apps are developed for a particular platform or device like iOS and Android.
a. Web b. Hybrid c. Native
3. ........... App helps the users improve their cognitive conditions, such as attention and focus.
a. Entertainment b. Gaming c. Utility
4. You can run any app from the ............................... of Android mobile phone.
a. App Screen b. Display c. Output Screen

IT PLANET - 8 (GIGABYTE)
5. In ............................... window, you will create the look and feel of your app.
a. Blocks Editor b. Properties c. Component Designer
6. ........................... is used for instructing the components what to do and when to do it.
a. Properties b. Blocks Editor c. Component Designer
B. Write ‘T’ for True and ‘F’ for False statements.
1. Web apps provide a user an experience similar to native apps.
2. Hybrid apps are developed for a particular platform or device.
3. Utility app is used by everyone of us on a daily basis.
4. Android apps are saved with .apk file extension.
123
5. To test your app on the emulator, click on Connect and then ai companion.
6. Backpack retains a copy of your blocks even when you exit app inventor.
C. Fill in the blanks.
1. A ............................... is optimized for display in a browser or on a mobile device.
2. ............................... app enables you to connect with people who share similar personal or
professional interests.
3. ...................... apps list is used to switch from one app to another quickly as needed in
android device.
4. ....................................... option enables you to install the apps manually in your mobile.
5. Any component that you place into the ............................... from Components Palette, will
also show up in Components list.
6. After creating, you can ............................... your app in Android device or in emulator.
D. Write the uses of the following.
1. Communication Apps: ................................................................................................................
.....................................................................................................................................................
2. Educational Apps: .......................................................................................................................
.....................................................................................................................................................
E. Differentiate between the following.
Native App
P
.................................................................
................................................................
Web App
.................................................................
.................................................................
PM
................................................................ .................................................................
F. Answer in 1-2 sentences.
1. What do you mean by App?
.....................................................................................................................................................
.....................................................................................................................................................
2. Name the different types of apps.
.....................................................................................................................................................
PM PUBLISHERS PVT. LTD.

.....................................................................................................................................................
3. What is an App store?
.....................................................................................................................................................
.....................................................................................................................................................
4. Name the areas of Component Designer window.
.....................................................................................................................................................
.....................................................................................................................................................
G. Answer Briefly.
1. What do you mean by Hybrid Apps? Explain.
124 ....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
2. What do you mean by MIT App inventor?
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
3. What is the purpose of Blocks Editor? Name its main parts.
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
H. Application Based Question.
Saanvi wants to wish ‘Happy Birthday’ to her best friend in a different way. One of her friends
suggests to make App in MIT App Inventor. She likes the suggestion and made an app to say
‘Happy Birthday’ to her friend. Now, she wants to run the App but she doesn’t know how to
run it. Help her by telling the option for running the app.
...........................................................................................................................................................

Group Discussion

insecure’. Do you agree?

Online Link
P
Divide the students into two groups and discuss the topic, ‘Mobile Apps make our life easier but
PM
To learn more about App development, visit the website:
http://appinventor.mit.edu/explore/teach/example_projects

Discover More
Voice Command for Personal Assistant
Many mobile operating systems include a virtual personal assistant like Google Assistant in Android and

IT PLANET - 8 (GIGABYTE)
Siri in Apple that processes voice commands and performs certain tasks. For example, you can issue
voice commands to set an alarm, add an appointment, send a text message, or run an app. Given
below are some of the voice commands.
TASK SAMPLE VOICE COMMAND(S)
Change phone settings “Turn on Wi-Fi.” or “Turn off Bluetooth.”
Dial a number “Call Reema’s Cell” or “Call Home” or “Dial 110088989.”
Obtain information “When was Mahatama Gandhi born?”
“How many bits are there in a byte?”
Obtain driving instructions “Navigate to Rajiv Chowk, New Delhi, India.”
Perform a search “How is the weather in Punjab?”
“Search Dominos Pizza outlets in Delhi.”
Run an app “Run calculator”
125
Send a text message “Text Haqe, meet me in the office at 10:00 am.”
Set a reminder “Remind me to attend a workshop on Friday”
Set an alarm “Set an alarm for 6:00 a.m. tomorrow.”
Activity Section
Lab Activity
Create an app on Computer Parts. Add a background image to the screen and six buttons,
namely, Parts of Computer, Input Devices, Processing Device, Storage Devices, Output
Devices and Back button. If you click on any of the buttons, appropriate image should be
opened with the spoken message regarding the topic.
Note: Your background images and spoken message may vary.

P
PM
PM PUBLISHERS PVT. LTD.

126
9 Python - Introduction

Topics Covered
•Programming Language •Introduction to Python •Character Set •Tokens •Comments •Statements •Data
Types •Variables •Defining Input and Output in Python •Error Handling in Python •Programs in Python

Programming Language
A computer language is a medium of communication between the user and a computer.
Computer language has its own character set, keywords and symbols, which are used for
writing a program.
Computer programs are instructions to a computer. These instructions tell a computer to
perform the tasks necessary to process the data into information. The process of writing these
instructions (program) is called programming. The people who can write these programs are
called programmers.
A programming language is a set of words, symbols and codes that are used to write a

Introduction to Python P
computer program. Python is one such programming language.

Python is a high level, structured, open source programming language that supports the
PM
development of wide range of applications from simple text processing to world wide web
browsers to games. Python was founded by Guido Van Rossum in early 1990's. It is named
after “Python's Flying Circus”, a comedy program.

FEATURES OF PYTHON PROGRAMMING


The growth and usage of Python are increasing day by day due to the following features:
1. Python is easy to use and learn.
2. Python is an open source language and available free at https://www.python.org/downloads/.

IT PLANET - 8 (GIGABYTE)
3. Python can run equally on different platforms, such as Windows, Linux, Unix and
Macintosh. So it is a portable language.
4. Python can be used for Graphical User Interface (GUI) programming.
5. It is a high level programming language and user friendly in nature for developers.
6. Programming in Python is fun. It's easier to understand and write coding in Python than
any other high-level language. The syntax feels natural. For example:
a = 2
b = 3
sum = a + b
print(sum)
Even if you have never programmed before, you can easily guess that this program adds 127
two numbers and prints it.
7. Python is an interpreted language that executes the code line by line at a time. This makes
the debugging process easier.
8. Python supports both procedure-oriented and object-oriented programming.
9. Python is an extensible language, it means that it can be extended to other languages.
10. Programs written in Python are typed dynamically which means that the type of the value
is decided at run time. There is no need to specify the type of data while declaring it. It's
not necessary to add semicolon at the end of the statement. Python enforces you to apply
proper indentation. These small things can make learning much easier for beginners.
Due to these features and variety of applications of Python, people and organizations are
preferring this language over other languages.

PYTHON PROGRAMMING STYLES


Python is a general purpose programming language and supports multiple structure approach.
Following paradigms are supported by Python:
! Object Oriented Approach: Python allows the programmer to create classes and objects.
! Procedure Oriented Approach: The code can be grouped into functions in Python as in
procedure oriented approach. Stepwise execution of tasks is done using functions.
! Imperative: This style is useful for manipulating data structures and produce simple codes.
Combination of the above programming paradigms makes the Python language more flexible

programming paradigms approach.

INSTALLING PYTHON
P
and easy to use. Therefore, organizations are moving towards this language due to its multiple

Python comes in three versions: Version 1.0, Version 2.0 and Version 3.0. Many series are
PM
available in these versions. You can download the specific version of Python for Windows from
https://www.python.org/downloads/windows/.
In this chapter, we are using version 3.8.

INTEGRATED DEVELOPMENT AND LEARNING ENVIRONMENT


After installing, when you open the Python, you will get this window.
PM PUBLISHERS PVT. LTD.

Prompt

This is the Python shell, which is part of Python’s integrated development environment. An
Integrated Development and Learning Environment (IDLE) is the most popular graphics based
development environment for Python. It is easy to create, edit, debug a program in this
environment.
This window is called Interactive mode. The interactive mode screen shows the welcome
message with version details and the three greater-than signs (>>>) called the prompt. This is
128 a primary prompt which indicates that interpreter is executing the Python command. There is
also a secondary prompt (…) which indicates that interpreter is waiting for the input to
complete the statement. All the statements or expressions or commands are written after the
primary prompt in the Interactive mode window.
Let’s enter a command “Welcome to Python” at the prompt.
>>> print (“Welcome to Python”)

Make sure to include the double quotes (" "). Press Enter key on your keyboard when you
have finished typing the line. If you have entered the command correctly, you should see
something like this:
>>> print ( “Welcome to Python” )
Welcome to Python
>>>

P
PM
The prompt (>>>) should reappear to tell you that the Python shell is ready to accept more
commands.
In the above program the word print is a type of Python command called a function, and it
prints out whatever is inside the quotes to the screen.
Great! You’ve just created your first Python program.

SAVING YOUR PROGRAM

IT PLANET - 8 (GIGABYTE)
You don’t need to rewrite the same program every time you want to use it. It might be fine to
just rewrite short programs, but a large program could contain millions of lines of code. For
this reason, we can save our program for future use.
The interactive mode is best for small programs and for the beginners. But we can't save the
commands in interactive mode for future use. For saving a program, you need to open and
write a program in another Python shell, called Script mode.

2 1. Open IDLE (Python GUI).


3 2. Click on File menu.
3. Click on New File.

An empty window will appear, with Untitled 129


displayed in the Menu bar.
This is another Python shell, which is called Script
Mode.
Creating, Saving and Running a program in Script mode
Let’s enter a command “Welcome
to Python” in Script mode.
1
1. Type print (“Welcome to
Python”)

2. Click on File menu.


2 3. Click on Save.

P Save As dialog box appears.


By default the file will be saved in Python folder in
C: drive, but you can change the location.
4. Type the filename (MyFirstProgram).
PM
The file extension of Python is .py.
5. Click on Save.
The Python will save the program in the specified
4
location.
5

The new filename will appear on


6 the Title bar.
PM PUBLISHERS PVT. LTD.

7
6. Click on Run menu.
7. Click on Run Module.

You can also press F5 key to run the program.

If you’ve entered the


command correctly, your
saved file should run like
this in Interactive mode.

130
Now, if you close the shell window but leave the MyFirstProgram.py window open and then
choose Run > Run Module, the Python shell reappears, and your program will run again.
LINES AND INDENTATION
Python is very particular about program layout, especially regarding lines and indentation.
A Python program is made up of one or more physical lines. Each physical line may end with a
comment. The text written in the comments are ignored by Python.
In Python, the end of a physical line marks the end of most statements. Unlike other
languages, you don’t need to terminate Python statements with a semicolon (;).
Python uses indentation to express the block structure of a program. An indentation is an
empty space at the beginning of a line to signal the start of a new paragraph. Unlike other
languages, Python does not use braces, or other beginning/end symbols, around blocks of
statements; indentation is the only way to denote blocks.

Character Set
Character set is a set of valid characters that a language can recognize. Python uses the
traditional ASCII character set. Python version 3 source file can use any Unicode character. A
version 2 source file is usually made up of characters from the ASCII set (character codes
between 0 and 127). The ASCII character set is a subset of the Unicode character set. Python

P
version 2.7 also recognizes the Unicode character set.

Tokens
PM
A token is the smallest element of a program that is meaningful to the interpreter. Tokens
supported in Python include identifier, keywords, delimiter, and operator.

IDENTIFIERS
A random name made out of letters, digits and underscore (_) to identify a function name, a
program name, a memory location (variable or constant) is known as identifier. Python is a
case sensitive language as it treats lower and upper case letters differently. Following rules
must be followed for creating identifiers:

IT PLANET - 8 (GIGABYTE)
! Must start with a letter A to Z or a to z or an underscore (_).
! Can be followed by any number of letters, digits (0-9), or underscores.
! Cannot be a reserved word.
! Python does not allow punctuation characters such as @, $ and % within identifiers.
! Class names start with uppercase letter.
! Starting an identifier with single underscore indicates that identifier is private.
Examples: shapeclass shape_1 shape_to_db

KEYWORDS
Keywords are the reserved words in Python and cannot be used as constant or variable or any 131
other identifier names. All the Python keywords contain lowercase letters only.
Following is the List of Python Keywords:
true false none and as
assert def class continue break
else finally elif del except
global for if from import
raise try or return pass
nonlocal in not is lambda

DELIMITER
The following characters and combinations are used by Python as delimiters in expressions, list,
dictionary, and various statements:
( ) [ ] { }
, : . ` = ; @
+= -= *= /= //= %=
&= |= ^= >>= <<= **=

perform operations. P
The last two rows are the augmented assignment operators, which are delimiters, but also

The following ASCII characters have special meanings as part of other tokens.
PM
' " # \
The following ASCII characters are not used in Python.
$ ?

LITERALS
The data items that never change their value throughout the program run are called literals.
Theoretically Literal means any number, text or other information that represents a value.
PM PUBLISHERS PVT. LTD.

Python supports the following literals:


Literals Examples
String literals :: "hello" , '12345'
Integer literals :: 0, 1, 2, -1, -2
Long literals :: 89675L
Floating-point literals :: 3.14
Complex literals :: 12j
Boolean literals :: True or False
Special literals :: None
132
Unicode literals :: u"hello"
List literals :: [5, 6, 7]
OPERATORS
Operators are the special symbols that carry out arithmetic and logical computations. The
values operated by the operator are called operands. Following are the operators used in
Python:
1. Arithmetic Operators: Arithmetic operators are used to perform mathematical operations.
The various arithmetic operators are given in table below:
Operator Meaning Example
'+' Addition and concatenation in strings >>> 200+45
245
>>> "Good" + " "+ "Morning"
‘Good Morning’
'-' Subtraction >>> 100-20
80
>>> 80-160
-80
'*' Multiplication >>> 4*5

P 20
>>> 'python' *3
'pythonpythonpython’
PM
'/' Divide >>> 28/4
7.0
>>> 50/6
8.333333333333334
'%' Modulos / Remainder >>> 67%9
4
'**' Exponentiation >>> 8**2

IT PLANET - 8 (GIGABYTE)
64

2. Relational Operators or Comparison Operators: These operators are used to compare the
values. Following is the list of comparison operators:

Operator Meaning Example


'>’ Greater Than >>> 6>1
True
>>> 90>100
False
'<’ Less Than >>> 8<9
True 133
>>> 70<54
False
>=’ Greater than or equal to >>> 9>=5
True
>>> 5>=9
False
'<=’ Less Than or Equal to >>> 1<=2
True
>>> 20<=10
False
'==’ Equal to >>> 6==7
False
>>> 7==7
True
'!=’ ‘Not Equal to’ >>> 7!=4
True

Operator Meaning
P
3. Logical Operators: Logical operators perform Logical AND, Logical OR and Logical NOT
operations.

Example
PM
or If any of the operands is true then >>> x=True >>> x=False
condition becomes true. >>> y=False >>> y=False
>>> x or y >>> x or y
True False
and If both the operands are true >>> x=True >>> x=True
then condition becomes true. >>> y=True >>> y=False
>>> x and y >>>x and y
PM PUBLISHERS PVT. LTD.

True False
not Reverse the state of Operand >>> a=False >>> a=True
>>> not a >>> not a
True False

4. Assignment Operators: These operators are used to assign value to the variables. Following
are the list of assignment operators:

Operator Meaning Example


'=' Assign the value from right >>> x=30 #Assign the value 30 to x
134
side to variable. >>> print (x) #print the value of x
30
'+=' Add and assign the value >>> a=12
to the variable. >>> a+=2
>>> print (a)
14
'-=' Subtract and assign the value >>> a=12
to the variable >>> a-=2
>>> print (a)
10
'*=’ Multiply and assign the >>> a=12
value to the variable >>> a*=2
>>> print (a)
24
'/=' Divide and assign the value >>> a=12
to the variable >>> a/=2
>>> print (a)
6.0
Operator Precedence
P
Operator precedence determines the order in which expressions are evaluated, so you can
predict the outcome of an expression. It can also determine the overall value of the expression.
For example, take the following expression: a = 8 + 6/2. Depending on whether the 8 + 6
PM
expression or the 6/2 expression is evaluated first, the value can end up being 7 or 11. Python
follows operator precedence rules for solving the expression as shown in the table.
While solving the expression, operators follow
the table and evaluate according to the priority Priority Operators Description
level. Operators on the same line have the same 1st () Parentheses
precedence and are evaluated left to right based 2nd */% multiplication, division,
on how they appear in the expression itself. modulus
Now for the same expression a = 8 + 6 / 2, 3th +- addition, subtraction
according to this table, the division is evaluated 4th = assignment

IT PLANET - 8 (GIGABYTE)
before addition, so the value will be 11.

Comments
Comments are very important while writing a program in any language. Python ignores the text
written in the comment. Python supports the following ways to use comments in a program:

SINGLE LINE COMMENTS


Python uses hash (#) symbol for writing a comment for a single line.
Example:
#This is the start of program This is a single line comment 135
#print hello in python This is a single line comment
print (“Hello”) This is a statement
MULTI-LINE COMMENTS
Python uses triple quotes ' ' ' or “ “ “ for multi-line strings.
Example
“ “ “ This is an example of
multiline comment” ” ” # multi-line comments

Statements
Simple and compound are two types of statements in Python source file. Unlike some other
languages, Python has no “declarations” it just contains statements.
SIMPLE STATEMENT
A simple statement lies entirely within a logical line. You do not need to place more than one
statement on a single logical line, with a semicolon (;) as the separator. Python recommends
one statement per line and makes programs more readable.
COMPOUND STATEMENT
A compound statement contains one or more statements and controls their execution. A

P
compound statement has one or more clauses, aligned at the same indentation. Each clause
has a header starting with a keyword and ending with a colon (:), followed by a body, which is
a sequence of one or more statements. When the body contains multiple statements, also
known as a block, these statements are on separate logical lines after the header line,
indented four spaces rightward. The block ends when the indentation returns to that of the
PM
clause header.

Data Types
Data types are used to define the type of value a data can contain. Data values in Python are
known as objects and each object has a type. A type of object determines which operations
the object supports. Data types define the way to store the values in memory.
Python has built-in data types such as numbers, strings, tuples, lists, dictionaries, and sets.
Some of them are discussed in this chapter. You can also create user-defined types, known as
PM PUBLISHERS PVT. LTD.

classes. Data Types are of two types:

NUMBERS
The built-in numeric types in Python include integers numbers, floating-point numbers, and
complex numbers.

Integer/Long
Integers are the whole numbers consisting of + or – sign without decimal digits such as 1000, -
88, etc. Range of an integer in Python can be from -2147483648 to 2147483647.
Long integer has unlimited range subject to available memory. The long integer value is
136 handled by Python automatically. The long integer value can be appended L with value.
Example: >>> a=12 # This is an integer value
>>> b=4324L # This is a long integer value
Float
Float data type represents floating point numbers which contain decimal point. For example,
0.5, -4.567, 0.001, etc. are called floating point numbers.
These numbers can also be written in scientific notation by using 'e' or 'E' to represent the
power of 10. Here 'e' or 'E' represents exponentiation.
Example: 4.6×10⁵ is written as 4.6E5. # This is a floating point value
Complex
A complex number is a number that is written in the form of a+bj or a+bJ. Here 'a' represents
the real part of the number and 'b' represents imaginary part of the number. The suffix 'j' or
'J' indicates square value of -1. The real and imaginary part may contain integers or floats.
Example: >>> c=4+5j # This is a complex value

SEQUENCE
A sequence is an ordered collection of items, indexed by positive integers. The three types of
sequence data type available in Python are; Strings, Lists and Tuples.

String
P
String is a sequence of characters used to store and represent text-based information. Single
and double quotes are used to represent strings in Python.
PM
Example: >>> name="reema" # name stores a string value

Lists
List contains the list of elements separated by comma and enclosed within square brackets
([ ]). For example,
Example: >>> list= [10, 20, "abc”] # creates list with different types of elements

Tuple

IT PLANET - 8 (GIGABYTE)
Tuple is similar to the list. It contains a group of elements that can be of different types. The
elements in the tuple are separated by comma and enclosed in parentheses ().
Example: >>> tuple1=(10, 20, "abc") # creates tuple with different types of elements

Variables
Variables are used to store data in the memory. The data can be numbers, text and objects.
The data is given a name, so that it can be re-called whenever it is needed. Python program
needs that data stored in the memory to do its job.
Another way of looking at a variable is that it is like a label for something. 137
For example, to create a variable named rose, we use an equal to sign (=) and then tell Python
what information the variable should be the label for.
Here, we create the variable rose and tell Python that it labels the number 100:
>>> rose = 100 # here we say that rose labels the number 100
To find out what value a variable labels, enter print in the shell, followed by the variable name in
parentheses, like this:
>>> print(rose) # here we ask what rose is labeling
100 # here Python prints the result
We can also use more than one variable for the same item:
>>> rose = 100
>>> flower = rose
>>> print(flower)
100
In this example, we’re telling Python that we want the variable flower to label the same thing as
rose by using the equal sign between flower and rose.
So, now, rose is not a very useful name for a variable because it most likely doesn’t tell us
anything about what the variable is used for.
You can also write variables like total_marks:
>>> total_marks = 500
>>> print(total_marks)
500
P
This example shows that we’re talking about 500 marks.
Variable names can be made up of letters, numbers, and the underscore character (_), but they
PM
cannot start with a number. It also cannot use a reserved word.

Defining Input and Output in Python


A program needs to interact with user to complete a desired task which is done through Input-
Output facility. Input refers to the data entered by the user of program. Python provides built
in functions for defining input and output. Some of the functions like input () and print () are
used for standard input and output operations in Python.
The syntax of these functions are as follows:
PM PUBLISHERS PVT. LTD.

INPUT IN PYTHON USING INPUT ( ) FUNCTION


The syntax and example of input() function is:
Syntax: input([prompt]), where prompt is the string you want to display.
Example: >>> num=(input("enter a number:"))
enter a number:23
>>> num
'23' #entered value 23 is a string, not a number
To convert this into a number we can use int() or float() functions.
Example: >>> int('23')
138 23 #entered value 23 is a number, not a string
>>> float('23')
23.0 #entered value 23.0 is a float
OUTPUT IN PYTHON USING PRINT( ) FUNCTION
The syntax and example of print() function is as follows:
Syntax: print (expression/constant/variable)
Print evaluates the expression before printing it on the monitor. Print statement outputs an
entire (complete) line and then goes to next line for subsequent output(s).
To print more than one item on a single line, comma (,) may be used.
Example 1: >>> print ("hello")
hello
Example 2: >>> print (3+5)
8
Example 3: >>> print (6*7)
42
Example 4: >>> print ("class 8 student")
class 8 student

Error Handling in Python


P
Python is an interpreted language which executes the code line by line at a time after
checking the errors. An error is a bug that prevents a program from executing in correct
PM
manner. This makes the debugging process easier.
A Python program mainly contains following types of errors:
Syntax Errors
Every programming language in computer has certain rules and regulations. Syntax error will
occur when these rules and regulations of computer language are violated.
Example: >>> Print ("hello")
Syntax Error: invalid syntax # type print in lower case for correct result
>>> print ("hello")

IT PLANET - 8 (GIGABYTE)
hello
Logical Errors
These errors are also known as semantic errors. They cause the program to behave incorrectly,
but they do not usually crash the program.
Example: x = float(input('Enter a number: '))
y = float(input('Enter a number: '))
z = x+y/2 # It will give 8.5 as answer
Logical Error: invalid logic # put x+y in braces as (x+y) for correct result
z = (x+y)/2 # It will give 6 as answer
139
Programs in Python
Let's go through some simple Python programs to understand this interesting and powerful
language properly. Write the program in Script mode (Python shell).
Program 1:
To take two integers as input and find their sum.

Source code in Script Mode

P Output in Interactive mode


PM
Program 2:
To take length and width of a rectangle as input, and find its perimeter and area.
PM PUBLISHERS PVT. LTD.

Source code in Script Mode

140

Output in Interactive mode


CHECKLIST
S
Self-Evaluation

ee
agr
ree

Dis
After reading the chapter, I know these points:

Ag
$ I know that Python is an interpreted and high level programming language.
$ I know that Interactive and script are two modes of programming in Python.
$ I know that Data Types define the way we use storage in the programs we write.
$ I know that tuple, range, list are the Data Types of Python.
$ I know that Interpreter is used for translating and executing the code line by line.
$ I know that input() function is used for taking inputs from users.
$ I know that print() function produces the output on the screen.

Exercises
A. Tick [ü ] the correct answer.
1. ........................... is high level, structured, open source programming language.
a. Python

P b. Logo c. Qbasic
2. Python was founded by Guido Van Rossum in early ........................... .
a. 1970s b. 1980s c. 1990s
3. Python is an ........................... language which executes the code line by line at a time.
PM
a. Compiled b. Runtime c. Interpreted
4. ........................... is a set of valid characters that a language can recognize.
a. Character Set b. Token c Variable
5. The values operated by the operator are called ........................... .
a. Constants b. Operands c Delimiters
B. Write ‘T’ for True and ‘F’ for False statements.
1. Python is named after “Python's Flying Circus”, a comedy program.

IT PLANET - 8 (GIGABYTE)
2. Python can run equally on different platforms such as Windows, Linux, Unix
and Macintosh.
3. The Shell mode is best for small programs and for the beginners.
4. .py is the extension of a python program.
5. Python is not a case sensitive language.
C. Fill in the blanks.
1. The ........................... mode screen shows the welcome message with version details.
2. Python uses ........................... to express the block structure of a program.
3. ........................... are the reserved words in Python and cannot be used as constant or
variable or any other identifier names.
141
4. ....................... are the data items which never change their value throughout program run.
5. A ........................... is an ordered collection of items, indexed by positive integers.
D. Define the following.
1. Character Set: ...........................................................................................................................
....................................................................................................................................................
2. Token : .......................................................................................................................................
....................................................................................................................................................
3. Operator: ...................................................................................................................................
....................................................................................................................................................
E. Differentiate between the following.
1. Interactive mode Script mode
................................................................. .................................................................
................................................................ .................................................................
................................................................ .................................................................
2. Relational operators Assignment operators
................................................................. .................................................................
................................................................ .................................................................

F. Answer in 1-2 sentences.


1. Who developed Python and when?
P
................................................................ .................................................................
PM
.....................................................................................................................................................
.....................................................................................................................................................
2. What do you mean by Data Type?
.....................................................................................................................................................
.....................................................................................................................................................
3. What is Input function? Write its syntax.
.....................................................................................................................................................
PM PUBLISHERS PVT. LTD.

....................................................................................................................................................
4. What is Output function? Write its syntax.
.....................................................................................................................................................
....................................................................................................................................................
5. What is operator precedence?
.....................................................................................................................................................
....................................................................................................................................................
G. Answer Briefly.
1. What are the features of Python?
142 .....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
. 2. How many Data Types are used in Python?
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
3. How can variables be declared?
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
4. What are the various types of errors in Python?
.....................................................................................................................................................
.....................................................................................................................................................
....................................................................................................................................................
H. Application Based Question.
Riya has written a program in Python in which she has used input function for giving input
value of a variable. After executing the program that value is a string, not a number. She wants
to convert this string into a number. By which function she can do so?

P
...........................................................................................................................................................

Group Discussion
PM
Divide the students into two groups and discuss the topic, ‘Why Python has become a popular
language now-a-days’?

Online Link
To learn more about working of Python, visit the website:
https://www.pythonforbeginners.com/basics/python-syntax-basics

Activity Section

IT PLANET - 8 (GIGABYTE)
Lab Activity
A. Perform the following on Python IDLE.
1. 5+(3*4) .......................................................
2. (12/3) + 4 .......................................................
3. 3+4*6 .......................................................
4. 8+3*10 .......................................................
5. (8+3)*10 .......................................................
B. What will be the output of the following code:
a = 3 - 4 + 10
b=5*6
c = 7.0/8.0 143
print ("These are the values:", a, b, c)
.........................................................................................................................................................
C. Write the following program in Python to find the perimeter and semi-
perimeter of a triangle.
# Program to find the perimeter and semi-perimeter of a Triangle

a = float(input('Please Enter the First side of the Triangle: '))


b = float(input('Please Enter the Second side of the Triangle: '))
c = float(input('Please Enter the Third side of the Triangle: '))
Perimeter = a + b + c
s = (a + b + c) / 2
print("\n The Perimeter of Triangle = %.2f" %Perimeter);
print(" The Semi Perimeter of Triangle = %.2f" %s);

Discover More
Raspberry Pi

P
The Raspberry Pi is a low cost, credit-card sized computer,
developed in the United Kingdom by the Raspberry Pi
Foundation to promote the teaching of basic computer
science in schools in developing countries. The objective of
PM
Raspberry Pi, being used by kids all over the world, is to learn
to program and understand how computers work.
Raspberry Pi plugs into a computer monitor or TV, and uses a
standard keyboard and mouse. It is a little device that enables
people to explore computing and to learn how to program in
languages like Scratch and Python. It is capable of doing
everything you'd expect a desktop computer to do, from
browsing the Internet and play high-definition video to making Raspberry Pi
spreadsheets, word-processing, and playing games. The
Raspberry Pi 3 is the latest version of the Raspberry Pi.
PM PUBLISHERS PVT. LTD.

HOW DO I GET STARTED WITH THE RASPBERRY PI 3?


Raspberry Pi itself is just a small board. You'll also need a
power supply, a monitor or TV, a HDMI cable to connect the
monitor, a mouse and a keyboard.
Once you've plugged in all the cables, the easiest way for new
users to run the Pi is to download the NOOBS (New Out-of-Box
Software) installer. Once the download is complete, follow the
instructions to install an Operating System (Raspbian) on the Pi.
The look and feel of Raspbian is like any desktop computer. The
OS, which is constantly being improved, recently had a
144 graphical overhaul and includes an optimized web browser, an
office suite, programming tools, educational games, and other
software.
10 Python - Control Structures

Topics Covered
•Control Structures •Conditional Control Structures •Loop Control Structures •Break Statement
•Continue Statement

Control Structures
A program is the set of instructions which are executed in sequential manner. In some
situations, we have to change the order of execution of the program based on conditions or
repetition of statements until conditions are met. Therefore, control statements are used to
control or change the flow of execution. Three basic control structures are:
1. Sequential 2. Conditional 3. Loop
Sequential Control Structure: A sequential control structure shows one or more actions
following each other in order. Actions include input, process, and output. All actions must be
executed, that is, none can be skipped. Examples of actions are calculating totals and printing

P
them. The programs you have learnt in previous chapter have followed this control structure.
Conditional Control Structure: A conditional control structure tells the program which action
to take, based on a certain condition.
Loop Control Structure: The loop control structure enables a program to perform one or more
PM
actions repeatedly as long as a certain condition is met.
INDENTATION IN PYTHON
Python programs get structured through indentation, i.e. code blocks
are defined by their indentation. All the statements in conditional
and looping statements are structured using indentation rather than
using curly braces ({}).
This principle makes it easier to read and understand other people's
Python code. Leading whitespace (spaces and tabs) at the beginning
of a logical line is used to compute the indentation level of the line,

IT PLANET - 8 (GIGABYTE)
which in turn is used to determine the grouping of statements.

Conditional Control Structures


We have a number of situations, where we may have to change the order of execution of
statements based on certain conditions. This involves a kind of decision-making to see whether
a particular condition has occurred or not, and then direct the computer to execute certain
statements accordingly.
When a program breaks the sequential flow and jumps to another part of the code, it is called
branching. When the branching is based on a particular condition, it is known as conditional
branching. If branching takes place without any decision, it is known as unconditional branching. 145
Python language possesses such decision-making capabilities and supports the following
statements known as control or decision-making statements to implement branching. For
example, if, if-else, nested if, elif, looping, etc.
THE IF STATEMENT
The if statement is a powerful decision-making statement and is used to control the flow of
execution of statements. This statement is used to execute one or more statements depending
on whether a condition is True or not.

Syntax:
if condition: condition
False
statements
First the condition is tested, if the condition is true then statements True
after colon (:) are executed.
Body of if

Example 1:
“Are you older than 50?” and if the answer is yes, respond with “You are too old!”
>>> age = 53
Output
>>> if age > 50:
You are too old!
print(”You are too old!”)
An if statement is made up of the if keyword, followed by a condition and a colon (:), as in

P
if age > 50:. The lines following the colon must be in a block, and if the answer to the question
is yes, the commands in the block will run.

Print Group of Programming Statements


PM
If the answer to the question is yes, then you can print a group of programming statements
under if block.
Example 2:
PM PUBLISHERS PVT. LTD.

THE IF-ELSE STATEMENT


The if...else statement is an extension of the simple if statement.
Syntax:
if test expression: False
condition
Body of if
else: True
Body of else
146 Body of if Body of else
The if..else statement evaluates test expression and will execute
body of if only when test condition is True. If the condition is False,
body of else is executed. Indentation is used to separate the blocks.
Example:
num = int(input("enter any number: "))
if num >= 0: Output
print("Positive or Zero") enter any number: 8
else: Positive or Zero
print("Negative number")
In the above example, if value of num is greater than or equal to zero then statement in if block
will be executed; otherwise if the value of num is less than zero then statement in else block
will be executed.
IF-ELIF-ELSE STATEMENT
When multipath decisions are involved, we can put ifs
together. A multipath decision is a chain of ifs in which Test False
Expression
the statement associated with each else is an if or elif. of if

Syntax: True Test False


Expression
if test expression: Body of if of elif

Body of if True

elif test expression:

else:
Body of elif

Body of else
P Body of elif Body of else
PM
If the condition for if statement is False, it checks the condition of the next elif block and so on.
If all the conditions are False, body of else is executed. Only one block among the several
if...elif...else blocks is executed according to the condition. The if block can have only one else
block. But it can have multiple elif blocks.
Example :
marks = int (input("Enter your marks: "))
if marks > 90:
print("Execellent")

IT PLANET - 8 (GIGABYTE)
elif marks > 75:
print("Very Good") Output
elif marks > 60: Enter your marks: 78
print("Good") Very Good
elif marks > 50:
print("Need to work harder")
else:
print("Poor, work very hard to score good marks")

In the above example, if the marks are greater than 90 then statement in if statement will be
147
executed, if the marks are greater than 75 then statement in elif will be printed, if the marks
are greater than 60 then statement in elif will be printed, if the marks are greater than 50 then
statement in elif will be printed, otherwise if the value of marks are less than 50, statement in
else will be executed.
NESTED IF STATEMENT
Nesting is the process of placing the if or if-else or True
condition-1
elif statement in another statement. It enables us to
make complex decisions based on different inputs. False condition-2
False True
Syntax:
if condition: Statement-3 Statement-2 Statement-1
if condition:
statements
else:
statements
else:
Statement-n
statements
The logic of execution is, if the condition-1 is false, the statement-3 will be executed; otherwise
it continues to perform the second test. If the condition-2 is true, the statement-1 will be
evaluated; otherwise the statement-2 will be evaluated, and then the control is transferred to
the statement-n.
Example :
num1 =
num2 =
num3 =
if num1
int (input("Enter
int (input("Enter
int (input("Enter
> num2:
P First Number: "))
Second Number: "))
Third Number: "))
PM
if num1 > num3: Output
print (“Num1 is greatest:”, num1)
Enter First Number: 6
else:
Enter Second Number: 64
print (“Num3 is greatest:”, num3)
Enter Third Number: 33
else:
Num2 is greatest: 64
if num2 > num3:
print (“Num2 is greatest:”, num2)
PM PUBLISHERS PVT. LTD.

else:
print (“Num3 is greatest:”, num3)

Loop Control Structures


Nothing is boring than having to do the same thing again and again. In programming,
programmers do not particularly like repeating the same commands. Thankfully, most
programming languages have loop option for that problem.
Loops cause a section of your program to be repeated a certain number of times. The repetition
continues while a condition is true. When the condition becomes false, the loop ends, and the
control passes to the statements following the loop. In looping, a sequence of statements is
148 executed until some conditions for the termination of the loop are satisfied. A program loop
therefore consists of two segments, one known as body of the loop and the other known as the
control statement. The control statement tests certain conditions and then directs the repeated
execution of the statements contained in the body of the loop.
Python provides two types of looping constructs- For loop and While loop

FOR LOOP
The for loop is used to repeat a block of statements until there is no items in Object (String,
List, Tuple or any other object ) in Python. Python's for statement iterates over the items of any
sequence (a list or a string), in the order that they appear in the sequence. Loop continues until
we reach the last item in the sequence. The body of for loop is separated from the rest of the
code using indentation. For each item
in sequence
Syntax:
for variable in Object: Yes
Test Expression
Statement 1
Statement 2 No

........... Body of For loop


Statement n Exit loop

Here, 'for' represents the keyword which indicates the for statement begins. 'variable' specifies
the name of variable that will hold a single element of sequence. 'in' indicates the sequence
comes next. 'object' is the sequence that will be stepped through and 'statement 1', 'statement
2'….so on are the statements that will be executed in each iteration.

Output: PM Publishers
print (“PM Publishers”)
P
In Python if you want to print PM Publishers five times, you could do the following:
print (“PM Publishers”)
PM
Output: PM Publishers
print (“PM Publishers”)
Output: PM Publishers
print (“PM Publishers”)
Output: PM Publishers
print (“PM Publishers”)
Output: PM Publishers

IT PLANET - 8 (GIGABYTE)
But this is rather time taking and boring. So, you can use a for loop to reduce the amount of
typing and repetition, like this:
# Python For Loop - Range Example
for x in range(0, 5):
print (“PM Publishers”)
Output:
PM Publishers
PM Publishers
PM Publishers
PM Publishers
149
PM Publishers
The range function can be used to create a list of numbers ranging from a starting number up
to the number just before the ending number.
Example : Output
# Python For Loop - String Example Letter is: P
Str = "PM PUBLISHERS” Letter is: M
for word in Str: Letter is:
print ("Letter is: ", word) Letter is: P
Letter is: U
In the above example, first, we declared a string variable called Letter is: B
Str and assigned value as “PM PUBLISHERS”. Then we used the Letter is: L
Python for loop to iterate through the string and display Letter is: I
individual letters.
Letter is: S
Letter is: H
Letter is: E
Letter is: R
Letter is: S
WHILE LOOP
The while Loop in Python is used to repeat a block of statements for given number of times,
until the given condition is False. It starts with the condition, if the condition is True then
statements inside the while loop will be executed, otherwise if the given condition is False then

Syntax:
while test_expression:
P
it will not be executed at least once. It means, while loop may execute zero or more time. The
syntax of while loop is: Start

False
PM
Test Condition
Body of while
In Python, the body of the while loop is determined through indentation. True

Body of Loop
In while loop, test expression is checked first. The body of the loop is
entered only if the test_expression evaluates to True. After one iteration,
the test expression is checked again. This process continues until the
Stop
test_expression evaluates to False.

Example :
PM PUBLISHERS PVT. LTD.

# Python While Loop - To Print PM Publishers 5 times


i=0
while i<5: Output
print ("PM Publishers") PM Publishers
i=i+1 PM Publishers
PM Publishers
PM Publishers
PM Publishers

In this example, the while loop will be executed 5 times and prints PM Publishers in a vertical
150 line. While working with while loop, we need to increment the control variable we used in test
condition; that control variable should be incremented in the body of the loop, otherwise the
loop would turn into an indefinite loop.
Example : Output
# While Loop - To Print value of a and b
(26, 51)
a = 25
b = 50 (27, 52)
while a < 30 and b < 70: (28, 53)
a = a + 1 (29, 54)
b = b + 1 (30, 55)
print(a, b)
In the above example, we created a variable a with the value 25, and a variable b with the value
50. The loop checks for two conditions whether a is less than 30 and whether b is less than 70.
While both conditions are true, the lines that follow are executed, adding 1 to both variables
and then printing them.

Break Statement Enter Loop

Break can be used to unconditionally jump out of the loop. It


False
terminates the execution of the loop. It can be used in while Test Condition

loop and for loop. Break is mostly required, when due to some True
external condition, we need to exit from a loop.
Syntax: break
Example :
# Python Break Statement
P Output
No
break

Remaining Body
Yes

Exit Loop
PM
of Loop
for letter in 'Python': P
if letter == 'h': y
break t
print (letter)
The example above prints all letters in string 'Python' before the letter 'h'. This is so because when
the letter becomes equal to 'h', the break statement will force the program to exit from the loop.
Continue Statement Enter Loop

Continue statement is used to tell Python to skip the rest of the

IT PLANET - 8 (GIGABYTE)
False
Test Condition
statements of the current loop block and to move to next iteration of
the loop. Loop does not terminate but continues on with the next True

iteration. This can also be used with both while and for loop.
Yes
continue
Syntax: continue
Example : Output No Exit Loop

# Python Continue Statement P Remaining Body


of Loop
for letter in 'Python': y
if letter == 'h': t
continue o
print (letter) n
151
The example above prints all letters in string 'Python' except the letter 'h'. This is so because
when the letter becomes equal to 'h', the if statement will be executed and the continue
statement inside it will force the program to skip the print statement.
CHECKLIST
S
Self-Evaluation

ee
agr
ree

Dis
After reading the chapter, I know these points:

Ag
$ I know that control statements are used to control or change the flow of execution.
$ I know that in Python, conditional and looping statements are structured using
indentation rather than using curly braces ({}).
$ I know that IF statement is a powerful decision making statement.
$ I know that there are two types of loops in Python: while and for.
$ I know that the for loop is used to repeat a block of statements until there is no
items in Object (String, List, Tuple or any other object) in Python.
$ I know that the while Loop in Python is used to repeat a block of statements for
given number of times, until the given condition is False.
$ I know that continue statement skips the rest of the statements of the current loop
block and move to next iteration of the loop.

Exercises
A. Tick [ü ] the correct answer.
P
1. A ..................... control structure shows one or more actions following each other in order.
a. Sequential b. Procedure c. Branching
PM
2. ..................... statement is used to execute one or more statements depending on whether
a condition is True or not.
a. Loop b. IF c. Break
3. ..................... cause a section of your program to be repeated a certain number of times.
a. Break b. Loops c. Continue
4. The ..................... function can be used to create a list of numbers ranging from a starting
number up to the number just before the ending number.
PM PUBLISHERS PVT. LTD.

a. Range b. Print c. Input


5. ..................... can be used to unconditionally jump out of the loop.
a. Continue b. Break c. While
B. Write ‘T’ for True and ‘F’ for False statements.
1. Python programs get structured through indentation.
2. In unconditional branching, branching takes place on any decision.
3. Conditional and looping statements are structured using indentation rather
than using Curly braces.
4. The if...elif...else executes only one block of code among several blocks.
5. The for loop is better choice than while loop while iterating through sequences.
152
6. The continue and break statement have same effect.
C. Fill in the blanks.
1. When .......................... decisions are involved, we can put ifs together.
2. .......................... is the process of placing the if or if-else or elif statement.
3. Python's for statement .......................... over the items of any sequence, in the order that
they appear in the sequence.
4. The .......................... Loop in Python is used to repeat a block of statements for given
number of times, until the given condition is False.
5. .......................... statement is used to skip the rest of the statements of the current loop
block and to move to next iteration of the loop.
D. Define the following.
1. Conditional Branching: ...............................................................................................................
....................................................................................................................................................
2. Unconditional Branching: ...........................................................................................................
....................................................................................................................................................
E. Differentiate between the following.
1. For Loop While Loop

P
................................................................
................................................................
................................................................
................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
PM
2. Break statement Continue statement
................................................................ ....................................................................
................................................................ ....................................................................
................................................................ ....................................................................
................................................................ .....................................................................
F. Answer in 1-2 sentences.
1. What do you mean by control structures?

IT PLANET - 8 (GIGABYTE)
.....................................................................................................................................................
.....................................................................................................................................................
2. What is branching?
.....................................................................................................................................................
.....................................................................................................................................................
3. Why do we use elif statement?
.....................................................................................................................................................
.....................................................................................................................................................
4. Write the syntax of For loop.
153
.....................................................................................................................................................
.....................................................................................................................................................
G. Answer Briefly.
1. What is if-else statement? Write its syntax.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
2. What is while loop? Write its syntax.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
H. Application Based Question.
Your teacher asked you to write a program in which she wants the statement by which the
program jumps out of the loop unconditionally. By which statement you can do so?
...........................................................................................................................................................

Group Discussion
Divide the students into two groups and discuss the topic, ‘Is indentation in Python makes it an easy
or a complex programming language’?

Online Link P
To learn more about Control Structures of Python, visit the website:
PM
https://www.learnpython.org/en/Loops

Activity Section
Lab Activity

1. Write the output of the following programs in the given boxes.


a. i = 0
while i < 5:
PM PUBLISHERS PVT. LTD.

print(i)
i += 1
if i == 3:
break
else:
print(0)
b. i=0
j=1
print ("i=",i)
print ("j=",j)
for x in range(1, 10):
154 n= i+j
i=j
j=n
print ("n=",n)
2. Write a program to calculate the discount for the price given by the user.
Price = int(input("Enter the price: "))
if Price > 10000:
print ("Discount is 30%")
elif Price >5000:
print ("Discount is 20%")
else:
print ("Discount is 10%”)
3. Write a program to find whether given number is odd or even.
num = int(input("Enter a number: "))
mod = num % 2
if mod != 0:
print("This is an odd number.")
else:
print("This is an even number.")
4. Write a program to display multiplication table of any number given by the user.
num = int(input("Enter number: "))
for i in range(1, 11):

P
print (num,'x',i,'=',num*i)
5. Write the following program to add natural numbers (1+2+3+...+n).
num = int(input("Enter number: "))
PM
sum = 0
i = 1
while i <= num:
sum = sum + i
i = i+1
print("The sum is", sum)

IT PLANET - 8 (GIGABYTE)
Technology Trailblazers
Guido van Rossum
? Creator: Python YEAR: 1991
Guido van Rossum, best known as the Python programming language author,
was born on 31 January 1956 in Netherlands. Python was first released by
him iin 1991, Python has undergone continual improvement and has become
a po
powerful yet flexible and easy-to-learn language. Since he made Python
open source, Van Rossum has accepted the title of Benevolent Dictator For
Life (BDFL) from the Python user community, which means that he
co
continues to oversee Python development process, and always making 155
decisions where necessary. He worked at Google from 2005 till 2012,
where he spent half of his time developing Python programming
language.
Worksheet-1
Chapters 1 - 5
A. Tick [ü] the correct answer.
1. .......................... is an email protocol for sending email messages across the Internet.
a. POP3 b. FTP c. SMTP
2. ............. is the process of transferring files from your computer to a server on the Internet.
a. Downloading b. Uploading c. Browsing
3. ............. feature allows to quickly search through tables, queries, and forms.
a. Find b. Replace c. Sorting
4. .............. query display the records that have same values for one or more specified fields.
a. Simple b. Unmatched c. Duplicate
5. .............. attribute is used to display default text in a text area, which is not edited by user.
a. Read only b. Text c. Wrap text
6. ....................................... computing makes data backup easier and less expensive.

B.
a. Cloud
P b. Soft
Write 'T' for True and 'F' for False statements.
c. Hard

1. A switch is a device that provides a central point for cables in a network.


PM
2. The Bus network is also called linear network.
3. Filtering means arranging the records in ascending or descending order.
4. Select Query window displays the fields for the table you selected to apply query.
5. The Reset button sends the information to the appropriate location for processing.
6. In cloud computing, to start a new software, you should install it in your computer.
C. Fill in the blanks.
1. ........................ cable consists of a single copper wire surrounded by at least three layers.
2. ........................ a set of rules that defines how pages transfer on the Internet.
PM PUBLISHERS PVT. LTD.

3. To create a selected query, ............................. view can be used.


4. ....................... format is used to update table appearance datasheet.
5. The ........................... button is used to clear the already entered data in a form.
6. .................. control attribute is used to play the media when the web browser is displayed.
7. ................................ gives you 15 GB of free Google online storage.
D. Define the following.
1. FTP 2. TCP/IP 3. SMTP
4. Relational window 5. Major key 6. Password Box
7. Radio Button 8. Resource pooling 9. SaaS
E. Differentiate between the following.
156
1. LAN and WAN 2. Broadcast Radio and Cellular Radio
3. Peer to peer and Client server 4. AND criteria and OR criteria
5. Asterisk (*) wild card and Question mark (?) wild card
6. Hybrid Cloud and Community Cloud
F. Answer the following questions.
1. What do you understand by dedicated servers? Give examples.
2. What do you understand by Wireless transmission media?
3. Describe the various types of basic Forms.
4. What do you understand by Text data criteria?
5. Why do we use a Query in a database?
6. Which file formats are supported by Audio tag and Video tag in HTML5?
7. Which attributes are used to control audio and video tag? Define them.
8. Write the advantages and disadvantages of Frames.
9. What is CSS? How does CSS control multiple pages?
10. What is the syntax of Style Sheet?
11. Write the advantages of cloud computing.
12. Name the basic types of cloud computing. Explain them.

P
Worksheet-2
PM
Chapters 6 - 10

A. Tick [ü] the correct answer.


1. ......................... is a facility to pay for the goods only after the goods are delivered.
a. Cash on Delivery b. Cash before Delivery c. Cash Anytime
2. ....................... learning provides capability to computers to automatically learn and improve

IT PLANET - 8 (GIGABYTE)
from experience without being explicitly programmed.
a. Math b. Computer c. Machine
3. App Inventor is an ....................................... web application.
a. Fixed-source b. Close-source c. Open-source
4. ....................................... retains a copy of your blocks even when you exit app inventor.
a. Blocks b. Backpack c. Properties
5. ........................... is an interpreted and object oriented language:
a. C++ b. JAVA c. Python
6. ........................... operator gives true when both value of operands are true.
a. and b. or c not
157
7. ........................... statement is used to go back to the start of the loop.
a. loop b. break c. continue
B. Write 'T' for True and 'F' for False statements.
1. In some browsers, the address bar shows a green background for a secure site.
2. Always provide the payment information only to secure site.
3. AI systems are always safe and secure throughout their operational lifetime.
4. Blocks Editor is used for instructing the components what to do and when to do.
5. In App Designer window, you can create the look and feel of your app.
6. Python uses triple quotes for multiline strings.
7. The '*=' operator is used to compare the values.
C. Fill in the blanks.
1. A .................... allows users to publish short messages, usually between 100 and 200
characters, for others to read.
2. ........................... occurs when retailers use the web to sell their products and services.
3. One of the most impressive parts of Bill Gates’ smart home is that he built it in the ............
4. ........................... apps are developed for a particular platform or device.
5. ........................... is a sequence of letter enclosed in quotes in Python.
6. Keywords are also known as ........................... words.

D. Define the following.


1. M-Commerce
P
7. .............................. plays a very important role in structuring of program in Python.
8. The repetition of statements can be done using .............................. .

2. COD 3. Shopping Cart


PM
4. Deep Learning 5. Cortana 6. Emulator
7. Delimiter 8. Literals 9. Branching
E. Differentiate between the following.
1. Online Auction and Online Catalog 2. Google Assistant and Apple Siri
3. Arithmetic Operator and Logical Operator 4. Nested if and elif statement
F. Answer the following questions.
1. What are the advantages of shopping cart?
PM PUBLISHERS PVT. LTD.

2. What is the role of banking while doing e-retail transaction?


3. Explain the history of AI.
4. What will be the future of A.I. Explain with example.
5. Describe the main parts of Blocks Editor.
6. What do you mean by running a app?
7. What is the role of interpreter in Python?
8. Why do we use Script mode?
9. How can you convert a string value to integer value?
10. Describe the syntax of while loop with example.
158
Project Work

Project Access
A. Create a database named 'Customer' and design two tables in it containing the
following fields:
Table 1 : Customer
Fields: Customer ID (Primary Key), Customer Name, Address, City, Phone, E-mail ID
Table 2 : Invoice
Fields: Customer ID (Primary Key), Invoice No., Date, Invoice Amount
a. Create two forms for the above two tables using Form Wizard, which include all the fields
of both the tables. Save them as the table names.
b. Using these two Forms, enter 5 records in both the tables.
c. Close the Forms and open both tables to view the records entered in the tables.
d. Close the tables, database, and Access.
B. You and two of your friends have started a small business. You provide help to big

information as shown below:


Field
Name
Data
Type
P
companies in the field of computer expertise. You have a small clientele and now
you realize that you need to computerize your business. You have gathered some

Field
Size
Primary
Key
Description
PM
Customer ID Short Text 4 Yes Number of Customer ID
Name Short Text 40 Name of the customer
Address Short Text 40 Address of customer
Telephone Number Phone number of customer

Balance Currency Balance amount of customer

Amount Paid Currency Amount paid by the customer


Amount Due Currency Amount due from customer

IT PLANET - 8 (GIGABYTE)
Customer Amount Amount
ID Name Address Telephone Balance Paid Due

0ASD Sunil 31, Dilshad Gdn 23000000 5000 3000 2000

0QWE Kamal 34, Kirti Nagar 22220000 7000 6000 1000

0POI Akash 1/3, Noida 56560000 9000 3000 6000

0LKJ Sameer 24, Okhla 76540000 7000 6000 1000

0MNB Tony B-1, Karol Bagh 27500000 6000 6000 0

0ZXC Ashok 19, Dilshad Gdn 88880000 9000 5000 4000

0ASD Kunal 22/1, Noida 34570000 7000 6000 1000

0DFG Rajesh 23, Faridabad 44540000 8000 2000 6000 159

Design and create a database in Access to store the data related to your business. Then create
a table, enter data from the information given above and print the table.
C. Create a database 'Final Result', containing the following tables:
Table 1 : Student (Master Table)
Fields: Roll No. (Primary Key), Name, Class, Section
Table 2 : Unit Test 1 (Contains the details of marks in Unit Test 1)
Fields: Roll No., Science, Maths, English, Hindi, S.St.
Table 3 : Unit Test 2 (Contains the details of marks in Unit Test 2)
Fields: Roll No., Science, Maths, English, Hindi, S.St.
Table 4 : Final Exams (Contains the details of marks in the final exams)
Fields: Roll No., Science, Maths, English, Hindi, S.St.
a. Create the tables in Design View and assign appropriate Data Type and description for the
fields.
b. Assign the Roll No. field in the 'Student' table as the Primary key.
c. Click on the Relationship button after creating all the four tables.
d. Add all the tables selecting the table names one at a time and clicking on the Add button
each time.
e. Click and drag the 'Roll No.' field in the 'Student' table and place it on the 'Roll No.' field of
'Unit Test 1' table. In the same way, define relationship as shown below:

Unit Test 1
Roll No.
P Student
Unit Test 2
Roll No.
PM
Science
Science Roll No. Maths
Maths Name
English
English Class
Hindi
Hindi Section
S.St Final Exams
S.St
Roll No.
Science
PM PUBLISHERS PVT. LTD.

Maths
English
Hindi
S.St

f. Save the relationship.


g. Close the window.
h. Click on the 'Student' table name in the database window and enter 4 sets of
records in it.
160
i. Enter records in Unit Test 1, Unit Test 2 and Final Exams table.
j. Close the window.
k. Click on the Relationship button and view the defined Relationship.
D. Create a database named ‘School’ and design a table in it containing the
following fields:
Field Name Data Type Description
S. No. Number
Book Name Short Text
Author Name Short Text
Accession No. Number
Issued to Short Text
Date of Issuing Number
Data of Return Number
Now, follow these steps to create the table in Design View.
a. Type the appropriate description for each field and save the table as 'Library'.
b. Open the table 'Library' in Design View.
c. Position the cursor in the field S. No. and set it as the Primary key.
d. Enter the record for each field by positioning the cursor in each cell.
e. After completing the record entries, press Ctrl + S to save the table.
f. Click (x) to close the Table design window.

Project Python
P
PM
Write the following program for Addition, Subtraction, Multiplication and Division
according to your choice.
# Program to calculate addition, subtraction, multiplication and
division.
num1 = int(input("Enter a number: "))
num2 = int(input("Enter a number: "))
print("Enter 1 for addition, 2 for subtraction, 3 for
multiplication, 4 for division.")
choice = input("Enter a choice: ")

IT PLANET - 8 (GIGABYTE)
if choice == 1:
add=num1+num2
print ("Addition is: ", add)
elif choice == 2:
sub=num1-num2
print ("Subtraction is: ", sub)
elif choice == 3:
mul=num1*num2
print ("Multiplication is: ", mul)
elif choice == 4:
div=num1/num2
print ("Division is: ", div) 161
else:
print("Wrong choice")
Project HTML
A. Create a Web page to display form in the format shown below.

Now, perform the following tasks:


P
PM
$ Set background color yellow, text color as Red, heading size H1, center aligned. Insert HR in
Blue color, size 10, width 50%.
$ Set text color of sub heading as Blue and heading size H2.
$ Set text color of next heading Blue and heading size H4.
$ Add your name, address, mobile , comment, checkbox for service, radio button for returning
costumer, list box for continent.
$ Add Submit and Reset button.
PM PUBLISHERS PVT. LTD.

B. Your computer teacher has asked you to create a website for the school.

The site should have:


$ four pages including a home page.
$ interesting pictures incorporated in all the pages.
$ homepage giving general introduction of the school with links to reach other pages such as
school infrastructure, sports & recreation facilities, teacher & staff and academics.
$ a page on infrastructure giving details such as number of classrooms, library, labs, swimming
pool and computer room, and it should also contain a link to reach back to the home page.
$ a page on sports & recreation giving information on sports facilities like basket ball, cricket,
table tennis, football and recreation facilities like media room, library, computer room etc. A
162 link connecting to the home page is a must.
$ a page on staff giving information like number of teachers, their role, their contribution, etc.
and a link to home page.
Project MIT App Inventor
Create an app on Teacher’s Day. Add four components on the screen—Image, TextBox,
Button, label and TextToSpeech.

Steps to Create an App


P ** Creating an App**
PM
$ Open MIT App Inventor and create New App Inventor Project and name the project.
$ Change the Screen appearance using different formatting options given in the Properties palette.
$ Upload an image for the teacher’s day. Note: Your image may vary and it should be of small size.
$ From Component Palette, drag the Image, Textbox, Button, and Label option to viewer palette.
$ Rename the Button option as “Click Here”. (Here you can use different formatting options for each
from the Properties palette.)
$ Open Media Drawer from the palette and drag “Text to Speech” to viewer palette.
** Component Designing**
$ Click on “Blocks” button

IT PLANET - 8 (GIGABYTE)
$ Click on “Click Here” button component and then choose “When click here button . click do” block.
$ Click on Label 1 component and choose “Set Label 1 . text to” block.
$ Drag and snap the Label block to Click Here button block.
$ Click the Text block and then drag the Join Block and snap into Label Block.
$ Add Strings to the Join block by right clicking on the settings. (on the top left corner of the Join block)
$ Click Text in Built in area, choose the string block and snap it in first and third place holders of Join
string block.
$ Type the Text “Hello ” in first string and “, Ma’am, We Wish You A Happy Teacher’s Day.” in second
string block.
$ Click on the Text box 1 component, drag and snap Text box1 . text block in middle placeholder .
$ Click on Text to Speech1, drag and snap Call to Speech1. Speak message block inside “Click Here”
163
button block under the Label1 block.
$ Duplicate the Join block and drag and snap the duplicate Join block in text to speech block.
$ Run the App.
Additional Information
Cybercrime
Any illegal act involving the use of a Internet or
related services generally is referred to as a
cybercrime. In another words, the term cybercrime
refers to Internet-based illegal acts such as
distribu ng malicious so ware or commi ng
iden ty the . Today, figh ng cybercrime is one of
the government’s top priori es.

Perpetrators of cybercrime typically fall into one of these basic categories:


CYBERSTALKING: It is a crime in which the a acker harasses a specific individual (vic m) using
electronic communica on, such as e-mail or instant messaging (IM), or messages posted to a
Web site. There are several forms of cyberstalking that can take place including:

P
Ÿ placing orders for delivery in someone else's name
Ÿ gathering personal informa on on the vic m and spreading false rumors
Ÿ encouraging others to join in the harassment
Ÿ threatening harm through email
PM
CYBERBULLYING: It is a harassment using technology, o en involving teens and preteens.
Unlike verbal bullying, the perpetrators can hide behind the anonymity of the Internet and can
reach a wide audience quickly. Vic ms usually fall in trap that comes in the form of text
messages, email, or online social network posts. The examples of cyberbullying are sending or
forwarding threatening text messages, pos ng embarrassing or altered pictures of someone
without his or her permission, or se ng up a fake online social network page where others
make cruel comments and spread rumors about someone.
CYBEREXTORTIONIST: It is someone who demands payment to stop an a ack on an
organiza on’s technology infrastructure. These perpetrators threaten to expose confiden al
PM PUBLISHERS PVT. LTD.

informa on, exploit a security flaw, or launch an a ack that will compromise the organiza on’s
network — if they are not paid a sum of money.
CYBERTERRORIST: It is someone who uses the Internet or network to destroy or damage
computers for poli cal reasons. The cyberterrorist might target the na on’s air traffic control
system, electricity-genera ng companies, or a telecommunica ons infrastructure.
CYBERSPYING: It is a form of cybercrime in which hackers target computer networks in order
to gain access to classified or other informa on that may be profitable or advantageous for
them. This can be disastrous for companies if the a ackers use stolen informa on to
manufacture copy-cat products and gain market share.
CYBERWARFARE: It refers to the use of digital a acks -- like computer viruses and hacking --
164
by one country to disrupt the vital computer systems of another, with the aim of crea ng
damage, death and destruc on.
Additional Information Cont ...

The Blockchain Technology


The blockchain is a decentralized ledger of all the transac ons across a P2P (peer-to-peer)
network. Using this technology, par cipants can confirm transac ons without the need of
a central cer fying authority like Banks. Its applica ons include fund transfer, se ng
trades, vo ng and many other uses.
Blockchain Technology Uses Benefits
TRANSPARENCY AND
TRACKING

SIMPLER AND FASTER


DIGITAL CURRENCY FINANCE IOT DATA STORAGE

REDUCED COSTS

ONLINE VOTING GOVERNANCE P HEALTHCARE INSURANCE


INCREASED TRUST
PM
Working of Blockchain Technology

The requested The network of


Someone transac on is nodes validates the
requests a broadcasted to a P2P transac on and the
VALIDATION
MAY INCLUDE
transac on network consis ng of user’s status using
CONTRACTS
computers, known as known algorithm

IT PLANET - 8 (GIGABYTE)
nodes CRYPTOCURRENCY
OTHER RECORDS

The transac on The new block is then Once verified, the transac on
is complete added to the exis ng is combined with other
blockchain, in a way that is transac ons to create a new
permanent and unalterable block of data for the ledger

Cryptocurrency
165
Cryptocurrency is a medium of exchange, created and stored electronically in blockchain,
using encryp on techniques to control the crea on of monetary units and to verify the
transfer of funds. The best example of cryptocurrency is Bitcoin.
Additional Information Cont ...

Major Developments in Technology from 1937 to 2019


1937: Dr. John V. Atanasoff and Clifford Berry designed and built the first electronic digital
computer. Their machine, the Atanasoff-Berry-Computer, provided the foundation for
advances in electronic digital computers.

1946: Dr. John W. Mauchly and J. Presper Eckert, Jr. completed work on the first large-
scale electronic, general-purpose digital computer - ENIAC (Electronic Numerical
Integrator And Computer).

1951: The first commercially available electronic digital computer, the UNIVAC
I (UNIVersal Automatic Computer), was introduced by Remington Rand.

1957: FORTRAN (FORmula TRANslation), an efficient, easy-to-use programming language, was


introduced by John Backus.

P
1958: Jack Kilby of Texas Instruments invented the integrated
circuit, which laid the foundation for high-speed computers.
PM
First integrated Integrated circuit
circuit (today)

1965: Dr. John Kemeny of Dartmouth developed the BASIC programming language. BASIC has
been widely used on personal computers. The full form of BASIC is Beginner's All-purpose
Symbolic Instruction Code.

1969: The ARPANET (Advanced Research Projects Agency Network), developed by


ARPA of the United States Department of Defense, was the world’s first operational
packet switching network and the progenitor of the Internet.
PM PUBLISHERS PVT. LTD.

1971: Dr. Ted Hoff of Intel Corporation developed a microprocessor, or micro


programmable computer chip, the Intel 4004.

1975: Ethernet, the first local area network (LAN), was developed at Xerox PARC (Palo
Alto Research Center) by Robert Metcalf. The LAN allows computers to communicate and
share software, data, and peripherals.

1976: Steve Jobs and Steve Wozniak built the first Apple computer. A subsequent
version, the Apple II, was an immediate success.
166
1979: VisiCalc, a spreadsheet program written by Bob Frankston and Dan Bricklin,
was introduced. VisiCalc is seen as the most important reason for the acceptance of
personal computers in the business world.
1981: Microsoft Corporation co-founder, Bill Gates, developed the
operating system MS-DOS (short for Microsoft Disk Operating
System). Microsoft achieved tremendous growth and success with
MS-DOS.
1981: The IBM PC was introduced, signaling IBM’s entrance into the
personal computer marketplace.

1984: Hewlett-Packard announced the first LaserJet printer for personal computers.
1984: Apple introduced the Macintosh computer; it incorporates a unique, easy-to-
learn, graphical user interface.

1991: World Wide Web is one of the best services of Internet. It was created by European
Laboratory for Particle Physics. The first accessible Website was also created in 1991.

1992: The Windows 3.1 family of Microsoft Windows operating systems was released.

1993: Marc Andreessen created a graphical Web browser called Mosaic. This success led to the
organization of Netscape Communications Corporation.

P
1993: Microsoft released Microsoft Office 3 Professional, the first version of Microsoft Office for the Windows
operating system.
PM
1994: Jim Clark and Marc Andreessen founded Netscape and launched Netscape Navigator 1.0, a
browser for the World Wide Web.

1994: Amazon was founded and began business as an online bookstore.

1994: Yahoo!, a popular search engine and portal, was founded by two Stanford
Ph.D. students as a way to keep track of their personal interests on the Internet.

IT PLANET - 8 (GIGABYTE)
1995: Sun Microsystems launched Java; it is an object oriented programming language that allows users
to write one program for a variety of computer platforms.

1995: Microsoft released Windows 95, a major upgrade to its Windows operating system.
Windows 95 is purely graphical user interface-based operating system.

1997: Microsoft released Internet Explorer 4.0 and seized a key place in the Internet arena.

1998: Microsoft released Windows 98, an upgrade to Windows 95. Plug


and Play feature was introduced in Windows 98.
1998: Apple Computer introduced the iMac, the next version of its
popular Macintosh computer. 167

1999: Intel released its Pentium III processor, which provided enhanced multimedia capabilities.
2000: Intel unveiled its Pentium 4 chip with clock speeds starting at 1.4 Ghz.

2001: Wikipedia, a free online encyclopedia, was introduced. Additional wikis began to appear
on the Internet, enabling people to share information in their areas of expertise.

2004: Flat-panel LCD monitors overtook bulky CRT monitors as the popular choice of
computer users.
2004: Facebook, an online social network originally available only to college students,
was founded. Facebook eventually opened registration to all people and immediately
grew to more than 110 million users.
2004: Sony unveiled the handheld game console PlayStation Portable (PSP).
2004: USB flash drives became a cost-effective way to transport data from one
computer to another.

2005: YouTube, an online community for video sharing, was founded. YouTube
includes content such as home videos, movie previews, and clips from television
shows.

2005: Apple released the latest version of its popular pocket-sized iPod audio player.

P
2005: Microsoft released the Xbox 360, its latest game console.
PM
2006: Sony launched its PlayStation 3. New features include a Blu-ray Disc player, high-
definition capabilities, and online connectivity.

2007: VoIP (Voice over Internet Protocol) providers expanded usage to include Wi-Fi
phones. The phones enable high-quality service through a Wireless-G network and
high-speed Internet connection.

2007: Microsoft released the new version of its widely used operating system,
Windows Vista and the latest version of Microsoft's productivity suite, Office 2007.
PM PUBLISHERS PVT. LTD.

2007: Apple introduced the iPhone ; it uses iTouch technology that allows you to
make a call simply by tapping a name or number in your address book. Apple also
released its Mac OS X version 10.5 ‘Leopard’ operating system for desktop and
server version.

2008: Google released its new Web browser Google Chrome.


2008: Netflix, an online movie rental company, and TiVo, a company
manufacturing digital video recorders (DVRs), make Netflix movies and
television episodes available on TiVo DVRs.

2009: Microsoft released the latest version of its widely used operating system, Windows 7.
168 2009: Intel released the Core i5 and Core i7 line of processors.
2009: Google Docs continued to increase in popularity of web apps. Web apps make it easier to
perform tasks such as word processing, photo editing, and tax preparation without installing
software on your computer.
2010: Microsoft released the new version Office 2010 line of Office suite.

2011: A new generation of browsers was released to support HTML5, enabling webpages to contain
n
more vivid, dynamic content.

2012: Windows 8 is a series of Windows operating systems produced


by Microsoft. In this operating system, Micosoft introduced Start
Screen in place of Start button.
2012: Microsoft announced the Surface, a tablet designed to compete
with Apple’s iPad. The Surface has a built-in stand and supports a
cover that can also serve as a keyboard.

2013: Microsoft Office 2013 (formerly Office 15) is a version of Microsoft


Office, a productivity suite from Microsoft.
2013: Samsung released the Galaxy Gear; it is a smartwatch that
synchronizes with a Samsung Galaxy smartphone using Bluetooth technology.

2013: QR codes rapidly gained in popularity, giving mobile device users an easy way to access
web content.

P
2014: More and more users started using cloud storage for their data. Cloud
storage also provides users with the convenience of accessing their files from
almost anywhere.
2014: Apple released the Apple Watch (iWatch); it is a wearable device that runs
PM
apps and can monitor various aspects of your health and fitness.
2014: Google introduced Google Glass, which is a wearable, voice-controlled
Android device that resembles a pair of glasses and displays information directly in
the user's field of vision.

2015: Microsoft released Windows 10, the latest version of its operating system which
expands on many of the new features introduced in Windows 8, and also brings back
popular features such as the Start menu from previous versions of Windows.
2015: Microsoft Office 2016 is a new version of Microsoft Office, a productivity suite
from Microsoft.

IT PLANET - 8 (GIGABYTE)
2016: Apple introduced iPhone 7 and 7 plus, which dramatically improved the most important
aspects of the iPhone experience. It introduced advanced new camera systems. It has best
performance and best battery life ever in an iPhone; immersive stereo speakers; the brightest,
most colourful iPhone display; and best splash and water resistance.

2017: Mayfield introduced Kuri, ‘an intelligent robot for the home.’ Kuri is half a meter tall, weighs
just over 6 kilograms, and is ‘designed with personality, awareness, and mobility that adds a spark of
life to any home.’ Kuri is built to connect with you and helps bring technology to life. Kuri can
understand context and surroundings, recognize specific people, and respond to questions with facial
expressions, head movements, and his unique lovable sounds.

2019: iPhone 11 is the new smartphone designed, developed, and marketed by Apple
Inc. It was released on September 20, 2019, alongside the 11 Pro and 11 Pro Max at the
169
Steve Jobs Theater in the Apple Park campus. It has a new A13 bionic chip with Third-
Generation Neural Engine.
Additional Information Cont ...

IT Careers
In today’s technology-rich world, the technology industry is a major source of
career opportunities worldwide. This industry has created thousands of high-tech
career opportunities. As technology changes, so do the available careers and
requirements. New careers are available in social media and mobile technologies
that did not exist a few years ago. For this reason, you should stay up to date
with technological developments.
There are many types of fields in which computer professionals are required. Computer professionals
are those who deal with computer industry to develop something. They may design, build, sell, lease,
or repair hardware, or they may sell, market, or write software.

MANAGEMENT
In management, the role of computer professional includes directing the planning,
research, development, evaluation, and integration of technology. Following are the
jobs available under the management field.
Jobs Functions
Chief Information Officer (CIO)
E-commerce Director

Network or wireless network


P
Directs company’s information service and communications functions.
Supervises the development and execution of Internet or e-commerce
systems; works with the company’s marketing divisions.
Installs, configures, and maintains company’s administrator network and
PM
Manager Internet systems; identifies and resolves connectivity issues.
Project manager Oversees all assigned projects, allocates resources, selects teams,
performs systems analysis and programming tasks.
SYSTEM DEVELOPMENT AND PROGRAMMING
In System Development and Programming, the role of computer professional
includes analyzing, designing, developing, and implementing new information
technology, and maintaining and improving existing systems. Following are the jobs
available and their functions under the System Development and Research field.
PM PUBLISHERS PVT. LTD.

Jobs Functions
Computer programmer Writes program in variety of computer language such as Visual Basic,
Java, C#, F#, and C++. Updates and expands existing programs. Debugs
program by testing and fixing error.
Computer scientist Researches, invents, and develops innovative solutions to complex
software requirements or problems.
Database analyst Uses data modeling techniques and tools to analyze, tune, and specify
data usage within an application area.
Software engineer Specifies, designs, implements, tests, and documents high-quality
software in a variety of fields, including robotics, operating systems,
animation, and applications.
170
System analyst Works closely with users to analyze their requirements, designs and
develops new information systems, and incorporates new technologies.
System programmer Installs and maintains operating system software, and provides technical
support to the programming staff.
Technical leader Guides design, development, and maintenance tasks; serves as
interface between programmer/ developer and management.
Technical writer Works with the analyst, programmer, and user to create system
documentation and user materials.
Web software developer Analyzes, designs, implements, and supports Web applications; works
with HTML, Ajax, JavaScript, and multimedia.
TECHNICAL SERVICES
In Technical services, the role of computer professional includes evaluating and
integrating new technologies, administering the organization’s data resources, and
supporting the centralized computer operating system and servers. Following are
the jobs available and their functions under the Technical Services.
Jobs Functions
Computer technician Installs, maintains, and repairs hardware; installs, upgrades, and
configures software; troubleshoots hardware problems.
Database administrator Creates and maintains the data dictionary; monitors database
performance.
Graphic designer Develops visual impressions of products for advertisements and
marketing materials.
Quality assurance specialist Reviews programs and documentation to ensure they meet the

Storage administrator

Web designer
P
organizational standards.
Installs, maintains, and upgrades storage systems; analyzes the storage
needs of an organization.
Develops graphical content using Photoshop, Flash, and other
multimedia tools.
PM
Web administrator Maintains Website of an organization; create Web pages; oversees
Website performance.
OPERATIONS
In Operations, the role of computer professional involves operating the
centralized computer equipment and administering the network, including
both data and voice communications. Following are the jobs available and
their functions under the Operations.
Jobs Functions

IT PLANET - 8 (GIGABYTE)
Computer operator Performs equipment-related activities such as monitoring performance,
running jobs, backup, and restoring.
Data communications analyst Installs and monitors communications equipment and software;
maintains Internet / WAN connections.
TRAINING
In Training, the role of computer professional includes teaching employees
how to use components of the information system or answering specific
user questions. Following are the jobs available and their functions under
the Training.
Jobs Functions
Computer instructor Teaches students computer science and information technology skills.
Corporate trainer Teaches employees how to use software, design and develop systems, 171
program, and perform other computer-related activities.
Help desk specialist Answers computer-related questions on the phone or in a chat room.
SECURITY
In Security, the role of computer professional includes developing and
enforcing policies that are designed to safeguard data and information
of an organization from unauthorized users. Following are the jobs
available and their functions under the Security.

Jobs Functions
Chief Security Officer (CSO) Responsible for physical security of organization property and people;
in charge of securing computing resources.
Computer security specialist Responsible for the security of data and information stored on
computers and mobile devices within an organization.
Network security administrator Configures routers and firewalls; specifies Web protocols and
enterprise technologies.
Security administrator Administers network security access; monitors and protects against
unauthorized access.

WEB MARKETING AND SOCIAL MEDIA


Careers in web marketing and social media require you to be
knowledgeable about web-based development platforms, social media
apps, and marketing strategies.

Jobs
Customer Relationship
(CRM) Management specialist
P
Functions
Integrates apps and data related to customer inquiries, purchases,
support requests, and behaviors in order to provide a complete
PM
application that manages a company’s relationships with its
customers.
Internet/Social Media Directs and implements an organization’s usage of Internet and social
Marketing Specialist media marketing, including Facebook pages, Twitter feeds, blogs, and
online advertisements.
Search Engine Optimization Writes and develops web content and website layouts so that they
(SEO) Expert appear at the beginning of search results when users search for
content.
User Experience (UX) Designer Plans and designs software and apps that consider a user’s reaction to
a program and its interface, including its efficiency, its effectiveness,
PM PUBLISHERS PVT. LTD.

and its ease of use.

APP DEVELOPMENT AND MOBILE TECHNOLOGIES


Careers in app development and mobile technologies require you to have
knowledge about trends in the desktop and mobile app market, as well as
the ability to develop secure apps for a variety of computers and mobile
devices.

Jobs Functions
Desktop or Mobile Converts the system design into the appropriate application
App Developer development language, such as Visual Basic, Java, C#, and Objective
C and develops toolkits for various platforms.
172
Games Designer/Programmer Designs games and translates designs into a program or app using an
appropriate application development language.
8
CLASS
NATIONAL CYBER OLYMPIAD
N CO SAMPLE PAPER – SYLLABUS 2019-20
SYLLABUS
Section – 1 : Verbal and Non-Verbal Reasoning.
Section – 2 : Fundamentals of Computers, Internet & Viruses, HTML-[Html, Head, Title, Body (Attributes: Background, Bgcolor, Text,
Link, Alink, Vlink), Font (Attributes: Color, Size, Face), Center, BR, HR (Attributes: Size, Width, Align, Noshade, Color), Comment tag(<!-- -
->), <H1>..<H6>, <P>, <B>, <I>, <U>, <IMG>, Html Elements: A, Ul and Ol (Attributes: Type, Start), Li], Flash CS6, MS-Access, Networking,
MS-Word (Exploring File tab, Language and Translate options, Tracking features -Comments, Reviewing Pane, Tracking Changes,
Comparing, Combining and Protecting documents, Working with References), MS-PowerPoint (Exploring File tab and Slide Show tab,
Comparing, Combining and Protecting presentations), MS-Excel(Exploring File tab, Useful Formulas and Functions - IF,Even, Odd, LCM,
GCD, Power, Product, Round, Sqrt, Sum, Min, Max, Average, Count, Upper, Lower And Replace, Cell referencing, Using Defined Names
group ), Memory & Storage Devices, Basics of Cyber Crimes, Cyber Laws, Operating Systems(Introduction, Features, Types-single user
and multi-user), Latest Developments in the field of IT.
Section – 3 : Higher Order Thinking Questions - Syllabus as per Section – 2.
Questions are based on Windows 7 and MS-Office 2010. Total Questions: 50 Time: 1 hr.
PATTERN & MARKING SCHEME
Section (1) Logical Reasoning (2) Computers & IT (3) Achievers Section
No. of Questions 10 35 5
Marks per Ques. 1 1 3

LOGICAL REASONING
1. If in a certain code SAND is coded as VDQG and BIRD is coded as ELUG, then what is the code for LOVE?

2.

3.
(A) PRYG

(A)
(B) ORTG

(B) P (C) NPUH

(C)
(D) ORYH
Which of the following venn diagrams best represents the relationship among “tennis fans, cricket players and students”?
(D)
A, B, C, D, E and F, not necessarily in that order, are sitting on six chairs regularly placed around a round table. It is observed that
A is between D and F, C is opposite to D, D and E are not on neighbouring chairs. The person sitting opposite to B is _______.
PM
(A) A (B) D (C) E (D) F
4. If the digits in the number 25673948 are arranged in ascending order from left to right, what will be the sum of the digits which
are fourth from the right and third from the left in the new arrangement?
(A) 10 (B) 9 (C) 4 (D) 6
5. Find the missing term in the given series. DMP, FLN, HKL, JJJ, ?
(A) MII (B) LIH (C) III (D) MIF
COMPUTERS AND INFORMATION TECHNOLOGY
6. Which of the following is NOT available as a category in Control Panel of Windows 7?
(A) System and Security (B) Programs (C) Bluetooth settings (D) Ease of Access
7. The function of given icon in MS-Word 2010 is __________.
(A) To add caption to a picture or other image (B) To insert an index into the document

IT PLANET - 8 (GIGABYTE)
(C) Merge document to PDF files (D) Insert Flash video
8. Which of the following is CORRECT in HTML?
(A) <hr> (B) <HR> (C) <B> Bold Text </B> (D) All of these
9. Computers use the seven digit code called ASCII. What does ASCII stand for?
(A) American Standard Code for Information Interchange (B) Association of Software Coding and Information Institute
(C) American Standard Computing and Information Institute (D) American Scientists Convention for Information Interchange
10. How many sheets are there in MS-Excel 2010 workbook by default?
(A) 2 (B) 3 (C) 4 (D) 5
11. In Flash CS6, is called ____ tool.
(A) Fill color (B) Paint bucket (C) Ink bottle (D) Lasso
12. In MS-PowerPoint 2010, Format Painter is used to _______.
(A) Copy formatting from one place and apply it to another (B) Reset the position, size and formatting of the slide
(C) Format text to the left (D) Increase the indent level
13. Which of the following statements is INCORRECT about memory and storage devices? 173
(A) Cache memory makes memory transfer rates higher and thus raises the speed of the processor.
(B) A storage device is a hardware component that writes data to and reads data from a storage medium.
(C) ROM loses its data when you turn off the computer.
(D) Hard disks can be divided into one or more logical disks called partitions.
ACHIEVERS SECTION
14. Rearrange the steps given below to insert a motion tween in Flash CS6, first and last steps are given for you.
First : Draw a shape at Frame 1
(i) Drag the playhead to a new frame and reposition your object
(ii) Select the shape and convert it to a symbol
(iii) Go to Insert tab → Motion tween

Last: Press Ctrl + to play the tween.

(A) (ii) → (iii) → (i) (B) (i) → (iii) → (ii) (C) (iii) → (i) → (ii) (D) (iii) → (ii) → (i)
15. Which of the following statements is CORRECT about ‘Sneakernet’?
(A) Transferring computer files between computers by physically moving removable media such as CDs, flash drives.
(B) Unauthorised access of information from a wireless device.
(C) The process of converting data in a form so that an unauthorised person cannot understand it.
(D) A private computer network in which multiple PCs are connected to each other.

SAMPLE ANSWER SHEET


1. Name: If your name is SAURAV GUPTA. then you should write as follows:
S A UR A V GUP T A
2. Father’s Name: If your father’s name is SAURAV GUPTA then you should write as follows:
D I NE S H GUP T A
4. CLASS 5. ROLL NO.
SCHOOL CODE 3. SCHOOL CODE
If you are in Class 10 If your roll no. is 587,
M H O 5 4 7 Write your school code i.e. if
A 0 then you should then you should write
A 0 0 0 your school code is MH0547
B
C
D
E
F
G
H
J
K
L
M
I
B
C
D
E
F
G
H
I
J
K
L
M
1
2
3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
darken as follows:

Darken the circle


P Darken the circle
darken as follows:

1
0
1
2
3
4
5
CLASS
0

1
2
3
4
5
and darken the circles
as follows:

5
0
1
2
3
4
ROLL NO.
8
0
1
2
3
4
5
7
0
1
2
3
4
5
PM
N N 6 6 6 6 6
O O 6. GENDER 7 7 7 7
P P If you are a boy then 8 8 8 8
Q Q darken Male circle 9 9 9 9 9
R R
S S GENDER
T T
U U
V
W
X
Y
V
W
X
Y
MALE FEMALE CORRECT
way to darken
the circle
Z WRONG
way to darken
the circle
Z ¤
ü¡
¡ û

ZA Z

7. If your choice for Answer 1 is C, then you should darken the circle as follows: 1. A B D

MARK YOUR ANSWERS WITH HB PENCIL/BALL POINT PEN (BLUE/BLACK)


National Cyber Olympiad
1. A B C D 4. A B C D 7. A B C D 10. A B C D 13. A B C D
2. A B C D 5. A B C D 8. A B C D 11. A B C D 14. A B C D
PM PUBLISHERS PVT. LTD.

3. A B C D 6. A B C D 9. A B C D 12. A B C D 15. A B C D

ANSWERS
1. (D) 2. (A) 3. (D) 4. (A) 5. (B) 6. (C) 7. (A) 8. (D) 9. (A) 10.(B)
11. (B) 12. (A) 13. (C) 14. (A) 15. (A)

SPACE FOR ROUGH WORK

174
175
IT PLANET - 8 (GIGABYTE)
PP
PPMM
Students
For
PM PUBLISHERS PVT. LTD.

176
For
Students

PPMM
PP

You might also like