0% found this document useful (0 votes)
90 views54 pages

11CS EM Lessons1 To 8

hi hhhdnhugebduqasbbbbbbbb eaugueg aueguahjkdk jaheuhugfydg huiehiwhiqdj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
90 views54 pages

11CS EM Lessons1 To 8

hi hhhdnhugebduqasbbbbbbbb eaugueg aueguahjkdk jaheuhugfydg huiehiwhiqdj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 54

என்றும் மாணவர்கள் நலனில்

COMPUTER SCIENCE

For Orders & Payment

9345299522

THAAI PATHIPPAGAM

VIRUTHUNAGAR
PREFACE

 It has been prepared keeping all students in mind with the primary motto
" - என்றும் மாணவர்கள் நலனில்".
 Simplicity and elegant answers have been effectively prepared by teachers with
more than 20 years of experience with a view to achieving full marks.
 Keeping in view the public examination answer keys, the answers, syntax, examples
with explanation and output are given for better understanding and reading.
 Following the answers to the book questions, additional questions have been given
at the end of each lesson with emphasis on compulsory questions.
 Our Services,
 (set of model question papers and public exam papers)
 (Minimum learning material)
 (set of questions not to be missed at the last moment)



 Best Wishes to Get Full Marks and a successful future.

- Author and Publisher


CONTENTS
Chapter Title page
UNIT I –FUNDAMENTALS OF COMPUTER AND WORKING WITH A
TYPICAL OPERATING SYSTEMS (WINDOWS & LINUX)
1 Introduction to Computers 1
2 Number Systems 7
3 Computer Organization 20
4 Theoretical Concepts of Operating System 25
5 Working with Windows Operating System 30
UNIT II-ALGORITHMIC PROBLEM SOLVING
6 Specification and Abstraction 36
7 Composition and Decomposition 41
8 Iteration and recursion 46
UNIT III – INTRODUCTION TO C++
9 Introduction to C++ 54
10 Flow of Control 67
11 Functions 75
12 Arrays and Structures 83
UNIT IV - OBJECT ORIENTED PROGRAMMING WITH C++
13 Introduction to Object Oriented Programming 93
Techniques
14 Classes and objects 98
15 Polymorphism 108
16 Inheritance 114
UNIT V – COMPUTER ETHICS AND CYBER SECURITY
17 Computer Ethics and Cyber Security 123
18 Tamil Computing 128
1 INTRODUCTION TO COMPUTERS

SECTION – A
Choose the correct answer. 1 Mark
1. First generation computers used
(a) Vacuum tubes (b) Transistors
(c) Integrated circuits (d) Microprocessors
2. Name the volatile memory
(a) ROM (b) PROM (c) RAM (d) EPROM
3. Identify the output device
(a) Keyboard (b) Memory (c) Monitor (d) Mouse
4. Identify the input device
(a) Printer (b) Mouse (c) Plotter (d) Projector
5. …....… Output device is used for printing building plan.
(a) Thermal printer (b) Plotter (c) Dot matrix (d) inkjet printer
6. Which one of the following is used to in ATM machines
(a) Touch Screen (b) speaker (c) Monitor (d) Printer
7. When a system restart which type of booting is used.
(a) Warm booting (b) Cold booting (c) Touch boot (d) Real boot
8. Expand POST
(a) Post on Self Test (b) Power on Software Test
(c) Power on Self Test (d) Power on Self Text
9. Which one of the following is the main memory?
(a) ROM (b) RAM (c) Flash drive (d) Hard disk
10. Which generation of computer used IC’s?
(a) First (b) Second (c) Third (d) Fourth
SECTION - B
Very Short Answers. 2 Marks
1. What is a computer?
It is an electronic device that processes the input according to the set of instructions
provided to it and gives the desired output at a very fast rate.
2. Distinguish between data and information.
Data Information
Data is defined as an unprocessed collection Information is a collection of facts from
of raw facts, suitable for communication, which conclusions may be drawn.
interpretation or processing.
This will not give any meaningful message. It conveys some meaning.
For example, 16, ‘Kavitha’, ‘C’ For example, Kavitha is 16 years old.

..1.. THAAI VIRUDHUNAGAR


– 1. INTRODUCTION TO COMPUTERS _
3. What are the components of a CPU?
❖ Arithmetic and Logic Unit
❖ Control Unit
❖ Memory Unit
4. What is the function of an ALU?
➢ The ALU is a part of the CPU where various computing functions are performed on data.
➢ The ALU performs arithmetic operations such as addition, subtraction, multiplication,
division and logical operations.
5. Write the functions of control unit.
➢ The control unit controls the flow of data between the CPU, memory and I/O devices.
➢ It also controls the entire operation of a computer.
6. What is the function of memory?
The Memory Unit is of two types which are primary memory and secondary memory.
✓ The primary memory is used to temporarily store the programs and data when the
instructions are ready to execute.
✓ The secondary memory is used to store the data permanently.
7. Differentiate Input and output unit.
Input Unit Output Unit
Input unit is used to feed any form of data to An Output Unit is any hardware component
the computer, which can be stored in the that conveys information to users in an
memory unit for further processing. understandable form.
Example: Keyboard, mouse, etc. Example: Monitor, Printer etc.
8. Distinguish Primary and Secondary memory.
Primary Memory Secondary memory
The primary memory is used to temporarily The secondary memory is used to store the
store the programs and data when the data permanently.
instructions are ready to execute.
The Primary Memory is volatile, that is, the The Secondary memory is non-volatile, that
content is lost when the power supply is is, the content is available even after the
switched off. power supply is switched off.
Example: RAM Example: Hard disk, CD-ROM and DVD ROM
SECTION - C
Short Answers. 3 Marks
1. What are the characteristics of a computer?
❖ Speed: Computers can work very fast.
❖ Accuracy: The degree of accuracy of computer is very high.
❖ Consistency: Computers are consistent in their performance.
❖ Memory: Computers have the ability to store and retrieve data.
❖ Storage Capacity: Computers have high storage capacity.
❖ Automation: Computers can perform tasks automatically.

..2.. THAAI VIRUDHUNAGAR


– 1. INTRODUCTION TO COMPUTERS _
2. Write the applications of computer.
Computers are seen everywhere around us, in all spheres of life, in the field of education,
research, travel and tourism, weather forecasting, social networking, e-commerce, booking
airlines, railway or movie tickets and even playing games.
3. What is an input device? Give two examples.
Input unit is used to feed any form of data to the computer, which can be stored in the
memory unit for further processing.
Example: Keyboard, mouse
4. Name any three output devices.
i. Monitor - Monitor is the most commonly used output device to display the information.
ii. Printer - Printers are used to print the information on papers.
iii. Plotter - Plotter is an output device that is used to produce graphical output on papers.
5. Differentiate optical and Laser mouse.
Optical mouse Laser mouse
Input unit is used to feed any form of data to An Output Unit is any hardware component
the computer, which can be stored in the that conveys information to users in an
memory unit for further processing. understandable form.
Example: Keyboard, mouse, etc. Example: Monitor, Printer etc.
6. Write short note on impact printer.
These printers print with striking of hammers or pins on ribbon. These printers can print
on multi-part (using carbon papers) by using mechanical pressure.
For example, Dot Matrix printers and Line matrix printers are impact printers.
7. Write the characteristics of sixth generation.
❖ In the Sixth Generation, computers could be defined as the era of intelligent computers,
based on Artificial Neural Networks.
❖ One of the most dramatic changes in the sixth generation will be the explosive growth of
Wide Area Networking.
❖ Natural Language Processing (NLP) is a component of Artificial Intelligence (AI). It provides
the ability to develop the computer program to understand human language.
8. Write the significant features of monitor.
❖ Monitor is the most commonly used output device to display the information.
❖ It looks like a TV. Pictures on a monitor are formed with picture elements called PIXELS.
❖ Monitors may either be Monochrome which display text or images in Black and White or
can be color, which display results in multiple colors.
❖ The monitor works with the VGA (Video Graphics Array) card.

..3.. THAAI VIRUDHUNAGAR


– 1. INTRODUCTION TO COMPUTERS _
SECTION - D
Explain in detail. 5 Marks
1. Explain the basic components of a computer with a neat diagram.

Control Unit

Input Unit ALU


Output Unit

Internal Memory
Data path
Control path
Main Memory

Secondary Storage

Input Unit:
➢ Input unit is used to feed any form of data to the computer, which can be stored in the
memory unit for further processing.
Example: Keyboard, mouse
Central Processing Unit:
➢ CPU is the major component which interprets and executes software instructions. It also
controls the operation of all other components such as memory, input and output units.
➢ The CPU has three components which are Control unit, Arithmetic and logic unit (ALU)
and Memory unit.
Control Unit:
➢ The control unit controls the flow of data between the CPU, memory and I/O devices.
➢ It also controls the entire operation of a computer.
Arithmetic and Logic Unit:
✓ The ALU is a part of the CPU where various computing functions are performed on data.
✓ The ALU performs arithmetic operations such as addition, subtraction, multiplication,
division and logical operations.
Memory Unit:
The Memory Unit is of two types which are primary memory and secondary memory.
✓ The primary memory is used to temporarily store the programs and data when the
instructions are ready to execute.
✓ The secondary memory is used to store the data permanently.

..4.. THAAI VIRUDHUNAGAR


– 1. INTRODUCTION TO COMPUTERS _
Output Unit:
✓ An Output Unit is any hardware component that conveys information to users in an
understandable form.
Example: Monitor, Printer etc.
2. Discuss the various generations of computers.
1) First Generation (1940 – 1956) – Vacuum tubes
❖ Big in size
❖ Consumed more power
❖ Malfunction due to overheat
❖ Machine Language was used
Example: ENIAC , EDVAC , UNIVAC 1
2) Second Generation (1956 – 1964) - Transistors
❖ Smaller compared to First Generation
❖ Generated Less Heat
❖ Consumed less power compared to first generation
❖ Punched cards were used
❖ Machine language as well as Assembly language was used.
Example: IBM 1401, IBM 1620, UNIVAC 1108
3) Third Generation (1964 – 1971) - Integrated Circuits
❖ Computers were smaller, faster and more reliable
❖ Consumed less power
❖ High Level Languages were used
Example: IBM 360 series, Honeywell 6000 series
4) Fourth Generation (1971 – 1980) - Microprocessor
❖ Smaller and Faster
❖ Microcomputer series such as IBM and APPLE were developed
❖ Portable Computers were introduced.
5) Fifth Generation (1980 – till date) - Ultra Large-Scale Integration
❖ Computers size was drastically reduced.
❖ Parallel Processing
❖ Can recognise Images and Graphics
❖ Introduction of Artificial Intelligence and Expert Systems
❖ Able to solve high complex problems including decision making and logical reasoning
6) Sixth Generation - In future - Artificial Intelligence
❖ Parallel and Distributed computing
❖ Computers have become smarter, faster and smaller
❖ Development of robotics
❖ Natural Language Processing
❖ Development of Voice Recognition Software

..5.. THAAI VIRUDHUNAGAR


– 1. INTRODUCTION TO COMPUTERS _
3. Explain the following a. Inkjet Printer b. Multimedia projector c. Bar code / QR code
Reader
a. Inkjet Printer:
➢ Inkjet Printers use colour cartridges which combined Magenta, Yellow and Cyan inks
to create color tones.
➢ A black cartridge is also used for monochrome output.
➢ Inkjet printers work by spraying ionised ink at a sheet of paper.
➢ The speed of Inkjet printers generally ranges from 1-20 PPM (Page Per Minute).
b. Multimedia projector:
➢ Multimedia projectors are used to produce computer output on a big screen.
➢ These are used to display presentations in meeting halls or in classrooms.
c. Bar Code / QR Code Reader:
➢ A Bar code is a pattern printed in lines of different thickness.
➢ The Bar code reader scans the information on the bar codes transmits to the
computer for further processing.
➢ The system gives fast and error free entry of information into the computer.
➢ QR (Quick response) Code: The QR code is the two-dimension bar code which can be
read by a camera and processed to interpret the image.
ADDITIONAL QUESTIONS
1. Match.
a) First Generation Computer - i) Honeywell 6000 series
b) Second Generation Computer - ii) 1971-1980
c) Third Generation Computer - iii) Transistors
d) Fourth Generation Computer - iv) Machine Language
a) iv, iii, i, ii b) i, iii, iv, ii c) i, ii, iii, iv d) i, ii, iv, iii
2. Which generation of computer used Ultra Large-Scale Integration?
A) Second Generation Computer B) Third Generation Computer
C) Fourth Generation Computer D) Fifth Generation Computer
3. Expansion of ALU is
A) Arithmetic and Literal Unit B) Automatic and Logistic Unit
C) Arithmetic and Logarithmic Unit D) Arithmetic and Logic Unit
4. Expansion of RAM is
A) Radio Access Memory B) Random Access Memory
C) Random Address Memory D) Random Access Member
5. Expansion of ROM is
A) Read Only Memory B) Random Open Memory
C) Response Optional Memory D) Read Optional Memory
6. Expansion of Q.R. is
A) Question Response B) Question Reader
C) Quick Response D) Quick Reader

..6.. THAAI VIRUDHUNAGAR


– 1. INTRODUCTION TO COMPUTERS _
7. Expansion of CRT is
A) Cassette Radio Terminal B) Cathode Ray tube
C) Cathode Ray Terminal D) Cathode Rays Transfer
8. Expansion of LCD is
A) Light Crystal Display B) Liquid Cathode Display
C) Liquid Crystal Display D) Least Crystal Display
9. Expansion of LED is
A) Liquid Emitting Diodes B) Least Emitting Diodes
C) Laser Emitting Diodes D) Light Emitting Diodes
10. Expansion of VGA is
A) Video Graphics Array B) Video Graphics Adapter
C) Vector Graphics Adapter D) Video Graphics Accessor
11. The first computer monitor was part of the ________ computer system.
A) Xerox Alto B) IBM 1620 C) ENIAC1800 D) Pentium I
12. Expansion of BIOS is
A) Basic Input Output Software B) Basic Input Output System
C) Beginners Input Output Services D) Basic Input Output Strategy
13. What is software?
Software is the set of programs or instructions given to a computer.
14. Differentiate between Impact Printers and Non-Impact printers.
Impact Printers Non-Impact printers
These printers print with striking of These printers do not use striking
hammers or pins on ribbon. mechanism for printing. They use
electrostatic or laser technology.
These printers can print on multi-part These printers cannot print on multi-part
(using carbon papers) by using but quality and speed of these printers are
mechanical pressure. better than Impact printers.
Example: Dot Matrix printers and Line Example: Laser printers and Inkjet printers
matrix printers
15. What is Booting? Explain its two types.
When a computer is switched on, the pre-written program called POST (Power on Self
Test) will be executed first. This program checks if the devices like RAM, keyboard, etc.,
are connected properly and ready to operate. If these devices are ready, then the BIOS
(Basic Input Output System) gets executed. This process is called Booting.
Booting process is of two types. 1) Cold Booting 2) Warm Booting
1. Cold Booting: When the user presses the Power button, the instructions are read
from the ROM to initiate the booting process. This is called cold booting or hard
booting.
2. Warm Booting: When the system restarts, we call it Warm Booting or Soft
Booting. The system does not start from initial state and so all diagnostic tests
need not be carried out in this case.

..7.. THAAI VIRUDHUNAGAR


2 NUMBER SYSTEMS

SECTION – A
Choose the correct answer. 1 Mark
1. Which refers to the number of bits processed by a computer’s CPU?
A) Byte B) Nibble C) Word length D) Bit
2. How many bytes does 1 Kilo Byte contain?
A) 1000 B) 8 C) 4 D) 1024
3. Expansion for ASCII
A) American School Code for Information Interchange
B) American Standard Code for Information Interchange
C) All Standard Code for Information Interchange
D) American Society Code for Information Interchange
4. 2^50 is referred as
A) Kilo B) Tera C) Peta D) Zetta
5. How many characters can be handled in Binary Coded Decimal System?
A) 64 B) 255 C) 256 D) 128
6. For 11012 the equivalent Hexadecimal is?
A) F B) E C) D D) B
7. What Is the 1’s complement of 00100110?
A) 00100110 B) 11011001 C) 11010001 D) 00101001
8. Which amongst this is not an Octal number?
A) 645 B) 234 C) 876 D) 123
SECTION - B
Very Short Answers. 2 Marks
1. What is data?
The term data comes from the word datum, which means a raw fact. The data is a fact
about people, places or some objects.
2. Write the 1’s complement procedure.
Step 1: Convert given Decimal number into Binary
Step 2: Check if the binary number contains 8 bits , if less add 0 at the left most bit, to make it
as 8 bits.
Step 3: Invert all bits (i.e. Change 1 as 0 and 0 as 1)
Example:
1. The binary number equivalent to the decimal number 15 is 11112
2. Convert to 8 bits 000011112
3. 1’s complement value is 111100002

..8.. THAAI VIRUDHUNAGAR


– 2. NUMBER SYSTEMS _
3. Convert (46)10 into Binary number.
2 46
2 23 –0
2 11 –1
2 5 –1
2 2 -1 (46)10 = (101110)2
1 -0
4. We cannot find 1’s complement for (28)10. State reason.
The 1’s complement method is applicable only to negative numbers. (28)10 is a positive
number. Therefore, we cannot find 1’s complement for (28)10.
5. List the encoding systems that represents characters in memory.
❖ BCD ❖ ASCII ❖ EBCDIC
❖ ISCII ❖ Unicode
SECTION – C
Short Answers. 3 Marks
1. What is radix of a number system? Give example.
Each number system is uniquely identified by its base value or radix. Radix or base is the
count of number of digits in each number system.
Number Systems Radix Example
Binary Numbers (0, 1) 2 (1101)2
Octal Numbers (0, 1, 2, 3, 4, 5, 6, 7) 8 (237)8
Decimal Numbers (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) 10 (3)9
Hexadecimal Numbers 16 (4E)16
(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F)

2. Write note on binary number system.


➢ There are only two digits in the Binary system, namely, 0 and 1.
➢ The numbers in the binary system are represented to the base 2 and the positional
multipliers are the powers of 2.
➢ The left most bit in the binary number is called as the Most Significant Bit (MSB) and it has
the largest positional weight. The right most bit is the Least Significant Bit (LSB) and has
the smallest positional weight.

..9.. THAAI VIRUDHUNAGAR


– 2. NUMBER SYSTEMS _
3. Convert (150)10 into Binary, then convert that Binary number to Octal.
Binary Conversion:
2 150
2 75 –0
2 37 –1
2 18 –1
2 9 -0
2 4 -1
2 2 -0
1 -0
(150)10 = (10010110)2
Binary to Octal Conversion:
Step 1: Group the given binary number into 3 bits from right to left.
010 010 110
Step 2: Convert equivalent octal value using "2's power positional weight method"
010 010 110
2 2 6
(10010110)2 = (226)8
4. Write short note on ISCII.
➢ ISCII is the system of handling the character of Indian local languages.
➢ This as a 8-bit coding system. Therefore, it can handle 256 (28 ) characters.
➢ This system is formulated by the department of Electronics in India in the year 1986 - 88
and recognized by Bureau of Indian Standards (BIS).
➢ Now this coding system is integrated with Unicode.
5. Add a) -2210 +1510 b) 2010 +2510
a) -2210 + 1510
2 22 2 15
2 11 –0 2 7 –1
2 5 –1 2 3 –1
2 2 –1 1 -0
1 -0
2210 = 101102 1510 = 11112
Finding the binary value of -2210
8-bit for of 2210 = 00010110
1’s complement = 11101001
Add 1 = 1
2’s complement = 11101010
-2210 = 111010102

..10.. THAAI VIRUDHUNAGAR


– 2. NUMBER SYSTEMS _
-2210 + 1510 = 1 1101010+
0 0001111
= 1 1111001
-2210 + 1510 = 111110012
b) 2010 + 2510

2 20 2 25
2 10 –0 2 12 –1
2 5 –0 2 6 –0
2 2 –1 2 3 -0
1 -0 1 -1

2010 = 101002 2510=110012


2010 + 2510 = 00010100+
00011001
= 00101101
-2210 + 1510 = 001011012
SECTION – D
Explain in detail. 5 Marks
1. a) Write the procedure to convert fractional Decimal to Binary.
Conversion of fractional Decimal to Binary:
❖ The method of repeated multiplication by 2 has to be used to convert such kind of decimal
fractions.
Method:
Step 1: Multiply the decimal fraction by 2 and note the integer part. The integer part is either
0 or 1.
Step 2: Discard the integer part of the previous product. Multiply the fractional part of the
previous product by 2. Repeat Step1 until the same fraction repeats or terminates (0).
Step 3: The resulting integer part forms a sequence of 0s and 1s that become the binary
equivalent of decimal fraction.
Step 4: The final answer is to be written from first integer part obtained till the last integer
part obtained.
b) Convert (98.46)10 to Binary.
98- Integer Part 0.46 – Fractional part
2 98 0.46 x 2 = 0.92 = 0
2 49 –0 0.82 x 2 = 1.84 = 1
2 24 –1 0.84 x 2 = 1.68 = 1
2 12 –0 0.68 x 2 = 1.36 = 1
0.36 x 2 = 0.72 = 0
2 6 -0
0.72 x 2 = 1.44 = 1
2 3 –0
(98.46)10 = 1100010.01110
1 -1

..11.. THAAI VIRUDHUNAGAR


– 2. NUMBER SYSTEMS _
2. Find 1’s Complement and 2’s Complement for the following Decimal number
a) -98 b) -135
a) -98
2 98 Binary value of 9810 = 1100010
2 49 –0 8bit format = 01100010
2 24 –1 1’s complement = 10011101
2 12 –0 Add 1 to LSB = 1
2 6 -0 2’s complement = 10011110
2 3 –0
1 -1 1’s complement of -9810 = 100111012
2’s complement of -9810 = 100111102
b) -135
2 135 Binary value of 135 = 10000111
2 67 –1 1’s complement = 01111000
2 33 –1 Add 1 to LSB = 1
2 16 –1 2’s complement = 01111001
2 8 -0
2 4 –0 1’s complement of -13510 = 011110002
2 2 -0 2’s complement of -13510 = 011110012
1 -0
3. a) Add 11010102 + 1011012 b) Subtract 11010112 – 1110102
1101010+ 1101011-
101101 11 1010
10 0 1 0 1 1 1 01 1 0001
11010102 + 1011012 = 100101112 11010112 - 1110102 = 01100012
ADDITIONAL QUESTIONS
1. ‘0’ and ‘1’ that the Computer can understand is called
a) Machine language b) High-level language bit
c) Assembly language d) Query structure language
2. Binary numbers like 0 or 1 are called ________.
a) Byte b) Bit c) Nible d) Word
3. Nibble is a collection of ________ bits.
a) 2 b) 4 c) 8 d) 16
4. 1 Kilobyte represents 1024 i.e. _______ bytes.
a) 240 b) 230 c) 220 d) 210
5. Expansion of BCD is
a) Binary Coded Decoder b) Basic Coded Decimal
c) Binary Coded Decimal d) Beginners Coded Decimal
6. The ASCII value for blank space is ________
a) 32 b) 42 c) 48 d) 28

..12.. THAAI VIRUDHUNAGAR


– 2. NUMBER SYSTEMS _
7. Expansion of EBCDIC is
a) Extended Binary Coded Decimal Interchange Code
b) Extended Binary Coded Decimal Internet Code
c) Example Binary Coded Decimal Interchange Code
d) Extended Binary Coded Decimal Information Code
8. ISCII stands for
a) International Standard Code for Information Interchange
b) Indian Standard Code for Information Interchange
c) Indian School Code for Information Interchange
d) Indian Society Code for Information Interchange
9. The ASCII value of zero (0) is ________
a) 32 b) 42 c) 48 d) 28
10. The range of ASCII values for lower case alphabets is from
a) 97 to 122 b) 87 to 112 c) 65 to 90 d) 85 to 110
11. The range of ASCII values for the upper-case alphabets is
a) 97 to 122 b) 87 to 112 c) 65 to 90 d) 85 to 110
12. MSB is
a) Most Significant Byte b) Most Significant Bit
c) Most simple bit d) Most successful bit
13. LSB is
a) Least successful bit b) Linear significant bit
c) Least simple bit d) Least significant bit
14. What is byte?
A collection of 8 bits is called Byte. A byte is considered as the basic unit of measuring the
memory size in the computer.
15. What is word length?
➢ Word length refers to the number of bits processed by a Computer’s CPU.
➢ For example, a word length can have 8 bits, 16 bits, 32 bits and 64 bits (Present day
Computers use 32 bits or 64 bits)
16. Write about binary representation for signed numbers.
Computers can handle both positive (unsigned) and negative (signed) numbers. The
simplest method to represent negative binary numbers is called Signed Magnitude.
In signed magnitude method, the left most bit is Most Significant Bit (MSB), is called sign
bit or parity bit.
17. What is Unicode?
❖ This coding system is used in most of the modern computers. The popular coding scheme
after ASCII is Unicode.
❖ The Unicode was generated to handle all the coding system of Universal languages.
❖ This is 16-bit code and can handle 65536 characters.

..13.. THAAI VIRUDHUNAGAR


– 2. NUMBER SYSTEMS _
18. Tabulate the Binary Addition.
SUM
A B Carry Bit
(A + B)
0 0 0 -
0 1 1 -
1 0 1 -
1 1 0 1
19. Tabulate the Binary Subtraction.
Difference
A B Borrow
(A-B)
0 0 0 0
1 0 1 0
1 1 0 0
0 1 1 1
20. Convert the decimal number (65)10 into binary, octal and hexadecimal number.
2 65
2 32 –1
2 16 –0
2 8 –0
2 4 -0
2 2 –0
1 -0

Binary value of (65)10 = (1000001)2

8 65
8 8 –1
1 -0

Octal value of (65)10 = (101)8

16 65
4 -1

Hexadecimal value of (65)10 = (41)16

..14.. THAAI VIRUDHUNAGAR


2 PART - II : BOOLEAN ALGEBRA

SECTION – A
Choose the correct answer. 1 Mark
1. Which is a basic electronic circuit which operates on one or more signals?
(A) Boolean algebra (B) Gate
(C) Fundamental gates (D) Derived gates
2. Which gate is called as the logical inverter?
(A) AND (B) OR (C) NOT (D) XNOR
3. A + A = ?
(A) A (B) O (C ) 1 (D) A
4. NOR is a combination of ?
(A) NOT(OR) (B)NOT(AND) (C ) NOT(NOT) (D) NOT(NOR)
5. NAND is called as …… Gates
(A) Fundamental Gate (B) Derived Gate
(C ) Logical Gate (D) Universal gate
SECTION – B
Very Short Answers. 2 Marks
1. What is Boolean Algebra?
Boolean algebra is a mathematical discipline that is used for designing digital circuits in a
digital computer. It describes the relation between inputs and outputs of a digital circuit.
2. Write a short note on NAND Gate.
➢ The NAND is the combination of NOT and AND.
➢ It acts in the manner of the logical operation “AND” followed by inversion.
➢ The output of the NAND gate is 0 if and only if both the inputs are 1, otherwise the output
is 1.
The logic symbol of NAND gate is The truth table for NAND gate is
Input Output
A B C = (𝐴 . 𝐵)
0 0 1
The output of the NAND gate is
0 1 1
C = (𝐴 . 𝐵)
1 0 1
1 1 0
3. Draw the truth table for XOR gate.
Input Output
A B C=A⊕B
0 0 0
0 1 1
1 0 1
1 1 0

..15.. THAAI VIRUDHUNAGAR


– 2. BOOLEAN ALGEBRA_
4. Write the associative laws?
A + (B + C) = (A + B) + C
A . (B . C) = (A . B) . C
5. What are derived gates?
➢ The gates which are derived from the fundamental gates like AND, OR and NOT are called
derived gates.
➢ For example, NAND, NOR, XOR, XNOR are derived gates.
SECTION – C
Short Answers. 3 Marks
1. Write the truth table of fundamental gates.
AND OR NOT
A B A.B A B A+B A 𝐴̅
0 0 0 0 0 0 0 1
0 1 0 0 1 1 1 0
1 0 0 1 0 1
1 1 1 1 1 1
2. Write a short note on XNOR gate.
➢ The XNOR (exclusive - NOR) gate is a combination XOR gate followed by an inverter.
➢ Its output is "true" if the inputs are the same, and "false" if the inputs are different.
Truth table
Gate Symbole
A B ̅̅̅̅̅̅̅̅
𝐴⊕𝐵

0 0 0
XNOR 0 1 0
1 0 0
1 1 1
3. Reason out why the NAND an NOR are called universal gates?
NAND and NOR gates are called Universal gates, because the fundamental logic gates
can be realized through them.
4. Give the truth table of XOR gate. 5. Write the De Morgan’s law.
❖ (𝐴 + 𝐵) = 𝐴 . 𝐵
Input Output
❖ (𝐴 . 𝐵) = 𝐴 + 𝐵
A B C = A⊕B
0 0 0
0 1 1
1 0 1
1 1 0

..16.. THAAI VIRUDHUNAGAR


– 2. BOOLEAN ALGEBRA_
SECTION – D
Explain in detail. 5 Marks
1. Explain the fundamental gates with expression and truth table.
Fundamental gates are AND, OR, NOT.
❖ AND:
✓ The output will be 1 if and only if both inputs are 1; otherwise, the output is 0
Truth table
Gate Equation Symbol
A B A.B
0 0 0
0 1 0
AND A.B
1 0 0
1 1 1
❖ OR:
✓ The output will be 1 if and only if one or both inputs are 1; otherwise, the output is 0.
Truth table
Gate Equation Symbol
A B A+B
0 0 0
0 1 1
AND A+B
1 0 1
1 1 1
❖ NOT:
✓ The NOT gate, called a logical inverter, has only one input.
✓ It reverses the logical state.
✓ The output is always the complement of the input.
Truth table
Gate Equation Symbol
A 𝐴̅
NOT 𝐴̅ 0 1
1 0
2. How AND and OR can be realized using NAND and NOR gate.
➢ Implementing NAND gate through the AND & OR gates.

..17.. THAAI VIRUDHUNAGAR


– 2. BOOLEAN ALGEBRA_
➢ Implementing NOR gate through the AND & OR gates.

3. Explain the Derived gates with expression and truth table.


NAND, NOR, XOR, XNOR are derived gates.
❖ NAND:
✓ The NAND is the combination of NOT and AND.
✓ It acts in the manner of the logical operation “AND” followed by inversion.
✓ The output of the NAND gate is 0 if and only if both the inputs are 1, otherwise the
output is 1.
Truth table
Gate Equation Symbol
A B ̅̅̅̅̅̅
A .B
0 0 1
0 1 1
NAND ̅̅̅̅̅̅
A .B
1 0 1
1 1 0
❖ NOR:
✓ The NOR is the combination of NOT and OR.
✓ The NOR gate circuit is an OR gate followed by an inverter.
✓ Its output is "true (1)" if both inputs are "false (0)" Otherwise, the output is "false(0)".
Truth table
Gate Equation Symbol
A B ̅̅̅̅̅̅̅
A+B
0 0 1
0 1 1
NAND ̅̅̅̅̅̅̅
A +B
1 0 1
1 1 0
❖ XOR:
✓ The XOR (exclusive - OR) gate acts in the same way as the logical "either/or."
✓ If both inputs are different, the output is 1.
✓ If both inputs are same, the output is 0.
Truth table
Gate Equation Symbol
A B A ⊕B
0 0 0
0 1 1
NAND A⊕B
1 0 1
1 1 0
..18.. THAAI VIRUDHUNAGAR
– 2. BOOLEAN ALGEBRA_
❖ XNOR:
✓ The XNOR (exclusive - NOR) gate is a combination XOR gate followed by an inverter.
✓ Its output is "true (1)" if the inputs are the same, and "false (0)" if the inputs are
different.
Truth table
Gate Equation Symbol
A B ̅̅̅̅̅̅̅̅
A⊕B
̅̅̅̅̅̅̅̅
0 0 1
A⊕B
0 1 0
NAND (OR)
1 0 0
A⊙B
1 1 1
ADDITIONAL QUESTIONS
1. who proposed the basic principles of this algebra?
a) Boole George b) George Boole c) Robert Boole d) Boole Robert
2. Logical constants
a) 0, 1 b) -1, 0 c) -1, 1 d) -1, -2
3. In logical constants, True is represented by
a) A b) 0 c) 1 d) 𝐴
4. In logical constants, False is represented by
a) A b) 0 c) 1 d) 𝐴
5. A+0=?
a) A b) 0 c) 1 d) 𝐴
6. A.1=?
a) A b) 0 c) 1 d) 𝐴
7. A . 𝐴 = ?
a) A b) 0 c) 1 d) 𝐴
8. A + 𝐴 = ?
a) A c) 0 c) 1 d) 𝐴
9. The sign of the AND logical operation is
a) (.) dot b) (+) plus c) Over bar d) (-) minus
10. The sign of the OR logical operation is
a) (.) dot b) (+) plus c) Over bar d) (-) minus
11. The sign of the NOT logical operation is
a) (.) dot b) (+) plus c) Over bar d) (-) minus
12. What is truth table?
A truth table represents all the possible values of logical variable or statements along with
all the possible results of given combination of truth values.
13. Write the Commutative law. 14. Write the Associative law.
A+B=B+A A + (B + C) = (A + B) + C
A.B=B.A A . (B . C) = (A . B) . C
15. Write the Distributive law.
A . (B + C) = A . B + A . C
A + (B . C) = (A + B) . (A + C)

..19.. THAAI VIRUDHUNAGAR


3 COMPUTER ORGANISATION

SECTION – A
Choose the correct answer. 1 Mark
1. Which of the following is said to be the brain of a computer?
(a) Input devices (b) Output devices
(c) Memory device (d) Microprocessor
2. Which of the following is not the part of a microprocessor unit?
(a) ALU (b) Control unit (c) Cache memory (d) register
3. How many bits constitute a word?
(a) 8 (b) 16 (c) 32 (d) determined by the processor used
4. Which of the following device identifies the location when address is placed in the memory
address register?
(a) Locator (b) encoder (c) decoder (d) multiplexer
5. Which of the following is a CISC processor?
(a) Intel P6 (b) AMD K6 (c) Pentium III (d) Pentium IV
6. Which is the fastest memory?
a) Hard disk (b) Main memory (c) Cache memory (d) Blue-Ray disc
7. How many memory locations are identified by a processor with 8 bits address bus at a time?
(a) 28 (b) 1024 (c) 256 (d) 8000
8. What is the capacity of 12cm diameter DVD with single sided and single layer?
(a) 4.7 GB (b) 5.5 GB (c) 7.8GB (d) 2.2 GB
9. What is the smallest size of data represented in a CD
(a) blocks (b) sectors (c) pits (d) tracks
10. Display devices are connected to the computer through.
(a) USB port (b) Ps/2 port
(c) SCSI port (d) VGA connector
SECTION – B
Very Short Answers. 2 Marks
1. What are the parameters which influence the characteristics of a microprocessor?
❖ Clock speed ❖ Instruction set ❖ Word size
2. What is an instruction?
A command which is given to a computer to perform an operation on data is called an
instruction.
3. What is a program counter?
The Program Counter (PC) is a special register in the CPU which always keeps the
address of the next instruction to be executed.
4. What is HDMI?
High-Definition Multimedia Interface is an audio/video interface which transfers the
uncompressed video and audio data from a video controller, to a compatible computer
monitor, LCD projector, digital television etc.

..20.. THAAI VIRUDHUNAGAR


– 3. COMPUTER ORGANISATION_
5. Which source is used to erase the content of a EPROM?
Ultraviolet rays are used to erase the content of a EPROM.
SECTION-C
Short Answers. 3 Marks
1. Differentiate Computer Organisation from Computer Architecture.
❖ Computer organisation deals with the hardware components of a computer system. It is
concerned with how the various components of computer hardware operate and how
they are interconnected to implement an architectural specification.
❖ Computer architecture deals with the engineering considerations involved in designing a
computer.
2. Classify the microprocessor based on the size of the data.
◆ 8-bit microprocessor ◆ 16-bit microprocessor
◆ 32-bit microprocessor ◆ 64-bit microprocessor
3. Write down the classifications of microprocessors based on the instruction set.
❖ Reduced Instruction Set Computers (RISC)
❖ Complex Instruction Set Computers (CISC)
4. Differentiate PROM and EPROM.
PROM EPROM
Data can be written only once and cannot The ultraviolet light clears its contents,
be erased. making it possible to reprogram the memory.
5. Write down the interfaces and ports available in a computer.
❖ Serial Port ❖ Audio Plugs
❖ Parallel Port ❖ PS/2 Port
❖ USB Ports ❖ SCSI Port
❖ VGA Connector ❖ HDMI Port
6. Differentiate CD and DVD.
CD DVD
Compact Disc (CD) is made from 1.2 A DVD (Digital Versatile Disc or Digital Video
millimetres thick, polycarbonate plastic Disc) is an optical disc capable of storing up to
material. The capacity of an ordinary CD- 4.7 GB of data, more than six times what a CD
ROM is 700M. can hold
A thin layer of aluminium or gold is applied Double-layered sides are usually gold-
to the surface. coloured, while single-layered sides are
usually silver-coloured, like a CD
7. How will you differentiate a flash memory and an EEPROM?
Flash Memory EEPROM
Flash memory is an electronic non- EEPROM is a special type of PROM that can
volatile memory that can be electrically be erased by exposing it to an electrical
erased and reprogrammed. They are charge.
either EEPROM or EPROM.
Flash memory offers fast access times. EEPROM is slower in performance.
The capacity of the flash memories varies The capacity of the memory is in MB.
from 1 GB to 2 TB.

..21.. THAAI VIRUDHUNAGAR


– 3. COMPUTER ORGANISATION_
SECTION – D
Explain in detail. 5 Marks
1. Explain the characteristics of a microprocessor.
A Microprocessor’s performance depends on the clock speed, instruction set and word
size.
❖ Clock speed:
• Every microprocessor has an internal clock that regulates the speed at which it
executes instructions.
• The speed at which the microprocessor executes instructions is called the clock
speed.
• Clock speed is measured in MHz (Mega Hertz) or in GHz (Giga Hertz).
❖ Instruction Set:
• A command which is given to a computer to perform an operation on data is called
an instruction.
• Basic set of machine level instructions that a microprocessor is designed to execute
is called as an instruction set.
• This instruction set carries out the following types of operations:
▪ Data transfer ▪ Control flow
▪ Arithmetic operations ▪ Input/output
▪ Logical operations
❖ Word Size:
• The number of bits that can be processed by a processor in a single instruction is
called its word size.
• Word size determines the amount of RAM that can be accessed by a
microprocessor.
2. How the read and write operations are performed by a processor? Explain.
❖ The word in the RAM has the same size (no. of bits) as the Memory Data Register (MDR).
If the processor is an 8-bit processor like Intel 8085, its MDR and the word in the RAM
both have 8 bits.
❖ The read operation transfers the data(bits) from word to Memory Data Register.
❖ The write operation transfers the data(bits) from Memory Data Register to word.
3. Arrange the memory devices in ascending order based on the access time.
Different memory devices are arranged according to the capacity, speed and cost as
shown below:

..22.. THAAI VIRUDHUNAGAR


– 3. COMPUTER ORGANISATION_
4. Explain the types of ROM.
❖ Read Only Memory (ROM):
➢ Read Only Memory refers to special memory in a computer with pre-recorded data at
manufacturing time which cannot be modified.
➢ The stored programs that start the computer and perform diagnostics are available in
ROMs. ROM stores critical programs such as the program that boots the computer.
➢ Once the data has been written onto a ROM chip, it cannot be modified or removed
and can only be read.
➢ ROM retains its contents even when the computer is turned off. So, ROM is called as
a non-volatile memory.
❖ Programmable Read Only Memory (PROM):
➢ Programmable read only memory is also a non-volatile memory on which data can be
written only once.
➢ Once a program has been written onto a PROM, it remains there forever.
➢ PROM is manufactured as a blank memory, whereas a ROM is programmed during the
manufacturing process itself.
➢ PROM programmer or a PROM burner is used to write data to a PROM chip.
❖ Erasable Programmable Read Only Memory (EPROM):
➢ Erasable Programmable Read Only Memory is a special type of memory which serves
as a PROM, but the content can be erased using ultraviolet rays.
➢ The ultraviolet light clears its contents, making it possible to reprogram the memory.
❖ Electrically Erasable Programmable Read Only Memory (EEPROM):
➢ Electrically Erasable Programmable Read Only Memory is a special type of PROM that
can be erased by exposing it to an electrical charge.
➢ EEPROM retains its contents even when the power is turned off.
➢ It is slower in performance.
ADDITIONAL QUESTIONS
1. The first general purpose microprocessor ________ was developed by Intel Inc .
a) 1011 b) 4004 c) 0386 d) 0486
2. RISC stands for
a) Reduced Instruction Set Computers b) Reduced Information Set Computers
c) Random Instruction Set Computers d) Reduced Informal System Computers
3. CISC stands for
a) Complete Instruction Set Computers b) Complex Instruction Set Calculators
c) Complex Instruction Set Computers d) Complete Instruction Set Calculators
4. Which of the following is not a RISC computer?
a) Pentium IV b) Intel P6 c) AMD K6 d) Pentium II
5. What is bus?
A bus is a collection of wires used for communication between the internal components
of a computer.

..23.. THAAI VIRUDHUNAGAR


– 3. COMPUTER ORGANISATION_
6. Write about RAM.
➢ The main memory is otherwise called as Random Access Memory.
➢ This is available in computers in the form of Integrated Circuits (ICs). It is the place in a
computer where the Operating System, Application Programs and the data in current use
are kept temporarily so that they can be accessed by the computer’s processor.
➢ The smallest unit of information that can be stored in the memory is called as a bit. The
memory can be accessed by a collection of 8 bits which is called as a byte. RAM is a
➢ RAM is a volatile memory. As soon as the power is turned off, whatever data that resides
in RAM is lost.
7. What are Pits and Lands?
➢ CD data is represented as tiny indentations known as "pits",
➢ The areas between pits are known as "lands".

..24.. THAAI VIRUDHUNAGAR


THEORETICAL CONCEPTS OF
4 OPERATING SYSTEM
SECTION – A
Choose the correct answer. 1 Mark
1. Operating system is a
A)Application Software B) Hardware C) System Software D) Component
2. Identify the usage of Operating Systems
A) Easy interaction between the human and computer
B) Controlling input & output Devices
C) Managing use of main memory
D) All the above
3. Which of the following is not a function of an Operating System?
A) Process Management B) Memory Management
C) Security management D) Complier
4. Environment Which of the following OS is a Commercially licensed Operating system?
A) Windows B) FEDORA C) UBUNTU D) REDHAT
5. Which of the following Operating systems support Mobile Devices?
A) Windows 7 B) Linux C) BOSS D) iOS
6. File Management manages
A) Files B) Folders C) Directory systems D) All the Above
7. Operating System Interactive provides
A) Graphics User Interface (GUI) B) Data Distribution
C) Security Management D) Real Time Processing
8. An example for single task operating system is
A) Linux B) Windows C) MS-DOS D) Unix
9. The File management system used by Linux is
A) ext2 B) NTFS C) FAT D) NFTS
SECTION-B
Very Short Answers. 2 Marks
1. List out any two uses of Operating System?
❖ The main use of Operating System is to ensure that a computer can be used to extract
what the user wants it do.
❖ Easy interaction between the users and computers.
2. What is multi-user Operating system?
➢ It is used in computers and laptops that allow same data and applications to be accessed
by multiple users at the same time. The users can also communicate with each other.
➢ Windows, Linux and UNIX are examples for multi-user Operating System.
3. What is a GUI?
The GUI is a window-based system with a pointing device to direct I/O, choose from
menus, make selections and a keyboard to enter text. Its vibrant colours attract the user very
easily.

..25.. THAAI VIRUDHUNAGAR


– 4. OPERATING SYSTEM
4. What are the security management features available in Operating System?
The Operating System provides three levels of securities to the user end to protect user’s
legitimate data from hackers. They are
1) File access level - Permissions can either be granted by the creator of the file or by the
administrator of the system.
2) System level - System level security is offered by the password in a multi-user
environment.
3) Network level - People from all over the world try to provide such a security.
5. What is multi-processing?
It has two or more processors for a single running process (job). Processing takes place in
parallel is known as parallel processing. Since the execution takes place in parallel, this feature
is used for high-speed execution which increases the power of computing.
6. What are the different Operating Systems used in computer?
❖ Microsoft Windows ❖ Linux ❖ Unix
❖ Mac OS ❖ MS DOS
✓ Depending on the processing capabilities, operating systems can be classified into single-
user operating systems and multi-user operating systems.
SECTION-C
Short Answers. 3 Marks
1) What are the advantages and disadvantages of Time-sharing features?
Advantages:
➢ Performs multiple tasks simultaneously.
➢ Many applications are run at regular intervals without interruption.
Disadvantages:
➢ Requires a better operating system as it consumes more resources.
➢ Sometimes the operating system may fail due to too many users and multiple applications
running at the same time.
2) List out the key features of Operating system.
❖ User Interface (UI) ❖ File Management
❖ Memory Management ❖ Fault Tolerance
❖ Process management ❖ Security Management
3) Write a note on Multiprocessing.
This is a one of the features of Operating System. It has two or more processors for a single
running process (job). Processing takes place in parallel is known as parallel processing. Since
the execution takes place in parallel, this feature is used for highspeed execution which
increases the power of computing.
SECTION – D
Explain in detail. 5 Marks
1) Explain the concept of a Distributed Operating System along with its advantages.
➢ The Distributed Operating System is used to access shared data and files that reside in any
machine around the world using internet/intranet.
..26.. THAAI VIRUDHUNAGAR
– 4. OPERATING SYSTEM
➢ The users can access as if it is available on their own computer.
➢ Advantages:
 A user at one location can make use of all the resources available at another location
over the network.
 Many computer resources can be added easily in the network.
 Improves the interaction with the customers and clients.
 Reduces the load on the host computer.
2) List out the points to be noted while creating a user interface for an Operating system.
1. The user interface should enable the user to retain this expertise for a longer time.
2. The user interface should also satisfy the customer based on their needs.
3. The user interface should save user’s precious time.
4. The ultimate aim of any product is to satisfy the customer. The User Interface is also to
satisfy the customer.
5. The user interface should reduce number of errors committed by the user
3) Explain the process management algorithms in Operating System.
1. FIFO (First In First Out) Scheduling:
❖ This algorithm is based on queuing technique.
❖ Technically, the process that enters the queue first is executed first by the CPU,
followed by the next and so on. The processes are executed in the order of the queue
(row).
2. SJF (Shortest Job First) Scheduling:
❖ This algorithm works based on the size of the job being executed by the CPU.
❖ Consider two jobs A and B.
1) A = 6 kilo bytes
2) B = 9 kilo bytes First the job “A” will be assigned and then job “B” gets its turn.
3. Round Robin Scheduling:
❖ It is is designed especially for time sharing systems.
❖ Jobs (processes) are assigned and processor time in a circular method.
For example, take three jobs A, B, C. First the job A is assigned to CPU then job B and
job C and then again A, B and C and so on.
4. Based On Priority:
❖ The given job (process) is assigned based on a Priority.
❖ The job which has higher priority is more important than other jobs.
❖ Take two jobs A and B. Let the priority of A be 5 and priority B be 7. Job B is assigned
to the processor before job A.
ADDITIONAL QUESTIONS
1. _________ is a set of instructions used to perform a specific task in a computer.
a) Hardware b) Software c) Program d) Statements
2. MS Word and VLC Player are
a) Application software b) System software c) Databases d) Hardware

..27.. THAAI VIRUDHUNAGAR


– 4. OPERATING SYSTEM
3. It is a type of computer program that is designed to run the computer’s hardware and
application programs.
a) Application software b) System software c) Databases d) Hardware
4. A compiler belongs to which of the following software?
a) Application software b) System software c) Databases d) Hardware
5. It is a system software which serves as an interface between a user and a computer.
a) Application software b) Compiler c) Operating system d) Hardware
6. Which operating system is most commonly used in mobile devices?
a) Windows b) UNIX c) Linux d) Android
7. Expansion of GUI
a) Graphical User Internet b) Graphical Used Interconnection
c) Group User Interface d) Graphical User Interface
8. Write some important uses of mechanical system.
❖ The main use of Operating System is to ensure that a computer can be used to extract
what the user wants it do.
❖ Easy interaction between the users and computers.
❖ Starting computer operation automatically when power is turned on (Booting).
❖ Controlling Input and Output Devices
❖ Manage the utilisation of main memory.
❖ Providing security to user programs.
9. What is single user operating system?
An operating system allows only a single user to perform a task at a time. It is called as a
Single user and single Task operating system. MS-DOS is an example.

..28.. THAAI VIRUDHUNAGAR


WORKING WITH WINDOWS
5 OPERATING SYSTEM
SECTION – A
Choose the correct answer. 1 Mark
1) From the options given below, choose the operations managed by the operating system.
(a) Memory (b) Processes
(c) Disks and I/O device (d) all of the above
2) Which is the default folder for many Windows Applications to save your file?
(a) My Document (b) My Pictures
(c) Documents and Settings (d) My Computer
3) Under which of the following OS, the option Shift + Delete will permanently delete a file or
folder?
(a) Windows 7 (b) MS-DOS (c) Linux (d) Android OS
4) What is the meaning of “Hibernate” in Windows XP/Windows 7?
(a) Restart the Computer in safe mode
(b) Restart the Computer in hibernate mode
(c) Shutdown the Computer terminating all the running applications
(d) Shutdown the Computer without closing the running applications
5) The shortcut key used to rename a file in windows
(a) F2 (b) F4 (c) F5 (d) F6
SECTION-B
Very Short Answers
1. What is known as Multitasking?
Multiple applications can execute simultaneously in Windows, and this is known as
“Multitasking”.
2. What are called standard icons?
The icons which are available on desktop by default while installing Windows OS are called
standard icons. The standard icons available in all Windows OS are My Computer, Documents
and Recycle Bin.
3. Differentiate Files and Folders.
Files Folders
All types of information are stored in Folders are containers of files that is used to
the form of files in the computer. organize files.
4. Differentiate Save and save As option.
Save Save As
Save command is used to save a file for Save As command is used to save a saved file
the first time. with a different name.
5. How will you Rename a File?
1. Select the File you wish to Rename. 2. Click File→ Rename.
3. Type in the new name. 4. To finalise the renaming operation, press Enter

..29.. THAAI VIRUDHUNAGAR


– 5. WORKING WITH WINDOWS
SECTION-C
Short Answers. 3 Marks
1. What are the functions of Windows Operating system?
❖ Access applications on the computer (word processing, games, spread sheets, calculators
and so on).
❖ Load any new program on the computer.
❖ Manage hardware such as printers, scanners, mouse, digital cameras etc.,
❖ File management activities (For example creating, modifying, saving, deleting files and
folders).
❖ Change computer settings such as colour scheme, screen savers of your monitor, etc.
2. Write a note on Recycle bin.
➢ Recycle bin is a special folder to keep the files or folders deleted by the user, which means
you still have an opportunity to recover them.
➢ The user cannot access the files or folders available in the Recycle bin without restoring it.
3. Write a note on the elements of a window.
❖ Title Bar - The title bar will display the name of the application and the name of the
document opened.
❖ Menu Bar - The menu bar is seen under the title bar.
❖ The Workspace - The workspace is the area in the document window to enter or type
the text of your document.
❖ Scroll bars - The scroll bars are used to scroll the workspace horizontally or vertically.
❖ Corners and borders - The corners and borders of the window helps to drag and resize
the windows.
4. Write the two ways to create a new folder.
There are two ways in which you can create a new folder:
Method I:
Step 1: Open Computer Icon.
Step 2: Open any drive where you want to create a new folder.
Step 3: Click on File → New → Folder.
Step 4: A new folder is created with the default name “New folder”.
Step 5: Type in the folder name and press Enter key.
Method II:
Step 1: In the Desktop, right click → New → Folder.
Step 2: A Folder appears with the default name “New folder” and it will be highlighted.
Step 3: Type the name you want and press Enter Key.
Step 4: The name of the folder will change.
5. Differentiate copy and move.
Move Copy
Moving a file or folder from source to a Copying is the process of moving a copy of a
new location is called cutting. file or folder to a new location.

..30.. THAAI VIRUDHUNAGAR


– 5. WORKING WITH WINDOWS
Deletes the source files. Source files will not be deleted.
Commands: Commands:
Edit → Cut (or) Ctrl + X Edit → Copy (or) Ctrl + C
Edit → Paste (or) Ctrl + V Edit → Paste (or) Ctrl + V
SECTION – D
Explain in detail. 5 Marks
1. Explain the versions of Windows Operating System.
Versions Year Specific features
WINDOWS 1.X 1985 • Introduction of GUI in 16 - bit processor.
WINDOWS 2.X 1987 • Supports to minimize or maximize windows.
• Control panel feature was introduced.
WINDOWS 3.X 1992 • Introduced the concept of multitasking.
• Supported 256 colours which brought a more modern,
colourful look to the interface.
WINDOWS NT 1993 • Designed to act as servers in network.
WINDOWS 95 1995 • Introduced Start button, the taskbar, Windows Explorer
and Start menu.
• Introduced 32 - bit processor and focused more on
multitasking.
WINDOWS 98 1998 • Integration of the Web browser (Internet Explorer) with
the Operating System.
• DOS gaming began to disappear as Windows based
games improved.
WINDOWS Me 2000 • It introduced automated system diagnostics and
recovery tools.
WINDOWS 2000 • Served as an Operating System for business desktop and
2000 laptop systems.
WINDOWS XP 2001 • Introduced 64-bit Processor.
WINDOWS Vista 2006 • Updated the look and feel of Windows.

WINDOWS 7 2009 • Booting time was improved.


• Introduced new user interfaces like Aero Peek, pinning
programs to taskbar, handwriting recognition etc. and
Internet Explorer 8
WINDOWS 8 2012 • Windows 8 is faster than previous versions of Windows.
• Start button was removed.
• Windows 8 takes better advantage of multi-core
processing, solid state drives (SSD), touch screens and
other alternate input methods.
WINDOWS 10 2015 • Start Button was added again.
• Multiple desktops.

..31.. THAAI VIRUDHUNAGAR


– 5. WORKING WITH WINDOWS
2. Explain the different ways of finding a file or Folder.
To find a file or folder:
1. Click the Start button, the search box appears at the bottom of the start menu.
2. Type the name of the file or the folder you want to search.
3. The files or the folders with the specified names will appear, if you click that file, it will
directly open that file or the folder.
4. There is another option called “See more results” which appears above the search box.
5. If you click it, it will lead you to a Search Results dialog box where you can click and open
that file or the folder.
Searching Files or folders using Computer icon:
1. Click Computer Icon from desktop or from Start menu.
2. The computer disk drive screen will appear and at the top right corner of that screen,
there is a search box option.
3. Type the name of the file or the folder you want to search.
4. Just click and open that file or the folder
3. Write the procedure to create shortcut in Windows OS.
➢ Select the file or folder that you wish to have as a shortcut on the Desktop.
➢ Right click on the file or folder.
➢ Select Send to from the shortcut menu, then select Desktop (create shortcut) from the
sub-menu.
➢ A shortcut for the file or folder will now appear on your desktop and you can open it from
the desktop in the same way as any other icon.
ADDITIONAL QUESTIONS
1. Which version of Windows was introduced as a mouse input device?
a) Windows 1.x b) Windows 2.x c) Windows 3.x d) Windows 95
2. Which version of Windows was introduced in Control Panel feature?
a) Windows 1.x b) Windows 2.x c) Windows 3.x d) Windows 95
3. Which version of Windows was introduced the Concepts of Multitasking?
a) Windows 1.x b) Windows 2.x c) Windows 3.x d) Windows 95
4. Windows version designed like a server on the network.
a) Windows 95 b) Windows NT c) Windows 98 d) Windows XP
5. In which windows version the Start button, Taskbar, Windows Explorer and Start menu were
introduced?
a) Windows 95 b) Windows NT c) Windows 98 d) Windows XP
6. Windows XP was introduced in the year
a) 1987 b) 1995 c) 2001 d) 2009
7. The opening screen of Windows is called
a) Work place b) Desktop c) Icon d) Window
8. The horizontal bar below the desktop is called _________.
a) Taskbar b) Scroll bar c) Title bar d) Menu bar
9. Which consist of volume control, network, date and time etc.?
a) Scroll bar b) Control Panel c) System tray d) Settings
..32.. THAAI VIRUDHUNAGAR
– 5. WORKING WITH WINDOWS
10. In Windows XP and Vista versions, the System icon is called as
a) My computer b) This PC c) This computer d) My PC
11. In Windows 8 and Windows 10 versions, the System icon is called as
a) My computer b) This PC c) This computer d) My PC
12. Match:
a. 16-bit - (i) Windows 95
b. 32-bit - (ii) Windows XP
c. 64-bit - (iii) Windows 8
d. Start button was removed - (iv) Windows 1.x
a) (i), (ii), (iii), (iv) b) (iv), (iii), (ii), (i) c) (iv), (i), (ii), (iii) d) (ii),(iv),(i),(iii)
13. What is icon?
Icon is a graphic symbol representing the window elements like files, folders, shortcuts
etc., Icons play a vital role in GUI based applications.
14. Explain the mouse actions.
Action Reaction
Point to an item Move the mouse pointer over the item.
Point to the item on the screen, press and release the left
Click
mouse button.
Point to the item on the screen, press and release the right
Right click mouse button. Clicking the right mouse button displays a pop
up menu with various options.
Point to the item on the screen, quickly press twice the left
Double click
mouse button.
Point to an item then hold the left mouse button as you move
Drag and drop the pointer press and you have reached the desired position,
release the mouse button.
15. What is window? Explain its two types.
Window is a typical rectangular area in an application or a document. Application window
and document windows are the two types of windows.
❖ Application Window:
➢ When you open any application, you will find two Windows on the screen. The larger
Window is called the Application Window.
➢ It is an area on a computer screen with defined boundaries, and within which
information is displayed.
➢ An Application Window contains an open application i.e. current application such as
Word or Paint.
❖ Document Window:
➢ The smaller window, which is inside the Application Window, is called the Document
window.
➢ A document window is a section of the screen used to display the contents of a
document.

..33.. THAAI VIRUDHUNAGAR


6 SPECIFICATION AND ABSTRACTION

SECTION – A
Choose the correct answer. 1 Mark
1. Which of the following activities is algorithmic in nature?
(a) Assemble a bicycle. (b) Describe a bicycle.
(c) Label the parts of a bicycle. (d) Explain how a bicycle works.
2. Which of the following activities is not algorithmic in nature?
(a) Multiply two numbers. (b) Walk in the park.
(c) Draw a kolam. (d) Swapping of two numbers.
3. Omitting details inessential to the task and representing only the essential features of the
task is known as
(a) specification (b) abstraction
(c) composition (d) decomposition
4. Stating the input property and the input-output relation a problem is known
(a) specification (b) statement (c) algorithm (d) definition
5. Ensuring the input-output relation is
(a) the responsibility of the algorithm and the right of the user.
(b) the responsibility of the user and the right of the algorithm.
(c) the responsibility of the algorithm but not the right of the user.
(d) the responsibility of both the user and the algorithm.
6. If i = 5 before the assignment i := i-1 after the assignment, the value of i i
(a) 5 (b) 4 (c) 3 (d) 2
7. If 0 < i before the assignment i := i-1 after the assignment, we can conclude that
(a) 0 < i (b) 0 ≤ i (c) i=0 (d) 0>=i
SECTION-B
Very Short Answers. 2 Marks
1. Define an algorithm.
An algorithm is a sequence of instructions to accomplish a task or solve a problem.
2. Distinguish between an algorithm and a process.
➢ An algorithm is a sequence of instructions to accomplish a task or solve a problem.
➢ Processes are generated by executing algorithms. When the instructions are executed, a
process evolves, which accomplishes the intended task or solves the given problem.
3. Initially,
farmer, goat, grass, wolf = L, L, L, L
and the farmer crosses the river with goat. Model the action with an assignment
statement.
❖ Farmer, Goat, Grass, Wolf := L, L, L, L
The action taken to cross the river with the farmer goats along with an assignment
statement as follows
❖ Farmer, Goat := R, R

..34.. THAAI VIRUDHUNAGAR


– 6. SPECIFICATION AND ABSTRACTION
4. Specify a function to find the minimum of two numbers.
--minimum(A, B)
--input: A, B
--output:
✓ If A < B then the output is A
✓ Otherwise, the output is B
5. If √2 = 1.414, and the square_root() function returns -1.414, does it violate the
following specification?
-- square_root (x)
-- inputs: x is a real number , x ≥ 0
-- outputs: y is a real number such that y2=x
Yes. It violates the specification. The square root of a number is a positive number. Hence the
output will not be negative.
SECTION - C
Short Answers. 3 Marks
1. When do you say that a problem is algorithmic in nature?
We usually say that a problem is algorithmic in nature when its solution involves the
construction of an algorithm. Some types of problems can be immediately recognized as
algorithmic.
Example: Goat, grass and wolf problem:
2. What is the format of the specification of an algorithm?
The goal of the algorithm is to establish the relation between the input and the desired
output.
1. algorithm_name (inputs)
2. -- inputs : Input Properties
3. -- outputs: Output properties
3. What is abstraction?
❖ Abstraction is the process of hiding or ignoring the details irrelevant to the task so as to
model a problem only by its essential features.
❖ For example, the map-maker picks out the details that we need to know.
4. How is state represented in algorithms?
❖ State of a process is abstracted by a set of variables in the algorithm.
❖ The state of a process can be represented by a set of variables in an algorithm.
❖ The state at any point of execution is simply the values of the variables at that point. As
the values of the variables are changed, the state changes.
5. What is the form and meaning of assignment statement?
Assignment statement is used to store a value in a variable.
General form:
variable := value / expression
✓ The value or the result of the expression on the right side is stored in the variable on
the left side.
..35.. THAAI VIRUDHUNAGAR
– 6. SPECIFICATION AND ABSTRACTION
Example:
(i) The assignment m := 2 stores value 2 in variable m
(ii) m := m + 3 evaluates the expression m + 3 and stores the result in the variable m.
6. What is the difference between assignment operator and equality operator?
Assignment operator Equality operator
= is assignment operator. == is an equality operator.
This will store a value within the variable. It compares the operands on the right and
Example: left sides and returns True if equal and False
a = 100 if not.
Example:
a == b
SECTION – D
Explain in detail. 5 Marks
1. Write the specification of an algorithm hypotenuse whose inputs are the lengths of the
two shorter sides of a right-angled triangle, and the output is the length of the third
side.
Hypotunes (A, B)
-- inputs: A, B are integers and A>0 and B>0
-- output : C ia an integer, C2 = A2 + B2
Input A, B
C := A*A + B*B
Output C
2. Suppose you want to solve the quadratic equation ax2 + bx + c = 0 by an algorithm.
quadratic_solve (a, b, c)
--inputs : ?
--outputs: ?
You intend to use the formula and you are prepared to handle only real number roots.
Write a suitable specification.
−𝑏 ± √𝑏 2 − 4𝑎𝑐
𝑥=
2𝑎
quadratic_solve (a, b, c)
-- inputs : a, b, c are integers and a>0, b>0, c>0
-- outputs: x1 and x2 are integers and calculating the value of x1, x2 as follows
−𝑏 + √𝑏 2 − 4𝑎𝑐 −𝑏 − √𝑏 2 − 4𝑎𝑐
𝑥1 = , 𝑥2 =
2𝑎 2𝑎
Input a, b, c
d := sqrt ( b * b – 4 * a * c ) ; b2 - 4ac > 0
x1 := (-b + d) / (2 * a)
x2 := (-b – d) / (2 * a)
Output x1, x2

..36.. THAAI VIRUDHUNAGAR


– 6. SPECIFICATION AND ABSTRACTION
3. Exchange the contents: Given two glasses marked A and B. Glass A is full of apple
drink and glass B is full of grape drink. For exchanging the contents of glasses A and
B, represent the state by suitable variables, and write the specification of the algorithm.
Interchange ( A, B )
-- inputs: A, B ; A: apple drink, B: grape drink
-- output: A, B ; A: grape drink, B: apple drink
Input A, B
T := A
A := B
B := T
Output A, B
ADDITIONAL QUESTIONS
1. In our algorithmic notation, we use _________ to start a comment line.
a) double dashes (--) b) double underscore (__)
c) single dash (-) b) single underscore (_)
2. What are building blocks of an algorithm?
❖ Data ❖ Variables
❖ Control flow ❖ Functions
3. What is Control flow? Explain the three main control flow statements.
After executing a statement, the next statement to be executed need not be the next
statement in the algorithm. The statement to be executed next may depend on the state of
the process. Thus, the order in which the statements are executed may differ from the order
in which they are written in the algorithm. This order of execution of statements is known as
the control flow.
There are three important control flow statements to alter the control flow depending on
the state.
➢ In sequential control flow, a sequence of statements is executed one after another in
the same order as they are written.
➢ In alternative control flow, a condition of the state is tested and if the condition is true,
one statement is executed; if the condition is false, an alternative statement is
executed.
➢ In iterative control flow, a condition of the state is tested and if the condition is true,
a statement is executed. The two steps of testing the condition and executing the
statement are repeated until the condition becomes false.
4. Explain techniques for designing algorithms.
1. Specification:
The first step in problem solving is to state the problem precisely. The specification
must also state the properties of the given input and the relation between the input and
the output.
2. Abstraction:
Ignoring or hiding unnecessary details and modelling an entity only by its essential
properties is known as abstraction.
..37.. THAAI VIRUDHUNAGAR
– 6. SPECIFICATION AND ABSTRACTION
3. Composition:
An algorithm is composed of assignment and control flow statements. A control flow
statement tests a condition of the state and depending on the value of the condition,
decides the next statement to be executed.
4. Decomposition:
We divide the main algorithm into functions. We construct each function
independently of the main algorithm and other functions. Finally, we construct the main
algorithm using the functions.

..38.. THAAI VIRUDHUNAGAR


7 COMPOSITION AND DECOMPOSITION

SECTION – A
Choose the correct answer. 1 Mark
1. Suppose u, v = 10 ,5 before the assignment. What are the values of u and v after the sequence
of assignments? 1 u := v 2 v := u
a) u, v = 5 ,5 (b) u, v = 10 ,5
(c) u, v = 5 ,10 (d) u, v =10,10
2. Which of the following properties is true after the assignment at line 3?
1 -- i, j = 0
2 i, j := i+1, j -1
3 --?
(a) i + j >0 (b) i + j < 0 (c) i + j = 0 (d) i = j
3. If C1 is false and C2 is true, the compound statement
1 if C1
2 S1
3 else
4 if C2
5 S2
6 else
7 S3
(a) S1 (b) S2 (c) S3 (d) None
4. If C is false just before the loop, the control flows through 1 S1 2 while C 3 S2 4 S3
1 S1
2 while C
3 S2
4 S3
(a) S1 ; S3 (b) S1 ; S2 ; S3
(c) S1 ; S2 ; S2 ; S3 (d) S1;S2;S2;S2;S3
5. If C is true, S1 is executed in both the flowcharts, but S2 is executed in
(1) (2)

(a) (1) only (b) (2) only


(c) both (1) and (2) (d) neither (1) nor (2)

..39.. THAAI VIRUDHUNAGAR


– 7. COMPOSITION AND DECOMPOSITION
6. How many times the loop is iterated?
i := 0
while I ≠ 5
i := i + 1
(a) 4 (b) 5 (c) 6 (d) 0
SECTION – B
Very Short Answers. 2 Marks
1. Distinguish between a condition and a statement.
Condition Statement
A condition is a phrase that describes a test A statement is a phrase that commands the
of the state. computer to do an action.
2. Draw a flowchart for conditional statement.

3. Both conditional statement and iterative statement have a condition and a statement.
How do they differ?
❖ Conditional statement is executed only if the condition is true. Otherwise, nothing is done.
❖ Iterative statement repeatedly evaluates a condition and executes a statement as long as
the condition is true.
4. What is the difference between an algorithm and a program?
Algorithm Program
An algorithm is a step-by-step sequence of An algorithm expressed in a programming
statements to solve a problem. language is called a program.
Can't run on computers. Can be run on computers.
Syntax is not compulsory. Must be follow the syntax.
5. Why is function an abstraction?
❖ A function is an abstraction of a subproblem and specified by its input property and its
input-output relation.
❖ Users of function need to know only what the function does and not how it is done. So it
is abstract.
6. How do we refine a statement?
In refinement, starting from high level, each statement is repeatedly expanded into more
detailed statements in the subsequent levels.

..40.. THAAI VIRUDHUNAGAR


– 7. COMPOSITION AND DECOMPOSITION
SECTION – C
Short Answers. 3 Marks
1. For the given two flowcharts write the pseudo code.

(1) (2)
Pseudo code:
(1) (2)
if C if C
S1 S1
S2 else
S2
2. If C is false in line 2, trace the control flow in this algorithm.
1 S1 Control flow:
2 -- C is false S1
3 if C S3
4 S2 S4
5 else
6 S3
7 S4
3. What is case analysis?
❖ Case analysis statement generalizes it to multiple cases.
❖ Case analysis splits the problem into an exhaustive set of disjoint cases. For each case, the
problem is solved independently.
✓ If C1, C2 and C3 are conditions and S1, S2, S3 and S4 are statements, a 4-case analysis
statement has the form,
1. case C1
2. S1
3. case C2
4. S2
5. case C3
6. S3
7. else
8. S4

..41.. THAAI VIRUDHUNAGAR


– 7. COMPOSITION AND DECOMPOSITION
4. Draw a flowchart for-3case analysis using alternative statements.
True
Is C1 S1

False
True
Is C2 S2

False
True
Is C3 S3

False
S4

Next St

5. Define a function to double a number in two different ways: (1) n + n, (2) 2 x n


(1) n + n (2) 2 x n
double(n) double(n)
-- input: n -- input: n
-- output: n + n -- output: 2 x n
result := n + n result := 2 x n
SECTION – D
Explain in detail. 5 Marks
1. Exchange the contents: Given two glasses marked A and B. Glass A is full of apple
drink and glass B is full of grape drink. Write the specification for exchanging the
contents of glasses A and B, and write a sequence of assignments to satisfy the
specification.
Specification:
Exchange (a, g)
-- inputs: a, g := Apple, Grape
-- outputs: a, g := Grape, Apple
Sequence of assignments:
Step 1: a, g, t := Apple, Grape, Empty
Step 2: t := a (Pour the apple drink of the glass A to the empty glass T)
Step 3: a := g (Pour the grape drink of the glass B to the glass A)
Step 4: g := t (Pour the apple drink of the glass T to the glass B)
Step 5: a, g, t := Grape, Apple, Empty

..42.. THAAI VIRUDHUNAGAR


– 7. COMPOSITION AND DECOMPOSITION
2. Circulate the contents: Write the specification and construct an algorithm to circulate
the contents of the variables A, B and C as shown below: The arrows indicate that B
gets the value of A, C gets the value of B and A gets the value of C.

Specification: Algorithm:
Circulate ( A, B, C ) Step 1: Circulate ( A, B, C )
-- Input: A, B, C Step 2: -- Input: A, B, C
-- Output: A, B, C Step 3: T := A
T := A Step 4: A := C
A := C Step 5: C := B
C := B Step 6: B := T
B := T Step 7: Output A, B, C
3. Decanting problem. You are given three bottles of capacities 5 ,8 and 3 litres. The 8L
bottle is filled with oil, while the other two are empty. Divide the oil in 8L bottle into
two equal quantities. Represent the state of the process by appropriate variables. What
are the initial and final states of the process? Model the decanting of oil from one
bottle to another by assignment. Write a sequence of assignments to achieve the final
state.
To divide the oil equally in the oil bottle, the following 7 steps are needed:
Pour 5L of oil into the second bottle. (3,5,0)
Pour 3L from the second bottle to the third. (3,2,3)
Pour 3L from the third to the first. (6,2,0)
Pour all 2L from the second to the third bottle (6,0,2)
Pour 5L from the first to the second bottle. (1,5,2)
Pour 1 L from the second to the third bottle. (1,4,3)
Finally, pour now all 3L from the third bottle to the first (4,4,0)
Assignment statement as follows:
A, B, C = 8,0,0
A, B, C = 3,5,0
A, B, C = 3,2,3
A, B, C = 6,2,0
A, B, C = 6,0,2
A, B, C = 1,5,2
A, B, C = 1,4,3
A, B, C = 4,4,0

..43.. THAAI VIRUDHUNAGAR


– 7. COMPOSITION AND DECOMPOSITION
4. Trace the step-by-step execution of the algorithm for factorial(4).
factorial(n)
--inputs : n is an integer , n ≥ 0
--outputs : f = n!
f, i := 1 ,1
while i ≤ n
f, i := f × i, i+1
The step-by-step execution of the algorithm for factorial(4) as follows
n := 4
f := 1
i := 1
i while i <= n f := f x i i := i + 1
1 1 <= 4 (TRUE) f := 1 x 1 = 1 i := 1 + 1 = 2
2 2 <= 4 (TRUE) f := 1 x 2 = 2 i := 2 + 1 = 3
3 3 <= 4 (TRUE) f := 2 x 3 = 6 i := 3 + 1 = 4
4 4 <= 4 (TRUE) f := 6 x 4 = 24 i := 4 + 1 = 5
5 5 <= 4 (FALSE)
The value of factorial(4) is 24
ADDITIONAL QUESTIONS
1. An algorithm expressed in a programming language is called a _______.
a) Program b) Output c) Control d) Statement
2. It is a phrase that commands the computer to do an action.
a) Program b) Output c) Control d) Statement
3. What are the three different notations for representing algorithms?
1. A programming language
2. Pseudo code
3. Flowchart
4. What is programming language?
A programming language is a notation for expressing algorithms to be executed by
computers.
5. What is Pseudo code?
Pseudo code is a notation similar to programming languages. Algorithms expressed in
pseudo code are not intended to be executed by computers, but for communication among
people.
6. What is Flowchart?
Flowchart is a diagrammatic notation for representing algorithms. They show the control
flow of algorithms using diagrams in a visual manner.
7. What are compound statements?
❖ Statements composed of other statements are known as compound statements.
❖ Sequential, Alternative and Iterative control flow statements are compound statements.

..44.. THAAI VIRUDHUNAGAR


– 7. COMPOSITION AND DECOMPOSITION
8. Write the Flowcharts also have disadvantages.
1) Flowcharts are less compact than representation of algorithms in programming language
or pseudo code.
2) They obscure the basic hierarchical structure of the algorithms.
3) Alternative statements and loops are disciplined control flow structures. Flowcharts do
not restrict us to disciplined control flow structures.
9. Write about Decomposition and refinement.
Decomposition:
It involves breaking down a problem into smaller and more manageable problems and
combining the solutions of the smaller problems to solve the original problem. Their
solutions are then combined together to construct a solution to the original problem.
Refinement:
Each subproblem can be expanded into more detailed steps. Each step can be further
expanded to still finer steps and so on. This is known as refinement.

..45.. THAAI VIRUDHUNAGAR


8 ITERATION AND RECURSION

SECTION – A
Choose the correct answer. 1 Mark
1. A loop invariant need not be true
(a) at the start of the loop. (b) at the start of each iteration
(c) at the end of each iteration (d) at the start of the algorithm
2. We wish to cover a chessboard with dominoes, the number of black squares and the number
of white squares covered by dominoes, respectively, placing a domino can be modelled by
(a) b := b + 2 (b) w := w + 2 (c) b, w := b+1, w+1 (d) b := w
3. If m x a + n x b is an invariant for the assignment a, b : = a + 8, b + 7, the values of m and n are
(a) m = 8, n = 7 (b) m = 7, n = -8 (c) m = 7, n = 8 (d) m = 8, n = -7
4. Which of the following is not an invariant of the assignment? m, n := m+2, n+3
(a) m mod 2 (b) n mod 3
(c) 3 X m – 2 X n (d) 2 x m – 3 x n
5. If Fibonacci number is defined recursively as

to evaluate F(4), how many times F() is applied?


(a) 3 (b) 4 (c) 8 (d) 9
6. Using this recursive definition{ a n= 1 if n = 0 a x an -1 otherwise how many multiplications
are needed to calculate a10?

(a) 11 (b) 10 (c) 9 d) 8


SECTION – B
Very Short Answers. 2 Marks
1. What is an invariant?
If an expression of the variables has the same value before and after an assignment, it is
an invariant of the assignment.
2. Define a loop invariant.
Each time the loop body is executed, the variables are updated. However, there is also a
property of the variables which remains unchanged by the execution of the loop body. This
unchanging property is called the loop invariant.
3. Does testing the loop condition affect the loop invariant? Why?
No. The loop condition is not part of the invariant. It is what makes the loop terminate.
4. What is the relationship between loop invariant, loop condition and the input-output
recursively?
❖ The loop invariant is true before the loop body and after the loop body, each time.

..46.. THAAI VIRUDHUNAGAR


– 8. ITERATION AND RECURSION
❖ When the loop ends, the termination condition and the loop invariant should establish
the input-output relation.
5. What is recursive problem solving?
❖ To solve a problem recursively, the solver reduces the problem to sub-problems, and
calls another instance of the solver, known as sub-solver, to solve the sub-problem.
❖ Recursion allows the solver to assume that the sub-solver (recursive call) outputs the
solution to the sub-problem. Then, from the solution to the sub-problem, the solver
constructs the solution to the given problem.
6. Define factorial of a natural number recursively.
factorial (n)
-- inputs: n is an integer, n≥0
-- Outputs: f := n!
If n = 0
1
else
n x factorial ( n-1 )
SECTION – C
Short Answers. 3 Marks
1. There are 7 tumblers on a table, all standing upside down. You are allowed to turn
any 2 tumblers simultaneously in one move. Is it possible to reach a situation when all
the tumblers are right side up? (Hint: The parity of the number of upside-down tumblers
is invariant.)
No, it is not possible to reach a situation where all the tumblers are right side up.
❖ The variable U specifies the number of tumblers that are standing upside down. U's initial
value is 7
❖ If both the tumblers are placed upside down, the value of U is U = U + 2
❖ If both the tumblers are kept straight, the value of U is U = U - 2
❖ Step 3: If one tumbler is kept upside down and the other straight, the value of U does not
change. U = U
Since the value of U is odd in any of the above situations, it is not possible to reach a
situation where all the tumblers are right side up.
2. A knockout tournament is a series of games. Two players compete in each game; the
loser is knocked out (i.e. does not play any more), the winner carries on. The winner
of the tournament is the player that is left after all other players have been knocked
out. Suppose there are 1234 players in a tournament. How many games are played
before the tournament winner is decided?
❖ Let ‘g’ be the number of matches held.
❖ Let the number of players be ‘p’.
❖ Before the start of the match, g will be 0 and p will be 1234. Here we have to find the
value of g when the value of p is 1.

..47.. THAAI VIRUDHUNAGAR


– 8. ITERATION AND RECURSION
❖ At the end of each match, the value of g increases by 1 and the value of p decreases by
one. This can be represented by assignment as follows:
g, p := g + 1, p - 1
✓ From the above assignment, p + g is known as invariant.
✓ Initially, p + g is 1234 + 0 = 1234, and after a match, p + g is 1 + 1233 = 1234. So if the
value of p is 1, then g will be 1233.
❖ Therefore, a total of 1233 matches have to be played to determine the winner.
3. King Vikramaditya has two magic swords. With one, he can cut off 19 heads of a
dragon, but after that the dragon grows 13 heads. With the other sword, he can cut
off 7 heads, but 22 new heads grow. If all heads are cut off, the dragon dies. If the
dragon has originally 1000 heads, can it ever die? (Hint: The number of heads mod 3
is invariant.)
❖ Here head mod 3 is invariant.
❖ Sword 1 cuts 19 heads but 13 heads grow back. So, when the first sword is used only 6
(19-13) heads will be cut off. Here, 6 mod 3 = 0.
Here 6 mod 3 = 0.
❖ Sword 2 cuts 7 heads but 22 heads grow back. So, when the second sword is used only 15
(22-7) heads will be cut off. Here, 15 mod is 3 = 0.
❖ Therefore, all heads can be cut off only if the number of heads is divisible by 3. Otherwise,
you can't cut off all the heads.
➢ Here, the number of heads is 1000. It is not divisible by 3 (3 mod 1000 = 1 ).
➢ So, it is not possible to cut off the dragon. The dragon never dies.
SECTION – D
Explain in detail. 5 Marks
1. Assume an 8 × 8 chessboard with the usual coloring. “Recoloring” operation changes
the color of all squares of a row or a column. You can recolor repeatedly. The goal is
to attain just one black square. Show that you cannot achieve the goal. (Hint: If a row
or column has b black squares, it changes by |(8 – b) – b|.
❖ The letter B is used for black square and W is used for white square.
❖ Consider the chessboard as starting with a white square.
❖ The first row will have 4 white and 4 black squares. (B = 4 & W = 4)
1. If we coloring the first square (white) to black square then B = 5 & W = 3
2. If we coloring the second square (black) to white square then B = 4 & W = 4
❖ If we repeat 1 & 2, we will have the value B=4 & W=4 at the end of the first row.
❖ The above result applies to all the rows. Therefore, it is not possible to coloring all the
squares on the chessboard to one black color.
2. Power can also be defined recursively

..48.. THAAI VIRUDHUNAGAR


– 8. ITERATION AND RECURSION
Construct a recursive algorithm using this definition. How many multiplications are
needed to calculate a10?
power ( a, n )
-- inputs : a, n are integers and >=0
-- outputs : an
if n = 0
1
else if n mod 2 = 1
a x power( a, n-1 )
else
power( a, n/2 ) x power( a, n/2 )
Calculation of a10:
Step 1: n = 10 (even) then,
= power(a, 5) x power(a, 5)
Step 2: n = 5 (odd) then,
= a x power(a, 4) x a x power(a, 4)
Step 3: n = 4 (even) then,
= a x power(a, 2) x power (a, 2) x a x power(a, 2) x power(a, 2)
Step 4: n = 2 (even) then,
= a x power(a, 1) x power(a, 1) x power(a, 1) x power(a, 1) x a x power(a, 1) x
power(a, 1) x power(a, 1) x power(a, 1)
Step 5: n = 1 (odd) then,
= a x a x power(a,0) x a x power(a,0) x a x power(a,0) x a x power(a,0) x a x a x power(a,0)
x a x power(a, 0) x a x power(a, 0) x a x power(a, 0)
Step 6: n = 0 then,
=axax1xax1xax1xax1xaxax1xax1xax1xax1
17 multiplications are needed to calculate a10.
3. A single-square-covered board is a board of 2n x 2n squares in which one square is
covered with a single square tile. Show that it is possible to cover this board with
triominoes without overlap.
This problem can be solved using recursion.
❖ A corner-covered board is a board of 2n × 2n squares in which the square at one corner is
covered with a single square tile.
For example, n = 3, 23 x 23 = 8 x 8 corner-covered board.

..49.. THAAI VIRUDHUNAGAR


– 8. ITERATION AND RECURSION

❖ In the recursion step, divide the ❖ Place a triominoe (A triominoe is a L-


corner-covered board of size 2n × 2n shaped tile formed with three
into 4 sub-boards, by drawing adjacent squares) at the center of
horizontal and vertical lines through the entire board so as to not cover
the centre of the board. the corner-covered sub-board.

❖ Now, we have four corner-covered boards, each of size 2n-1 × 2n-1. Size of each sub-board
23-1 × 23-1 = 22 × 22 = 4 x 4

❖ If n = 2, then the size of each sub-board is 22-1 × 22-1 = 21 × 21 = 2 x 2

❖ When place a triominoe (L-shaped tile)

❖ 23 x 23 corner-covered board is covered with triominoes without overlap by recursion.

..50.. THAAI VIRUDHUNAGAR


– 8. ITERATION AND RECURSION
ADDITIONAL QUESTIONS
1. What are the two cases of recursive solver?
1. Base case: The problem size is small enough to be solved directly. Output the solution.
There must be at least one base case.
2. Recursion step: The problem size is not small enough. Deconstruct the problem into a
sub-problem, strictly smaller in size than the given problem. Call a sub-solver to solve the
sub-problem.
2. Whenever we solve a problem using cycle, what two cases should we ensure?
1. In the recursion step, the size of the input to the recursive call is strictly smaller than the
size of the given input.
2. There is at least one base case.

..51.. THAAI VIRUDHUNAGAR

You might also like