Professional Documents
Culture Documents
ISBN: 978-93-89174-84-7
No part of this book may be reproduced or copied in any form or by any means (graphic, electronic or mechanical, including
photocopying, recording, taping, or information retrieval system) or reproduced on any disc, tape, perforated media or any other
information storage device, etc., without the prior written permission of the publishers. Breach of this condition is liable for legal
action. Anyone who brings information regarding any such reproduction will be handsomely rewarded.
Every effort has been made to avoid errors or omissions in this publication. In spite of this, some errors might have crept in. Any
mistake, error or discrepancy noted may be brought to our notice which shall be taken care of in the next edition. It is notified that
neither the publishers nor the author or seller will be responsible for any damage or loss of action to anyone, of any kind, in any
manner, therefrom.
For faulty binding, misprints or for missing pages, etc., the publishers’ liability is limited to replacement within one month of the
purchase by a similar edition. All expenses in this connection are to be borne by the purchaser.
The book also includes ample Viva Voce questions. Besides, Presentation on Python,
Chapter-wise Program Codes, Practical File, Sample Question Papers, Model Test
Papers for practice and Python Software Dump are available online and can be
accessed at sultan-chand.com/ws/ipp11.
We are sure the book will prove to be of immense benefit to the teachers and
students alike. Constructive feedback for the improvement of the book will be highly
appreciated and gratefully acknowledged.
My special thanks are due to Mrs. Rinku Kumari for her value additions to the book.
Last but not the least, I take this opportunity to thank my esteemed publishers,
Sultan Chand & Sons (P) Ltd, for their encouragement, assistance and patience
in bringing out this book.
AUTHOR
This book has been prepared strictly in accordance with the latest available syllabus for
CBSE Class XI. Any subsequent change in the syllabus will be duly taken care of and a
printed supplement incorporating all the changes will be provided to students. Also, a soft
copy of the supplement will be available at sultan-chand.com/ws/ipp11 for FREE download.
Syllabus
INFORMATICS PRACTICES
CLASS XI Code No. 065
Distribution of Marks
PRACTICAL
S. No. Description Marks
1. Problem-solving using arithmetic operations, conditional statements and 6
iterations with the help of a Python program. 60% logic + 20% documentation
+ 20% code quality (To be tested on the day of the final exam)
2. Problem-solving using NumPy 4
(To be tested on the day of the final exam)
3. SQL—5 Queries based on single table 5
(To be tested on the day of the final exam)
4. Report File 6
• Minimum 20 Python Programs
• Minimum 20 SQL Queries
5. Viva 4
6. Project using the concepts learnt in the course 5
Total 30
Programming in Python: (Sample problems to be solved using expressions, conditions, loops, list,
dictionary, and strings.)
• To find average and grade for given marks.
• To find amount for given cost-qty-discount.
• To calculate cost perimeter-wise/area-wise.
• To calculate interest (Simple and Compound).
• To calculate profit-loss for given Cost and Selling Price.
• To calculate EMI for Amount, Period and Interest.
• To calculate tax (examples from GST/Income Tax).
• To find the largest and smallest numbers in a list.
• To find the third largest number in a list.
• To find the sum of squares of the first 100 natural numbers.
• To find whether a string is a palindrome or not.
• To compute xn, for given two integers x and n.
• To compute the greatest common divisor and the least common multiple of two integers.
• To test if a number is equal to the sum of the cubes of its digits. Find the smallest and largest such
numbers in the range of 100 to 1000.
Data Handling: The following are some representative lab assignments:
• Import NumPy as `np` and print the version number.
• To create an array of 1D containing numeric values 0 to 9.
• To create a NumPy array with all values as True.
• To extract all odd numbers from NumPy array.
• To extract all even numbers from NumPy array.
• To copy the content of an array A to another array B, replacing all odd numbers of array A with -1
without altering the original array A.
• To replace all odd numbers in numPyarr with -1.
• To copy content of a 1D array into a 2D array with 2 rows.
• To perform basic arithmetic operations on 1D and 2D array.
Data Management: SQL Commands—At least the following SQL commands should be covered during the
labs: create, insert, delete, select.
The following are some representative assignments:
• To create a database.
• To create student table with the student id, class, section, gender, name, dob, and marks as attributes
where the student id is the primary key.
• To insert the details of at least 10 students in the above table.
• To delete the details of a particular student in the above table.
• To increase marks by 5% for those students who have Rno more than 20.
• To display the entire content of table on screen.
• To display Rno, Name and Marks of those students who are scoring marks more than 50.
• To find the average of marks from the student table.
• To find the number of students who are from section ‘A’.
• To add a new column email of appropriate data type.
• To find the minimum and maximum marks obtained by students.
• To modify email for each student.
• To display the information all the students, whose name starts with ‘AN’.
(Examples: ANAND, ANGAD,..)
• To display Rno, Name, DOB of those students who are born between ‘2005-01-01’ and ‘2005-12-31’.
• To display Rno, Name, DOB, Marks, Email of male students in ascending order of their names.
• To display Rno, Gender, Name, DOB, Marks, Email in descending order of their marks.
Project
A complete solution to a problem stating the problem, objective, source code, output. Students in groups of 2-3
are required to work collaboratively to develop a project using Programming Skills learnt during the course.
(Sample Examples can be a combination of few problems illustrated above.)
CONTENTS
1. Computer System 1.1–1.26
1.1 Introduction . . . 1.1
1.2 Basic Components of a Computer System . . . 1.2
1.2.1 Input Unit . . . 1.3
1.2.2 Central Processing Unit (CPU) . . . 1.4
1.2.3 Memory Unit (MU) . . . 1.5
1.2.4 Output Unit . . . 1.7
1.3 Secondary Memory . . . 1.8
1.4 Communication Bus . . . 1.10
1.5 Concept of Operating System . . . 1.10
1.6 Transition from Calculator to Computer to Smart Devices . . . 1.13
1.6.1 Transition from computers to smart devices . . . 1.14
1.7 Troubleshooting with Parts of a Computer . . . 1.15
1.8 Data Representation . . . 1.17
2. Getting Started with Python 2.1–2.16
2.1 Introduction . . . 2.1
2.2 Python Programming Language . . . 2.2
2.2.1 Features of Python . . . 2.2
2.3 Advantages of Python . . . 2.3
2.4 Limitations of Python . . . 2.3
2.5 Installing Python . . . 2.4
2.6 Interacting with Python (Python IDLE) . . . 2.4
2.6.1 Python Shell . . . 2.5
2.6.2 Command Line Interaction . . . 2.6
2.6.3 Python Editor Window (Working in Script Mode) . . . 2.10
2.7 Exiting Python . . . 2.12
3. Python Programming Fundamentals 3.1–3.36
3.1 Introduction . . . 3.1
3.2 Python Character Set . . . 3.1
3.3 Tokens . . . 3.2
3.4 Variables and Types . . . 3.3
3.4.1 type() . . . 3.9
3.4.2 Multiple Assignments . . . 3.12
3.4.3 Variable Names . . . 3.13
3.5 Keywords in Python . . . 3.15
3.6 Expressions . . . 3.16
3.7 Operators . . . 3.16
3.7.1 Mathematical/Arithmetic Operators . . . 3.17
3.7.2 Relational Operators . . . 3.18
3.7.3 Shorthand Augmented Assignment Operators . . . 3.20
3.8 User Input . . . 3.21
3.9 User-defined Functions . . . 3.23
3.10 Indentation in Python . . . 3.25
3.11 Rules and Conventions for Writing Python Programs . . . 3.26
3.12 Comments . . . 3.27
4. Conditional and Looping Constructs 4.1–4.40
4.1 Introduction . . . 4.1
4.2 Introduction to Planning . . . 4.2
4.2.1 Flow Charts . . . 4.2
4.3 Types of Statements in Python . . . 4.4
4.4 Program Control Flow . . . 4.5
4.5 Decision-making . . . 4.6
4.5.1 if Statement . . . 4.6
4.5.2 if-else Statement . . . 4.8
4.5.3 if-elif-else Statement . . . 4.10
4.5.4 Nested if-else Statement . . . 4.12
4.6 Iteration . . . 4.13
4.6.1 for Loop . . . 4.15
4.6.2 while Loop . . . 4.19
4.7 Nested Loops . . . 4.22
4.8 Jump Statements . . . 4.24
4.8.1 break Statement . . . 4.24
4.8.2 continue Statement . . . 4.27
4.8.3 pass Statement . . . 4.29
5. Strings in Python 5.1–5.30
5.1 Introduction . . . 5.1
5.2 What are Strings . . . 5.2
5.3 Creating Strings . . . 5.2
5.4 Traversing a String . . . 5.5
5.5 Special String Operators . . . 5.8
5.5.1 Concatenating Strings . . . 5.8
5.5.2 Replicating Strings . . . 5.9
5.5.3 Membership Operators . . . 5.10
5.5.4 Comparison Operators . . . 5.10
5.5.5 String Slicing . . . 5.11
5.6 Strings are Immutable . . . 5.14
5.7 String Methods and Built-in Functions . . . 5.14
5.8 Other Functions . . . 5.22
6. List in Python 6.1–6.54
6.1 Introduction . . . 6.1
6.2 Lists . . . 6.2
6.2.1 Declaring/Creating List . . . 6.2
6.2.2 Accessing List Elements . . . 6.5
6.2.3 Traversing a List . . . 6.7
6.2.4 Aliasing . . . 6.8
6.2.5 Comparing Lists . . . 6.9
6.3 Operations on Lists . . . 6.10
6.3.1 Concatenation . . . 6.10
6.3.2 Repetition/Replication . . . 6.12
6.3.3 Membership Testing . . . 6.13
6.3.4 Indexing . . . 6.14
6.3.5 Slicing . . . 6.15
6.4 Nested Lists . . . 6.18
6.5 Copying Lists . . . 6.18
6.6 Built-in Functions . . . 6.19
6.6.1 append() . . . 6.20
6.6.2 extend() . . . 6.22
6.6.3 insert() . . . 6.22
6.6.4 reverse() . . . 6.23
6.6.5 index() . . . 6.23
6.6.6 Updating list . . . 6.24
6.6.7 len() . . . 6.25
6.6.8 sort() . . . 6.25
6.6.9 clear() . . . 6.26
6.6.10 count() . . . 6.26
6.7 Deletion Operation . . . 6.27
6.8 Sorting . . . 6.35
6.8.1 Bubble Sort . . . 6.35
6.8.2 Insertion Sort . . . 6.39
7. Dictionary 7.1–7.18
7.1 Introduction . . . 7.1
7.2 Dictionary in Python . . . 7.2
7.3 Methods to Create a Dictionary . . . 7.3
7.4 Accessing Elements in a Dictionary . . . 7.4
7.5 Traversing a Dictionary . . . 7.4
7.6 Appending Values in a Dictionary . . . 7.5
7.7 Updating Elements in a Dictionary . . . 7.6
7.8 Removing an Item from Dictionary . . . 7.6
7.9 ‘in’ and ‘not in’ Membership Operator . . . 7.7
7.10 Common Dictionary Functions and Methods . . . 7.7
7.11 Count Frequency of Elements in a List using Dictionary . . . 7.10
8. Introduction to Python Modules 8.1–8.26
8.1 Introduction . . . 8.1
8.2 Module in Python . . . 8.2
8.3 Importing Python Modules . . . 8.3
8.3.1 Retrieving Objects from a Module . . . 8.5
8.4 Module Aliasing . . . 8.7
8.5 Member Aliasing . . . 8.8
8.6 Locating Modules . . . 8.11
8.7 Standard Built-in-Python Modules . . . 8.11
8.7.1 Built-in-Functions . . . 8.12
9. NumPy 9.1–9.30
9.1 Introduction . . . 9.1
9.2 What is NumPy . . . 9.1
9.3 Installing NumPy . . . 9.3
9.4 Working with NumPy . . . 9.4
9.5 NumPy Arrays Vs Python Lists . . . 9.8
9.6 NumPy Data Types . . . 9.8
9.7 Methods to Create NumPy Arrays . . . 9.9
9.8 Operations on NumPy Array . . . 9.14
9.8.1 Array Slicing . . . 9.14
9.8.2 Joins in Arrays . . . 9.16
9.8.3 Array Subsets . . . 9.18
9.9 Arithmetic Operations on Arrays . . . 9.19
10. Database Concepts 10.1–10.16
10.1 Introduction . . . 10.1
10.2 Database Management System (DBMS) . . . 10.2
10.2.1 Need for DBMS . . . 10.3
10.2.2 Components of a Database System . . . 10.4
10.2.3 Advantages of a DBMS . . . 10.4
10.2.4 Data Independence . . . 10.5
10.3 DBMS Models . . . 10.5
10.3.1 Types of Data Models . . . 10.6
10.4 Relational Database . . . 10.9
10.5 Database Keys . . . 10.10
11. Structured Query Language (SQL) 11.1–11.54
11.1 Introduction . . . 11.1
11.2 Overview of SQL and MySQL . . . 11.1
11.3 Features of SQL . . . 11.2
11.4 Advantages of SQL . . . 11.2
11.5 Classification of SQL Statements . . . 11.3
11.5.1 Data Definition Language (DDL) Commands . . . 11.3
11.5.2 Data Manipulation Language (DML) Commands . . . 11.4
11.6 MySQL . . . 11.4
11.6.1 Starting MySQL Database . . . 11.5
11.7 SQL Data Types . . . 11.6
11.8 SQL Commands . . . 11.8
11.9 SQL Query Processing . . . 11.18
11.9.1 SQL SELECT Statement . . . 11.18
11.9.2 SQL Operators . . . 11.22
11.9.3 Comments in SQL . . . 11.27
11.10 SQL Aliases . . . 11.27
11.11 Putting Text in the Query Output . . . 11.29
11.12 SQL Special Operators . . . 11.29
11.12.1 Conditions Based on a Range—BETWEEN...AND . . . 11.29
11.12.2 Conditions Based on a List—IN . . . 11.30
11.12.3 Conditions Based on Pattern—LIKE . . . 11.31
11.13 Sorting in SQL—Order By . . . 11.32
11.13.1 Aggregate Functions . . . 11.33
12. Cyber Safety 12.1–12.22
12.1 Introduction . . . 12.1
12.2 Cyber Safety . . . 12.1
12.3 Safely Browsing the Web . . . 12.2
12.4 Identity Protection while Using Internet . . . 12.3
12.4.1 Ways of Tracking your Identity . . . 12.4
12.5 Confidentiality of Information . . . 12.6
12.6 Cybercrime . . . 12.6
12.6.1 Cyber Trolls . . . 12.7
12.6.2 Cyber Bullying . . . 12.7
12.6.3 Cyber Stalking . . . 12.7
12.6.4 Spreading Rumours Online . . . 12.8
12.6.5 Reporting Cybercrime . . . 12.8
12.6.6 Combating and Preventing Cybercrime . . . 12.8
12.7 Cyber Forensics . . . 12.9
12.8 IT ACT, 2000 . . . 12.9
12.9 Appropriate Usage of Social Media . . . 12.9
12.10 Network Security Threats . . . 12.11
12.10.1 Denial of Service (DoS) Attacks . . . 12.11
12.10.2 Malware . . . 12.11
12.10.3 Viruses . . . 12.12
12.10.4 Worms . . . 12.12
12.10.5 Trojans . . . 12.12
12.10.6 Zombie Computers and Botnets . . . 12.12
12.10.7 Spyware . . . 12.13
12.10.8 Phishing and Pharming . . . 12.13
12.10.9 Adware . . . 12.13
12.10.10 Eavesdropping . . . 12.14
12.10.11 Child Pornography . . . 12.14
12.11 Communicating Data Safely—Secure Connection . . . 12.15
12.12 Identity Verification . . . 12.17
12.13 Cyber Safety in a Nutshell . . . 12.17
VIVA VOCE V.1–V.4
To My Parents
1.1 INTRODUCTION
Today’s world is an information-rich world and it has become a necessity for everyone to
know about computers and the latest technology. Nowadays, everything around us involves
technology, primarily computers, whether it is withdrawal of money from the ATMs, online
shopping, e-learning, ticket reservation for railways and airlines, payment of telephone or
electricity bills, diagnosis of diseases or searching for information on the internet. Even a
student’s life revolves around smartphones, whether it is email, web surfing, downloading or
uploading information, connecting to social networking sites, clicking photos, and so on. In
short, computer has made a great impact on us and has become an integral part of our lives.
The computer’s capability to process, store and retrieve data and information has made it
an integral part of all kinds of environment—home, office or business. Widespread use of
the computer has made it imperative for us to have knowledge about it, its advantages and
disadvantages, and its internal structure.
So, technically, a computer is defined as an electronic device that takes inputs from the user
in the form of data and instructions, processes this data and produces result (output) as
information.
Commit To Memory (CTM): A computer is an electronic device that accepts a set of instructions in the
form of a program, executes it and displays the output to the user.
S S Roll_no Marks
106 85 106 85
125 70 125 70
169 97 169 97
Fig. 1.1: Data, Processing and Information
Here, data is defined as raw facts or figures such as 106, “Shaurya”, “Class 11”. This data does not
have any meaning when presented as such. However, this data can be organized or processed
to transform it into useful information.
Information is defined as a collection of data which is organized in a particular manner to
generate meaningful or processed data. For example, “Shaurya is a Class 11 student with
Enrolment number 106”. This is a processed data which gives some meaningful information.
Therefore, a computer takes input in the form of data and generates output in the form of
information. This process of converting data into some meaningful information is called
Information Processing Cycle, which we will discuss now.
Both hardware and software together make the computer system function. Let us first take a
look at the functional components of a computer.
Every task given to a computer follows an
Input Output
Data Process Information Input-> Process-> Output Cycle (IPO cycle).
It accepts certain input, processes that input
and produces the desired output. The input
Storage unit takes the input, the central processing unit
processes the data and the output unit produces
Fig. 1.3: IPO Cycle
the output. The memory unit holds the data and
instructions during the processing.
Fig. 1.4 shows the basic structure of a computer. It is also known as Von Neumann Architecture.
A computer receives data and instructions through “Input Devices” which get processed by
the Central Processing Unit (CPU) and the result is shown through “Output Devices”. The
“Main/Primary Memory” and “Secondary/Auxiliary Memory” are used to store data inside the
Informatics Practices with Python–XI
computer.
The main memory holds the input and intermediate output during the processing. Let us
discuss each unit/component in detail.
CPU (Central Processing Unit)
Registers
Main/Primary Secondary
Memory Memory
CTM: An input unit fetches the input and converts it into binary form which is directly understood by
the computer.
cell 0
cell 1
components known as bits. A bit stands Bit
cell 2
for binary digit, i.e., either 0 or 1, which is 1 Byte :
an elementary unit of computer memory. :
cell n
Combinations of these bits together are
used to store data and instructions. Fig. 1.5: Memory Cells
Eight bits together form 1 byte.
The memory can be both primary and secondary depending upon its location in the computer
system. The main or primary memory stores information (data and instructions).
1.5
The memory unit or main memory is divided into:
(a) Random Access Memory (RAM)
(b) Read-Only Memory (ROM)
Cache
Memory RAM Hard disk
CPU
• Units of Memory
The elementary unit of memory is a bit. A bit stands for binary digit, i.e., either 0 or
1, which is an elementary unit of computer memory. Combinations of these bits
together are used to store data and instructions. Eight bits together form 1 byte and
a group of four bits is called a Nibble.
Table 1.1 shows the computer memory units used till date.
1.8
Platter Spindle
(Disk driving motor)
Actuator Track
Head
Axis Spindle Platter
Boom
Actuator Sector
Moving
direction of
arm
Cylinder
HDD Case
Read/Write
Actuator Arm Head
•
Track: Each platter is divided into concentric rings called “tracks”. There are
thousands of tracks on each platter. .
•
Sector: Each track is divided into sectors which are the basic units of storage. A
sector, as a rule, holds 512 bytes of data.
•
Cylinder: A cylinder consists of a set of tracks described by all the heads (on separate
platters) at a single seek position. Each cylinder is equidistant from the centre of
the disk.
(b) Blu-ray Disc: A Blu-ray Disc (BD) is a high-capacity optical disk medium
developed for recording, rewriting and playing back high definition video.
It can store large amounts of data and was designed to supersede the
DVD. Blu-ray discs support higher resolutions and more advanced video
and audio formats as compared to DVDs.
(c)
Compact Disk (CD): It is a thin optical disk which is commonly
used to store audio and video data. The capacity of a standard
120mm CD is 700MB. Transfer speed is mentioned as a multiple
of 150 KB/s, for example, 4X means 600 KB/s.
(d) Magnetic Tapes: In this, magnetic coatings are stored as data on a thin tape.
Earlier, this medium was used for archival purposes.
Computer System
(e)
DVD: Digital Versatile Disc or Digital Video Disc is an optical disc
storage device. It can be recorded on single side or on both sides.
Its capacity may range from 4.7 GB to 8.5 GB.
(f) USB Pen Drive: It is a small, portable memory which can be plugged into a
computer with USB Port. Its capacity is less than that of a hard disk but
much more than a floppy or a CD. Also called a pen drive, it is more reliable.
(g)
Memory Cards: These are data storage devices mainly used with
digital cameras, computers, mobile phones, music players, video
game console, etc. Memory cards offer high recording ability with
power-free storage.
1.9
1.4 COMMUNICATION BUS
A communication bus is a collection of wires that transfers data between computer components,
i.e., carry binary information to and from input/output devices and memory. It usually transmits
binary numbers, one bit per wire. The bus system in computer is made up of three types of buses:
1. Address Bus 2. Data Bus 3. Control Bus
Input and
CPU Memory
Output
Control bus
System bus
Address bus
Data bus
the BIOS. OS performs all basic tasks such as identifying Operating System
basic input/output devices, accepting input from the
input devices, sending results to the output devices,
keeping track of files and directories on the disk, and
Hardware CPU RAM I/O
controlling other peripheral devices such as disk drives
and printers. Fig. 1.11: Operating System
1.10
CTM: An operating system is an integrated set of specialized programs that is used to manage the overall
operations of a computer. It acts as an interface between the user, computer hardware and software.
Every computer must have an operating system to run other programs. DOS (Disk Operating
System), UNIX, LINUX and Windows are some of the commonly used operating systems.
Need for an Operating System
Operating system is an essential component of the system software inside a computer system.
The need for an operating system is described below:
1. User Interface: Operating system provides instructions to prepare user interface, i.e., the
way to interact with the user either through GUI (Graphical User Interface) or command
prompts.
2. Program Execution: Operating system loads necessary programs into the computer memory
which are required for its proper functioning.
3. Resource Allocation: Operating system controls and allocates the system resources like
CPU time, memory (RAM), etc.
4. Manipulation of File System: Operating system manages the method/format in which
information is stored on and retrieved from the hard disk.
5. I/O Operations: Operating system handles all the input-output (I/O) operations.
6. Error Detection: Operating system performs the crucial function of error detection and
handling.
7. Operating system controls the various system hardware and software resources and allocates
them to the users or programs as per their requirement.
Operating system, therefore, performs several functions such as Process Management, Memory
Management, File Management and Device Management.
OS as a Resource Manager
Operating system is responsible for allocating resources to specific programs to complete
their task.
When a computer has multiple users, the need for managing and controlling the resources
(like memory, file, devices, etc.) is even greater. Operating system keeps track of who is using
which resource, grants resource request, and handles the same request from different users
and programs.
Computer System
Thus, operating system as a resource manager manages and protects multiple computer
resources: CPU, Processor, Internal/External memory, Tasks, Applications, Users, Communication
channels, etc.
It handles and allocates resources to multiple users or multiple programs running at the same
time and space (e.g., processor time, memory, I/O devices).
It also decides between conflicting requests for efficient and fair resource use ( for example,
maximize throughput, minimize response time). Resource management constitutes multiplexing
(sharing) resources. It is carried out in two different manners:
1.11
• Time multiplexing
• Space multiplexing
Computer System
System I/O Devices
Memory
Operating I/O Controller Printers,
System Keyboards,
Software Digital camera,
I/O Controller etc.
Programs
and Data
I/O Controller
Processor Processor
Storage
OS
Programs
Data
In time multiplexing, CPU time gets shared among different programs, or users take turns
to use it. Consider a situation where different programs give commands to print at the same
time. Time resource manager manages the task and determines who will go next and for
how long. Thus, the multiple print commands lined up on a single printer shall be carried out
one by one.
Informatics Practices with Python–XI
In space multiplexing, instead of being completed one by one, each one gets some part of the
resource. Main memory is divided amongst several running programs. OS assumes enough
memory to hold multiple programs as it is more efficient at holding several programs at once
rather than allocating all the memory to a single user.
1.12
Memory
Source Object
Assembler Linker
Program Program
Object
Executable program
Code ready for
execution
Loader
Computer System
1.14
trending on the internet. With the launch of Apple Watch and more devices flowing in, these
connected devices are going to keep us hooked to the interconnected world.
Informatics Practices with Python–XI
•
Solution 2: Press and hold the Power button. The Power button is usually located on
the front or side of the computer, typically indicated by the power symbol. Press
and hold the Power button for 5 to 10 seconds to force the computer to shut down.
•
Solution 3: If the computer still wouldn’t shut down, you can unplug the power
cable from the electrical outlet. If you are using a laptop, you may be able to
remove the battery to force the computer to turn off.
Note: This solution should be your last resort after trying the other suggestions above.
(V) Problem: The mouse or keyboard has stopped working
•
Solution 1: If you are using a wired mouse or keyboard, make sure it is correctly
plugged into the computer.
•
Solution 2: If you are using a wireless mouse or keyboard, make sure it is turned
on and that its batteries are charged.
(VI) Problem: The sound isn’t working
•
Solution 1: Check the volume level. Click the audio button in the top-right or
bottom-right corner of the screen to make sure the sound is turned on and that
1.16 the volume is up.
•
Solution 2: Check the audio player controls. Many audio and video players will have
their own separate audio controls. Make sure the sound is turned on and that the
volume is turned up in the player.
•
Solution 3: Check the cables. Make sure external speakers are plugged in, turned
on and connected to the correct audio port or a USB port. If your computer has
colour-coded ports, the audio output port will usually be green.
•
Solution 4: Connect headphones to the computer to find out if you can hear sound
through the headphones.
(VII) Problem: The screen is blank
•
Solution 1: The computer may be in Sleep mode. Click the mouse or press any key
on the keyboard to wake it.
•
Solution 2: Make sure the monitor is plugged in and turned on.
•
Solution 3: Make sure the computer is plugged in and turned on.
•
Solution 4: If you are using a desktop, make sure the monitor cable is properly
connected to the computer tower and the monitor.
However, if the problem still persists in spite of the solutions that we have
discussed, then it may require a more advanced solution like reformatting your
hard drive or reinstalling your operating system, where it is recommended to
consult a professional.
1 0
Computer System
TRUE FALSE
YES NO
ON OFF
BIT
1.17
This ON and OFF together constitute a BIT, which is the smallest piece of information a
computer can store as shown in Fig. 1.15.
Thus, if we use more wires, we get more bits with more 0s and 1s; with more bits, we can
represent more complex information as shown in the figure below.
Computers store all data as patterns of 0s and 1s. BINARY DIGIT ELECTRONIC ELECTRONIC
Information systems using 0s and 1s are collectively (BIT) CHARGE STATE
known as binary information systems.
Each 0 or 1 in a binary value is called a bit, which 1 ON
is short for binary digit. A binary digit, or bit,
is the smallest unit of data in computing. It is
represented by a 0 or a 1. Binary numbers are
made up of binary digits (bits), e.g., the binary
number 1001. 0 OFF
A collection of 8 bits is called a byte. A byte is a
very common unit of storage for electronic
memory. It is usually the smallest chunk of data that programs process, although many
languages support processing individual bits as well. Processing data smaller than a byte is
generally not as easy as processing whole bytes.
1.18
A collection of 4 bits is called a nibble.
A word is the maximum amount of data a CPU can process at once and is usually 1, 2, 4 or 8
bytes (8 to 64 bits).
Numeric data is stored using several different binary number formats, all of which use a finite
number of binary digits (bits) and, therefore, are subject to overflow and round-off. The
circuits in a computer's processor are made up of billions of transistors. A transistor is a tiny
switch that is activated by the electronic signals it receives. Digits 1 and 0 used in binary
reflect the on and off states of a transistor.
Computer programs are sets of instructions. Each instruction is translated into machine code
—simple binary codes that activate the CPU. Programmers write computer code and this is
converted by a translator into binary instructions that the processor can execute.
All software, music, documents and any other information that is processed by a computer is
also stored using binary.
Printer
Microprocessor
Inputs Outputs
Camera
translate text (letters, numbers and symbols) into a form that can be sent to and
understood by other computers and devices such as modems and printers. It is developed
by American National Standards Institute (ANSI). The standard ASCII character set uses
just 7 bits for each character and so it has 27 = 128 possible code groups. It represents all
of the standard keyboard characters as well as control functions such as Return & Linefeed
functions. The characters encoded are numbers 0 to 9, lowercase letters a to z, uppercase
letters A to Z, basic punctuation symbols, control codes that originated with Teletype machines,
and a space.
1.19
Table 1.2: Standard or Lower ASCII characters and codes
Char Dec Binary Char Dec Binary Char Char
! 033 00100001 A 065 01000001 a 097
" 034 00100010 B 066 01000010 b 098
# 035 00100011 C 067 01000011 c 099
$ 036 00100100 D 068 01000100 d 100
% 037 00100101 E 069 01000101 e 101
& 038 00100110 F 070 01000110 f 102
' 039 00100111 G 071 01000111 g 103
( 040 00101000 H 072 01001000 h 104
) 041 00101001 I 073 01001001 i 105
* 042 00101010 J 074 01001010 j 106
+ 043 00101011 K 075 01001011 k 107
, 044 00101100 L 076 01001100 l 108
– 045 00101101 M 077 01001101 m 109
. 046 00101110 N 078 01001110 n 110
/ 047 00101111 O 079 01001111 o 111
0 048 00110000 P 080 01010000 p 112
1 049 00110001 Q 081 01010001 q 113
2 050 00110010 R 082 01010010 r 114
3 051 00110011 S 083 01010011 s 115
4 052 00110100 T 084 01010100 t 116
5 053 00110101 U 085 01010101 u 117
6 054 00110110 V 086 01010110 v 118
7 055 00110111 W 087 01010111 w 119
8 056 00111000 X 088 01011000 x 120
9 057 00111001 Y 089 01011001 y 121
: 058 00111010 Z 090 01011010 z 122
; 059 00111011 [ 091 01011011 { 123
Informatics Practices with Python–XI
MEMORY BYTES
Data: Data is defined as raw facts, such as figures, symbols and numbers that can be used for analysis.
Information: Information is defined as a collection of data.
Operating System (OS): An OS acts as an intermediary (providing communication) between the user of a computer
and computer hardware.
Hardware devices: Input device, system unit, output devices and memory devices are collectively known as
hardware devices.
Buses: A bus can be defined as a set of wires/cables to carry binary information to or from input/output devices
and memory.
The CPU interacts closely with primary storage or main memory, referring to it for both instructions and data.
There are three basic components in the CPU register section—arithmetic and logic unit, memory and control unit.
Central processing unit is the brain of any computer system.
Control unit controls all the hardware operations, i.e., input and output units, storage and processor, etc.
The arithmetic logic units in computers are capable of performing addition, subtraction, division and multiplication
as well as some logical operations.
The memory of a computer can hold program instructions, data values and intermediate results of calculations.
Memory Unit is an essential component for storing the programs and data executed by the CPU.
The main memory of computer is also known as RAM, standing for Random Access Memory.
External memory, which is sometimes called backing store or secondary memory, allows the permanent storage
of large quantities of data.
Registers are small data-holding areas within CPU that hold data, instructions and memory address during processing.
Main memory can either be ROM or RAM.
ROM is read-only memory that stores some pre-written instructions.
RAM is random access memory that can be read and written and is used for manipulating data during processing.
The primary memory, RAM, is volatile in nature as all contents are erased as soon as power goes off.
The storage unit stores the contents permanently.
Computer System
Major storage devices are hard disks, CD, DVD, flash drive and Blu-ray Disks.
The numbers ‘0’ and ‘1’ are called binary digits.
Binary data representation has only two symbols—0 and 1.
ASCII, ISCII and UNICODE are the three internal storage characters representation.
A buffer is a data area shared by hardware devices or program processes that operate at different speeds or
with different sets of priorities.
A memory card can store various types of data, such as text, pictures, graphics, audio and video.
A calculator is a handheld device used to perform basic math operations, while a computer is a multipurpose
device which can also perform complex calculations. While a calculator can carry out only one operation at
a time, computers can perform multiple tasks and, with the help of a series of instructions called computer
programs, carry out the entire task without any assistance.
1.21
OBJECTIVE TYPE QUESTIONS
1. Fill in the blanks.
(a) A program which acts as an interface between the user and hardware is called ........................... .
(b) A collection of 4 bits is called a .............................. .
(c) Binary number system has digits as .............................. and .............................. .
(d) A collection of 8 bits is called a .............................. .
(e) .............................. is a pointing device.
(f) .............................. is read-only memory that stores some pre-written instructions.
(g) .............................. is a new universal coding standard adopted by all new platforms.
(h) The .............................. in computers are capable of performing arithmetic and logical operations.
(i) .............................. controls all the hardware operations of a computer system.
(j) Expanded form of ISCII .............................. .
(k) A ................... is a non-volatile high-capacity storage device ranging from 1 GB to several terabytes.
(l) .............................. memory speeds up access to data and instructions stored in RAM.
(m) QR code is the abbreviation for .............................. .
(n) A .............................. is a system software program that is responsible for loading programs and
libraries from secondary storage into main memory.
Answers: (a) Operating system (b) Nibble (c) 0, 1
(d) Byte (e) Mouse (f) ROM
(g) Unicode (h) ALU (i) Control unit
(j) Indian Standard Code for Information Interchange (k) Hard disk
(l) Cache (m) Quick Response code (n) Loader
2. State whether the following statements are True or False.
(a) Control unit sends control signals to ALU and memory for carrying out the required operations.
(b) A light pen is a pointing device that can be used to select anything on the computer screen by simply
pointing at it or for drawing figures directly on the screen.
(c) RAM operates much faster than cache memory.
(d) 1 GB = 1024 KB
(e) An operating system acts as an interface between the user, computer hardware and software.
(f) A computer has the capacity to perform calculations and other logical functions, whereas a calculator
only performs arithmetic and geometrical operations.
Informatics Practices with Python–XI
(g) A word is the maximum amount of data a CPU can process at once.
(h) An address bus carries data from one place to another in a computer system.
(i) Dot matrix printer uses laser technology to produce printed documents.
(j) The primary memory unit stores data and instructions permanently.
(k) ROM is volatile in nature.
(l) External memory allows the permanent storage of large quantities of data.
Answers: (a) True (b) True (c) False (d) False (e) True (f) True
(g) True (h) False (i) False (j) False (k) False (l) True
3. Multiple Choice Questions (MCQs):
(a) What is the full form of IPO?
(i) Input Process Output (ii) Input Print Output
(iii) Internet Print Output (iv) Internet Process Output
(b) Which is the fastest memory device?
(i) RAM (ii) Register (iii) Blu ray disc (iv) Hard Disk
(c) What is the full form of RAM?
(i) Read access memory (ii) Random access memory
(iii) Raw access memory (iv) Right access memory
(d) ROM is a
(i) volatile memory (ii) non-volatile memory
1.22 (iii) Both (a) and (b) (iv) None of these
(e) What is an information?
(i) Collection of data (ii) Collection of programs
(iii) Collection of instructions (iv) None of these
(f) Utilities is/are:
(i) Text editor (ii) Backup (iii) Disk defragmenter (iv) All of these
(g) Which of the following are sub-units that make the CPU?
(i) Control unit (ii) ALU (iii) Both (a) and (b) (iv) All of these
(h) Which of the following is/are a type of OS?
(i) Single-user OS (ii) Multi-user OS (iii) Time-sharing OS (iv) All of these
(i) What is the full form of ISCII?
(i) International Standard Code for Information Interchange
(ii) Indian Script Code for Information Interchange
(iii) International Script Code for Information Interchange
(iv) None of these
(j) 1 TB is equivalent to:
(i) 210 bytes (ii) 210 MB (iii) 210 GB (iv) 210 KB
(k) Storage of 1 KB means the following number of bytes:
(i) 1000 (ii) 964 (iii) 1024 (iv) 1064
(l) One Megabyte is equivalent to:
(i) 210 bytes (ii) 220 bytes (iii) 230 bytes (iv) None of these
Answers: (a) (i) (b) (ii) (c) (ii) (d) (ii) (e) (i) (f) (iv)
(g) (iii) (h) (iv) (i) (ii) (j) (iii) (k) (iii) (l) (iv)
SOLVED QUESTIONS
1. List the names of two components of CPU.
Ans. The names of two components of CPU are as follows:
(a) Control Unit (b) Arithmetic Logic Unit
2. What is an I-P-O cycle?
Ans. A computer takes input in the form of data and generates output in the form of information. This
process of converting data into some meaningful information is called information processing or
Input-Process-Output (I-P-O) cycle.
3. List all the functional components of a computer.
Ans. The functional components of a computer are as follows:
(a) Input Unit (b) Central Processing Unit (CPU)
(c) Output Unit (d) Memory Unit
4. Who invented the mouse?
Ans. Mouse is a pointing (input) device that was developed by Douglas Engelart in 1963.
Computer System
Ans. Microphone: This device is used to input sound or the vocal input of the people speaking.
Speakers: These are needed so as to hear the sound/audio output from the computer.
Webcam: Webcam or web camera is needed to capture the video image of an ongoing activity.
13. What is the function of memory? What are its measuring units?
Ans. Memory temporarily holds the data and information during processing. The smallest unit of memory is
a byte (8 bits). A byte can store one character in binary form. Other measuring units are kilobyte (KB)
equal to 1024 (210) bytes, 1 Megabyte (MB) equal to 1024 KB, 1 Gigabyte (GB) equal to 1024 MB and
Terabyte (TB) equal to 1024 GB.
14. A school newsletter contains text and images in it. The head teacher needs one thousand copies of this
newsletter. Give four reasons why a laser printer should be used rather than an inkjet or a dot matrix
printer.
Ans. (i) High quality printouts—better than inkjet or dot matrix
(ii) Fast printouts—faster than inkjet or dot matrix
(iii) Prints very quietly—quicker than inkjet or dot matrix
(iv) Cost per page is low—cheaper than inkjet or dot matrix
15. What is the difference between RAM and ROM?
Ans. RAM refers to random access memory where both read and write operations can take place. But RAM
is a volatile memory; its contents are lost when power is turned off. ROM refers to read-only memory
where only read or write operation can take place. ROM is a non-volatile memory. B oth RAM and ROM
1.24 are parts of the primary memory.
16. Why is computer beneficial to us?
Ans. Computers are beneficial to us in many ways like storing and retrieving large volumes of data/information
easily, efficiently and in a secured manner. Computers can perform calculations on large and complex data
sets within a fraction of a second with complete accuracy. They can be used anywhere and everywhere,
whether at home or at workplace or for scientific purposes.
17. What is the difference between an address bus and a data bus?
Ans. The difference between an address bus and a data bus is as follows:
Address bus: An address bus contains the address of the piece of memory or I/O devices to be read from
or written to. One wire is required for each bit which means 16 bits will require 16 wires. A 16-bit binary
number allows 216 or 32,000 different numbers.
Data Bus: A data bus actually carries the data to be processed in binary form. It carries the information
between the processor and various other external units, such as memory. Its typical size is 8 or 16 bits.
18. Explain the usage of the smart card reader.
Ans. We are all aware of ATM cards that are used in ATM machines. ATM cards store data through magnetic strips,
which are pasted on the back of these cards. Magnetic strips hold much more data than printed characters
or bar codes per unit of space. These strips are not human-readable and are, therefore, used to store
confidential data. Moreover, it is almost impossible to create a duplicate copy of the cards containing such
strips. Special reader machines are required to decode the encoded data stored on these magnetic strips.
The enhanced version of a card containing magnetic strips is called a smart card. A smart card is embedded
with a microprocessor that can hold a certain amount of personal data in its memory. The special reader
machine that is used to decode the data on smart cards is known as smart card reader.
19. What is the difference between data and information?
Ans. The difference between data and information is as follows:
Data is defined as raw facts and figures such as “Tejas”, “MBA”, “2013”, “ABC”. This data does not have
any meaning when presented as such. However, this data can be organized or processed to transform
it into useful information.
Information is defined as a collection of data which is organized in a particular manner to generate some
meaning. For example, “Tejas passed MBA in 2013 from ABC” is the information that we have obtained
after processing the data given above.
20. Why is primary memory termed as ‘destructive write’ memory but ‘non-destructive read’ memory? [HOTS]
Ans. When a memory location is read from the primary memory, the contents of the memory word remain the
same; they are not altered. Therefore, a primary memory is termed as ‘non-destructive read’ memory
since the read operation does not destroy the contents of a memory word.
When a write operation takes place, the previous contents of the memory word are overwritten. Thus,
the primary memory is termed as ‘destructive write’ memory as the write operation destroys the
contents of a memory word.
21. What is Unicode? How is it useful?
Ans. Unicode is a new universal coding standard adopted by all new platforms. It is promoted by Unicode
Consortium which is a non-profit organization. Unicode provides a unique number for every character
irrespective of the platform, program and language.
It is a character coding system designed to support the worldwide interchange, processing and display
Computer System
of the written texts of diverse languages. A unique number for every character, no matter what the
platform, no matter what the program, no matter what the language.
UNSOLVED QUESTIONS
1. Define a computer.
2. How does an ALU work?
3. Briefly explain the working of a control unit.
4. Define hardware and software.
5. What is an operating system?
6. What is software?
7. List some of the hardware in computer equipment.
8. Explain the types of operating systems with examples. 1.25
9. “Hardware is of no use without software and software cannot be used without hardware.” Explain.
10. How can software be classified? Name at least one software in each of the categories.
11. What is an operating system? Write names of any two popular operating systems.
12. Specify the measuring units of memory.
13. What are output devices? Give some examples.
14. List different types of impact printers.
15. Briefly explain the working of a laser printer.
16. What is the use of a light pen?
17. What do you understand by RAM and ROM?
18. Explain in brief the working of a touch screen.
19. What are plotters? List different types of plotters.
20. What are secondary storage devices? Give examples.
21. What is the major difference between optical and magnetic discs?
22. What do you mean by a communication bus? List its types.
23. List the differences between a CD and a DVD.
24. Explain the statement, “Functioning of a computer is similar to the way the human brain functions.”
25. Explain in brief the basic architecture of a computer.
26. What is an input unit? Give its significance.
27. List and briefly explain all the components of a CPU.
28. Why is a control unit referred to as the central controller of a computer?
29. Does an ALU work independently or in coordination with some other unit? Give reasons.
30. Compare data and information.
31. How does an output unit work? Give examples of some output devices.
32. What is the role of memory in the functioning of a computer?
33. List all the hardware components of a computer. Give their significance.
34. Explain various components of a computer system and show the relationship between them with the help
of a diagram.
35. Compare volatile memory and non-volatile memory.
36. Define primary storage devices. List their types.
Informatics Practices with Python–XI