[go: up one dir, main page]

0% found this document useful (0 votes)
43 views48 pages

12th Computer Science - EM - Sample

The document outlines educational resources and guidance for students, particularly focusing on the 'Loyola Computer Science' book designed to aid various learners in preparing for board exams. It provides information on free educational opportunities, medical and para-medical courses, engineering, law, and other fields available after 12th standard, including eligibility criteria and examination details. Additionally, it encourages students to send their materials and question papers to a specified email or WhatsApp number for further assistance.
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)
43 views48 pages

12th Computer Science - EM - Sample

The document outlines educational resources and guidance for students, particularly focusing on the 'Loyola Computer Science' book designed to aid various learners in preparing for board exams. It provides information on free educational opportunities, medical and para-medical courses, engineering, law, and other fields available after 12th standard, including eligibility criteria and examination details. Additionally, it encourages students to send their materials and question papers to a specified email or WhatsApp number for further assistance.
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/ 48

www.kalvikadal.in https://material.kalvikadal.

in

n
l.i
da
ka
vi
al
.k
w
w
w

245/-

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Published by

PREFACE
  “Loyola Computer Science “ is in your hands.
   Students with average IQ always struggle to cope up studies. They always seek
for the best, sources to learn and score high marks.
   The pattern of the question being asked in the exams has changed dramatically

n
and the difficulty level has also increased considerably. To succeed in board exams

l.i
and to actualize your dream, you are required to prepare strategically and study in
a focused manner.

da
  This book gives important tips which covers the entire chapter.
  Loyola serves the above cited purpose in perfect manner.
ka
➢ Specially designed for coaching students of different levels.
  (Slow learners, average and Topper students)
vi
➢ Lot of additional questions are given for toppers
al

➢ The “EC Computer Science” is prepared with due care on the lines of the Govt.
Examination Valuation, the easy method of studying, the lesson and the perfect
.k

way of answering the questions.


➢ The answers are well prepared, briefly and easily for the students to study
w

without any difficulty and stress.


➢ Simplified text matter
w

➢ Focused on coverage of textbook.


w

➢ MCQ’s are framed based on new pattern.


➢ Included PTA questions and Govt. question papers with their key.
➢ Comprehensive questions are designed for average and above average students
based on key points.
Wish you All the Best
Loyola Publication

MáÇa®fŸ k‰W« khzt®fŸ ïªj QR Code °nf‹ brŒJ c§fsJ


bjhiyngá v©iz gâî brŒJ bfhŸsî«. ïj‹ _y« ghl«
r«gªj¥g£l FWŠbrŒâfŸ, whatsapp k‰W« SMS _ykhf mD¥g¥gL«.
ïjid¥ ga‹gL¤â¡ bfhŸsî«.

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

byhnahyh g¥Ë¡nfõÅ‹ - neh¡f«


neh¡f« :
• go¥ãš ã‹j§»a khzt®fŸ / khzÉfis ca®ªj Ãiy¡F¡
bfh©L tUjš (6M« tF¥ò Kjš 12M« tF¥ò tiu).
neh¡f¤ij mila í¡âfŸ :
1. khzt / khzÉfË‹ csÉaš mo¥gilÆš vËâš òÇa it¤jš.
2. khzt / khzÉfŸ m¢rÄ‹¿ muR¤ nj®îfis vâ® bfhŸs cjîjš.
3. muR¤ nj®îfËš Éil¤jhŸfis kâ¥ÕL brŒí« Éil¡F¿¥ò (Key)
mo¥gilÆš jahÇ¥ò.
4. x›bthU nfŸÉ¡FÇa gâšfŸ RU¡fkhfî«, bjËthfî« ïU¤jš.

n
5. bkšy¡f‰F« khzt / khzÉfS¡F nkY« vËik¥gL¤â¡

l.i
bfhL¤jš.
(jÄœ k‰W« M§»y tÊ¡ fšÉÆš

da
10M« tF¥ò - jÄœ, M§»y«, m¿Éaš, r_fm¿Éaš)
11M« tF¥ò - jÄœ k‰W« M§»y«
ka
12M« tF¥ò - jÄœ k‰W« M§»y«
áw¥òfŸ :
vi
1. muR¤ nj®Éš nf£f¥gL« ò¤jf Édh¡fis¤ jÉu TLjš Édh¡fŸ
ekJ gâ¥òfËš ïl« bg‰WŸsd.
al

2. byhnahyh <á üšfis th§»¥ ga‹gL¤J« khzt / khzÉfŸ ...


.k

v muR¤ nj®Éš nj®¢áailant KoahJ v‹w ÃiyÆš cŸst®fŸ


Äf vËâš 35% kâ¥bg©fŸ bg‰W nj®¢á bgwyh«.
w

v 35% - 40% kâ¥bg©fŸ bgW« khzt / khzÉfŸ


75% - 80% kâ¥bg©fŸ tiu bgwyh«.
w

v 80% kâ¥bg©fŸ bgW« khzt / khzÉfŸ


w

95% - 99% kâ¥bg©fŸ tiu bgwyh«.


v 10, 11 k‰W« 12M« tF¥ò muR¤nj®îfËš nf£f¥gL«
Édh¤jhŸfËš 98% Édh¡fS« k‰W« gy M©LfËš 100%
Édh¡fS« ïl«bg‰W tU»‹wd v‹gJ byhnahyh gâ¥òfË‹
áw¥ò.
tÊfh£Ljš :
 ca® go¥ã‰F khzt / khzÉfË‹ vâ®fhy eyid¡ fU¤âš
bfh©L mt®fS¡F tÊfh£L« neh¡»š 10, 12M« tF¥ò nj®¢á¡F¥
ã‹ v‹d go¡fyh«? v‹gij¥ g‰¿a MnyhridfŸ ïl«
bg‰WŸsd.

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

What to study after 12th std?


Department of Atomic Energy Free Chance for Education
1. Free Opportunities (Both Education and Employment)
and Employment
2. Medical & Para Medical Courses
zz Department of Atomic Energy conducts an examination
3. Engineering and Technology called National Eligibility cum Screening Test (NEST) every
4. Agriculture and Allied Courses year. Selected Candidates will be given admission either
5. Fisheries and Allied Courses in National Institute of Science Education and Research
6. Veterinary Science and Allied Courses (NISER), Bhubaneswar, Odhisa or Centre for Excellence
7. Law in Basic Sciences, University of Mumbai. All candidates
selected will be given admission to 5 Years Integrated
8. Fashion Technology and Design Courses either in Mathematics, Physics , Chemistry or

n
9. Fine Arts (Art, Painting, Dance, Drama or Acting, Biology. A stipend of Rs.65000/- per annum will be given
Music, and Sculpture) to each candidate and Rs.20,000/- per year as summer

l.i
10. Arts & Science Courses internship. Successful candidates after completing the
11. Courses related to Civil Aviation course will be absorbed by Department of Atomic Energy.

da
12. Courses related to Shipping For Details :www.nestexam.in
13. Foreign Language Courses MEDICAL AND PARA MEDICAL COURSES
ka
14. Hotel Management and Catering Technology Courses MEDICAL COURSES
zz MBBS , BDS, BAMS (Ayurveda), BHMS (Homoeopathy),
FREE OPPORTUNITIES
vi
BSMS (Siddha), BUMS (Unani Medicine), and BNYS
10 + 2 Technical Entry Scheme given by Indian Army (Naturopathy and Yoga).
al

zz Qualification required 12th Std. with Physics, Chemistry zz All Courses are of 5 ½ Years duration including 1 Year
and Maths. Minimum 60 % Marks.Should appear for IIT Internship except B.D.S which is of 4 ½ Years Duration.
.k

JEE Main Exam.Selection through SSB Interview. (Service zz NEET is compulsory for all Medical Courses except BNYS
(Naturopathy and Yoga) for which there is no need to have
Selection Board Interview)
w

NEET Exam.
zz After selection 10 Months Basic Military Training in Indian zz Eligibility for all the above mentioned Courses : 12th
w

Military Academy, Dehradun and after that Cadets will Standard with Physics, Chemistry and Biology or Physics,
be admitted in Military College of Engineering, Pune for Chemistry, Botany and Zoology with 50 % Marks for
w

B.E Course. After completing B.E a Post Commissioned General Candidates and 40 % Marks for BC, MBC, SC and
Training will be given and after that Employment as ST students. For Details : www.tnmedicalselction.org or
www.tnhealth.tn.gov.in
Lieutenant.
zz For Details : www.joinindianarmy.nic.in PARA MEDICAL COURSES
10 + 2 Cadet Entry Scheme or 10 + 2 Matric Entry Scheme zz B.Pharm, B.Sc (Nursing), B.P.T (Physiotherapy), B.O.T
(Occupational Therapy), B.Sc – MIT (Medical Imaging
zz Qualification – same as 10 + 2 Technical Entry Scheme. Technology), B.Sc Optometry, B.Sc – Operation Theatre and
Selection also as per 10 + 2 TES. Anesthesia Technology, B.Sc – Cardio Pulmonary Perfusion
Care Technology, B.Sc – Dialysis Technology, B.Sc – Medical
zz After Selection 6 Months Basic Naval Training in INS
Laboratory Technology, B.Sc – Cardiac Technology, B.Sc –
Chilka. After that Cadets will be admitted in Naval College Radio Therapy Technology, B.Sc – Cardiac Technology, B.Sc –
of Engineering ,Lonovala, Maharashtra for B.E. After Critical Care Technology, B.Sc – Critical Care Technology, B.Sc
completing B.E Post Commissioned Training will be given – Accident and Emergency Care Technology, B.Sc – Physician
for 10 months and after that Employment as Lieutenant. Assistant, B.Sc – Respiratory Therapy Technology, B.Sc –
Neuro Electro Physiology, B.Sc – Clinical Nutrition, B.A.S.L.P
zz For Details :www.joinindiannavy.gov.in
(Bachelor of Audiology and Speech Language Pathology)
4

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola What to study after 12th Std?


zz Eligibility: For All Para Medical Degree Courses 12th VETERINARY SCIENCE AND ALLIED COURSES
Standard with Physics, Chemistry, Biology or Physics,
zz B.V.Sc& A.H (Bachelor of Veterinary Science and Animal
Chemistry, Botany and Zoology Except B.Pharm and B.Sc
– Optometry. The Eligibility for these two courses is Physics, Husbandry) – 5 ½ Years. Including 1 year Internship. No
Chemistry, Biology or Physics, Chemistry, Computer NEET Needed. Only through Counseling. www.tanuvas.
Science or Physics, Chemistry, Botany and Zoology or ac.in Eligibility : 12th Standard with Physics, Chemistry
Physics, Chemistry and any other subject like Micro Biology, and Biology or Botany and Zoology.
Bio Technology etc. For Details : www.tnmedicalselction. zz B.Tech. Dairy Technology, B.Tech. Poultry Science
org (or ) www.tnhealth.tn.gov.in Technology, B.Tech. Food Technology - All 4 Years duration
zz Para Medical Diploma Courses are also available on and Eligiblity : 12th Std. with Maths, Physics and Chemistry.
all the specialties. Please go through the Tamilnadu LAW
Dr.M.G.R.Medical University Website for further Details.
zz B.A, LL.B – Eligibility 12th Standard with any group
www.tnmgrmu.ac.in
zz B.Com, LL.B – Eligibility 12th Standard with Commerce Group
ENGINEERING AND TECHNOLOGY zz B.C.A, LL.B – Eligibility 12th Standard with Computer
zz B.E, B.Tech, B.Plan & B.Des – All Four Years Duration Science Group. For Details :www.tndalu.ac.in

n
zz B.Arch.(Architecture) – 5 Years. FASHION TECHNOLOGY AND DESIGN

l.i
zz Eligibility for all the Engineering and Technology Courses
zz B.Des in Many Disciplines. Two Institutes of National Importance
zz 12th Standard with Maths, Physics and Chemistry with 50
zz National Institute of Fashion Technology – www.nift.ac.in

da
% Marks for General Candidates, 45 % for Backward Class
zz National Institute of Design – www.nid.edu
Candidates and 40 % for Most Backward, Scheduled
Caste, and Scheduled Tribe Candidates. FINE ARTS COURSES
ka
zz For B.Plan and B.Des Candidates should have appeared zz B.F.A in Art, Painting, Dance, Drama or Acting,
for IIT – JEE and Clear JEE Main and Advanced Exam. Music,Sculpture. For Details :www.tnjjmfau.ac.in
vi
zz For B.Arch. Students should clear NATA (National
Aptitude Test for Architecture) Exam. For further details : ARTS AND SCIENCE COURSES
al

www.annauniv.edu , www.nata.in , www.jeemain.nta.ac.in zz B.A , B.Com, B.B.A, B.Sc and all other Arts and Science
AGRICULTURE AND ALLIED SCIENCES Courses www.tngasa.in
.k

zz B.Sc – Agriculture , B.Sc – Horticulture , B.Sc – Forestry , CAREERS IN CIVIL AVIATION


B.Sc – Home Science, B.Sc – Sericulture B.Sc (Hons) –
w

zz Pilot, Air Traffic Controller, Flight Dispatcher, Air Hostess,


Food, Nutrition and Dietetics Ground Staff, and many other professionals related
w

zz B.E – Agricultural Engineering, B.E – Energy and Training and Courses www.dgca.nic.in
Environmental Engineering, B.Tech. – Agricultural Bio
COURSES RELATED TO SHIPPING
w

Technology, B.Tech. – Food Technology B.S (Hons) – Agri


Business Management zz B.Sc – Nautical Science, B.Tech. Marine Engineering,
zz Eligibility for Science Courses : 12th Standard with zz B.Tech. Naval Architecture and Ship Building,
Physics, Chemistry, Biology or Botany, Zoology of zz B.B.A – Shipping and Logistics and many Courses .
Vocational Agri Group. zz For Details : www.imu.edu.in, www.dgshipping.gov.in
zz Eligibility for Engineering Courses : 12th Standard
FOREIGN LANGUAGE COURSES
with Maths, Physics, Chemistry and any other Subject.
For Details :www.tnau.ac.in zz B.A (Hons) in English, French, German, Spanish, Russian,
Persian, Portuguese, Chinese.
FISHERIES AND ALLIED COURSES zz Contact : English and Foreign Languages University,
zz B.F.Sc – Bachelor of Fisheries Science – Eligibility 12th Tarnaka, Hyderabad – 500 007. www.efluniversity.ac.in
with Physics, Chemistry, Biology or Botany and Zoology. Hotel Management and Catering Technology, Charted
zz B.Tech. Fisheries Engineering – Eligibility : 12th with Accountancy, Cost Accountancy, Geology, Geography and
Maths, Physics and Chemistry. For other Courses and many more other courses will be published in detail in our
details :www.tnjfu.ac.in forthcoming books.

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

CONTENTS

Page.
UNIT No. Chapter Title
No
GOVT. PUBLIC EXAM - March 2024 7

n
1 Function 9

l.i
2 Data Abstraction 17
UNIT- I

da
3 Scoping 25
4 Algorithmic Strategies 35
ka
5 Python -Variables and Operators 47
6 Control Structures 57
vi
UNIT- II
7 Python functions 69
al

8 Strings and String manipulations 82


.k

9 Lists, Tuples, Sets and Dictionary 93


UNIT- III
w

10 Python Classes and objects 109


w

11 Database Concepts 118


UNIT- IV 12 Structured Query Language (SQL) 132
w

13 Python and CSV files 151


14 Importing C++ programs in Python. 164
15 Data manipulation through SQL 175
UNIT- V
Data visualization using pyplot: line
16 190
chart, pie chart and bar chart
Govt. Model Question Paper 2019 - 20 201
PTA Model Question Papers 203
GOVT. SUPPLEMENTARY EXAM - June 2023 215

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

th
Loyola GOVT. PUBLIC EXAM - MARCHEC – 12
2024 Computer Science

12 – COMPUTER SCIENCE
Time Allowed : 3.00 Hours Maximum Marks : 70
PART - I
Note : 1. All questions are compulsory.
2. C
 hoose the most suitable answer from the given four alternatives and write the option code
and the corresponding answer. 15 x 1 = 15
1. Which of the following is used to describe the worst case of an algorithm?
a) Big W b) Big A c) Big O d) Big S
2. The datatype whose representation is unknown are called as:
a) Concrete datatype b) Built-in datatype c) Abstract datatype d) Derived datatype
3. Which key is pressed to execute Python Script?
a) F1 b) F5 c) F3 d) F2
4. Which of the following defines what an object can do?
a) Interface b) Operating System c) Interpreter d) Compiler

n
5. Which of the following security technique that regulates who can view or use resources in a computing

l.i
environment?
a) Access control b) Password c) Certification d) Authentication

da
6. Which of the following is the Slicing Operator?
a) < > b) { } c) ( ) d) [ ]
ka
7. In Python the process of creating an object is called as ______
a) Initialize b) Constructor c) Instantiation d) Destructor
8. Pick the correct one to execute the given statement successfully.
vi

if __________ : print (x, "is a leap year")


al

a) x / 4 = 0 b) x % 2 = 0 c) x % 4 = 0 d) x % 4==0
9. What symbol is used for SELECT statement?
.k

a) X b) σ c) d)
10. If List = [10, 20, 30, 40, 50] then List [2] = 35 will result:
w

a) [10, 20, 35, 40, 50] b) [35, 10, 20, 30, 40, 50]
w

c) [10, 35, 30, 40, 50] d) [10, 20, 30, 40, 50, 35]
11. A CSV file is also known as a ______
w

a) String File b) Flat File c) Random File d) 3D File


12. The most commonly used statement in SQL is:
a) execute b) cursor c) commit d) select
13. What is the output of the following snippet in Python?
for x in range (5):
if x==2:
continue
print(x, end=' ')
a) 0 1 3 4 b) 0 1 2 c) 0 1 2 3 4 d) 0 1 2 3
14. ________ is a collection of resources assembled to create a single unified visual display.
a) Objects b) Interface c) Graphics d) Dashboard
15. The clause used to sort data in a database:
a) GROUP BY b) SORT BY c) SELECT d) ORDER BY

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

PART - II

Note: Answer any six questions. Question No. 24 is compulsory. 6 x 2 = 12


16. What is abstract data type? Chapter 2
17. What are the different operators that can be used in Python? Chapter 5
18. What is searching? Write its types. Chapter 4
19. Write the different types of function. Chapter 7
20. List the types of visualizations in Matplotlib. Chapter 16
21. What is the difference between Hierarchical and Network data model? Chapter 11
22. What is CSV file? Chapter 13
23. Which method is used to fetch all rows from the database table? Chapter 15
24. Write the use of pop ( ) function in Python. Chapter 9
PART - III

Note: Answer any six questions. Question No. 33 is compulsory. 6 x 3 = 18


25. Differentiate pure and impure function. Chapter 1

n
26. What are the different ways to access the elements of a list? Give example. Chapter 9

l.i
27. Write a note on Asymptotic notation. Chapter 4
28. Using if....else...elif statement write a suitable program to display largest of 3 numbers. Chapter 6

da
29. Write a short note for the followings with suitable example. Chapter 8
(a) capitalize( ) b) swapcase( )
30. How will you define Constructor and Destructor in Python? Chapter 10
ka
31. What are the applications of scripting language? Chapter 14
32. What is the use of Where clause? Give a Python statement by using Where clause. Chapter 15
vi
33. Write short notes on TCL Commands in SQL. Chapter 12
al

PART - IV
Note: Answer all the questions. 5 x 5 =25
.k

34. a) How will you facilitate data abstraction? Explain it with suitable example. Chapter 2
OR
w

b) What is Binary Search? Explain it with example. Chapter 4


35. a) Explain input( ) and print( ) functions with examples. Chapter 5
w

OR
Chapter 3
w

b) Explain the scope of variables with an example.


36. a) What is the purpose of range( ) function? Explain with an example. Chapter 9
OR
b) Explain the following operators in Relational algebra with suitable examples. Chapter 11
i) UNION ii) INTERSECTION iii) DIFFERENCE iv) CARTESIAN PRODUCT
37. a) What are the components of SQL? Write the commands for each. Chapter 12
OR
b) Discuss the features of Python over C++. Chapter 14
38. a) Write the different methods to read a file in Python. Chapter 13
OR
b) Explain the various buttons in a matplotlib window. Chapter 16

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science


CHAPTER - 1
Unit I FUNCTION

FUNCTIONS - An Overview
Expression of Algorithm: Object:
• Algorithms are expressed using statements An object is an instance created from the
of a programming language class.
Subroutine: Interface:
• Subroutines are small sections of code that • An interface is a set of action that an object
are used to perform a particular task that can do.
can be used repeatedly. • Interface just defines what an object can do,
Function : but won’t actually do it.

n
• A function is a unit of code that is often Implementation:

l.i
defined within a greater code structure. • Implementation carries out the instructions
• A function contains a set of code that works defined in the interface.

da
on many kinds of inputs and produces a Pure functions:
concrete output. • Pure functions are functions which will
ka
Definition: give exact result when the same arguments
• Definitions are distinct syntactic blocks. are passed.
Parameters: Impure function:
vi

• Parameters are the variables in a function • The functions which cause side effects to
al

definition. the arguments passed are called Impure


Argument: function.
.k

• Arguments are the values which are passed Recursive function:


to a function definition through the function • A function definition which calls itself is
w

definition. called recursive function.


w

PART - I TEXT BOOK EVALUATION


w

Part - I
Choose the best answer (1 Mark)
1. The small sections of code that are used to perform a particular task is called Aug 2021
a) Subroutines b) Files c) Pseudo code d) Modules Mar 2023
Ans: a) Subroutines
2. Which of the following is a unit of code that is often defined within a greater code structure?
a) Subroutines b) Function c) Files d) Modules Aug 2022
Ans: b) Function
3. Which of the following is a distinct syntactic block? PTA-6 May 2022
a) Subroutines b) Function c) Definition d) Modules
Ans: c) Definition

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

4. The variables in a function definition are called as PTA-2 QY - 2019


a) Subroutines b) Function c) Definition d) Parameters
Ans: d) Parameters
5. The values which are passed to a function definition are called HY - 2019
a) Arguments b) Subroutines c) Function d) Definition
Ans: a) Arguments
6.  hich of the following are mandatory to write the type annotations in the function
W
definition PTA - 4
a) { } b) ( ) c) [ ] d) < >
Ans: b) ( )
7. Which of the following defines what an object can do? March 2024
a) Operating System b) Compiler c) Interface d) Interpreter
Ans: c) Interface
8. Which of the following carries out the instructions defined in the interface?

n
a) Operating System b) Compiler c) Implementation d) Interpreter
Ans: c) Implementation

l.i
9. The functions which will give exact result when same arguments are passed are called

da
PTA-3 March 2020
a) Impure functions b) Partial Functions c) Dynamic Functions d) Pure functions
Ans: d) Pure functions
ka
10. The functions which cause side effects to the arguments passed are called
a) Impure functions b) Partial Functions c) Dynamic Functions d) Pure functions
vi
Ans: a) Impure functions
al

Part - II
Answer the following questions (2 Marks)
.k

1. What is a subroutine? PTA - 1 HY - 2019


w

• Subroutines are the basic building blocks of computer programs.


• Subroutines are small sections of code that are used to perform a particular task that can
w

be used repeatedly.
w

2. Define Function with respect to Programming language. Aug - 2021


• A function is a unit of code that is often defined within a greater code structure.
• A function works on many kinds of inputs like variants, expressions and produces a
concrete output.
3. Write the inference you get from X:=(78).
In X:=(78),(78) is a function definition that binds the value 78 to the name ‘X’.
4. Differentiate interface and implementation. PTA-3 Jun 2023
Interface Implementation

I nterface defines what an object can do, Implementation carries out the instructions
but won’t actually do it defined in the interface

10

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

5. Which of the following is a normal function definition and which is recursive function
definition
i) let sum x,y:
return x +y
Recursive Function
ii) let disp:
print ‘welcome’
Normal Function
iii) let rec sum num:
if (num!=0) then return num + sum (num-1)
else
return num
Recursive Function
Part - III
Answer the following questions (3 Marks)

n
1. Mention the characteristics of Interface. Sep - 2020 Mar 2023

l.i
• The class template specifies the interfaces to enable an object to be created and operated

da
properly.
• An object’s attributes and behaviour is controlled by sending functions to the object.
2. Why strlen is called pure function?
ka
GMQ - 2019
• strlen() is a pure function because the function takes one variable as a parameter, and
accesses it to find its length.
vi
• It is a pure function because, it will give same results for same input always.
al

3.
What is the side effect of impure function. Give example.
• Impure function has side effects when it has observable interaction with the outside
.k

world.
• Modifying the variable outside of function is one of the side effects.
w

eg: let y:= 0


w

(int) inc (int) x


y:= y+x;
w

return(y)
Here, the value of 'y' gets changed inside the function definition and thus the result
will change each time.
4. Differentiate pure and impure function. PTA - 6 March 2020 March 2024

Pure Function Impure Function


The return value of the impure functions
 he return value of the pure functions
T
1 does not solely depend on its arguments
solely depends on its arguments passed.
passed.
ure functions with the same set of 
P Impure functions with the same set of
2
arguments always return same values. arguments may return different values.
3 They do not have any side effects. They have side effects.

11

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

 hey do not modify the arguments which They may modify the arguments which are
T
4
are passed to them passed to them

5 Example: strlen(),sqrt() Example: random(),date()

Part - IV
Answer the following questions (5 Marks)
1. What are called Parameters and write a 2. Parameter with Type:
note on PTA - 2 Eg: Function definition with types:
i) Parameter without Type May-2022 (requires: b > = 0 )
ii) Parameter with Type (returns: a to the power of b )
Parameters : let rec pow (a: int) (b: int) : int : =
• Parameters are the variables in a if b=0 then 1
function definition.

n
else a * pow a (b-1)
Arguments:

l.i
• When we write the type annotations
• Arguments are the values which are
for ‘a’ and ‘b’ the parentheses are

da
passed to a function definition.
Parameters passing are of two types mandatory.
namely • Explicitly annotating the types can help
ka
1. Parameter Without Type with debugging such an error message.
2. Parameter With Type 2. Identify in the following program
vi
1. Parameter without Type:  PTA - 5
al

Eg: Function definition. let rec gcd a b :=


 i f b <> 0 then gcd b (a mod b) else return a
.k

(requires: b > =0 )
(returns: a to the power of b)
i) Name of the function
w

let rec pow a b:=


if b=0 then 1 gcd
w

else a*pow a(b-1) ii) Identify the statement which tells it


• In the above function definition is a recursive function
w

variable ‘b’ is the parameter and the let rec gcd a b:=
value which is passed to the variable ‘b’
is the argument. “rec” keyword tells the compiler it is a
• The precondition (requires) and post recursive function
condition (returns) of the function is iii) Name of the argument variable
given. a and b
• We have not mentioned any types (data iv) Statement which invoke the function
types). recursively
• Some language compiler solves this if b<>0 gcd b (a mod b)
type (data type) inference problem v) Statement which terminates the
algorithmically, but some require the recursion
type to be mentioned. return a

12

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

3.
Explain with example Pure and impure an implementation of that interface (the
functions. code that carries out the behaviour).
Pure functions: • An object is an instance created from
• Pure functions are functions which the class.
will give exact result when the same
• The interface defines an object’s
arguments are passed. visibility to the outside world.
• For example, the mathematical function
sin (0) always results 0. • In object oriented programs classes
are the interface and how the object
Eg:
is processed and executed is the
let square x
implementation.
return: x * x
• The above function square is a pure Example : Increasing a car's speed
function because it will not give
different results for the same input. ENGINE
Impure functions:
• The variables used inside the function

n
may cause side effects though the

l.i
getspeed
functions which are not passed with
any arguments.

da
• For example, the mathematical function No
required
random( ) will give different outputs speed
Pull Fuel
for the same function call.
ka
Yes
let random number:=
a := random() Return
vi
if a > 10 then
return: a • The person who drives the car doesn’t
al

else care about the internal working.


return: 10 • To increase the speed of the car he just
.k

• Here the function Random is impure presses the accelerator to get the desired
as it is not sure what will be the result behaviour.
w

when we call the function. • Here the accelerator is the interface


between the driver (the calling /
4. Explain with an example interface and
w

implementation. invoking object) and the engine


• An interface is a set of action that an ( the called object).
w

object can do. • In this case, the function call would be


• In Object Oriented Programming Speed (70): This is the interface.
language, an Interface is a description • Internally, the engine of the car is doing
of all functions that a class must have in all the things.
order to be a new interface. All of these actions are separated from the
• A class declaration combines the driver, who just wants to go faster. Thus we
external interface (its local state) with separate interface from implementation.
PART II - PTA & GMQ GOVT. EXAM QUESTION ANSWERS
I. Choose the best answer (1 Mark)
1.  he function definition which calls itself is called
T  PTA - 1
a) Pure function b) Impure function c) Normal function d) recursive function
 Ans: d) recursive function
13

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

2. Which is the basic building block of 2. Write notes on Impure function. PTA - 5
computer programs?  Sep - 20 • The variables used inside the function
a) Argument may cause side effects though the
b) Parameter
functions are not passed with any
c) Subroutine
d) Interface Ans: c) Subroutine arguments. Such functions are called
II. Short Answer Questions Impure function.
• Example: random(), date()
1. Write the algorithmic function definition
to find the minimum among 3 numbers. 3. Write notes on Pure functions. QY - 2019
let min 3xyz:= • Pure functions are functions which
PTA - 4
if x < y then will give exact result when the same
if x < z then x else z arguments are passed.
else • Example: : strlen(),sqrt()

n
if y < z then y else z
PART III - ADDITIONAL QUESTIONS

l.i
I. Choose the best answer (1 Mark) 7. An _______ is an instance created from

da
the class.
1. The function definition is introduced by a) Interface b) object
the keyword c) member d) function
ka
a) def b) let Ans: b) object
c) rec d) requires
Ans: b) let 8. In object oriented programs _______ are
vi
the interface.
2. The recursive function is defined using a) classes b) object
al

the keyword c) function d) implementation


a) let b) requires Ans: a) classes
.k

c) name d) let rec


Ans: d) let rec 9. ____________ bind values to names.
a) Modules b) Subroutines
w

3. All functions are________ definitions. c) Definition d) Function


a) datatype b) dynamic Ans: c) Definition
w

c) return d) static
 Ans: d) static II. Answer the following questions
w

(2 and 3 Marks)
4. trlen() is an example of ________function.
a) pure b) impure 1. How Algorithms are expressed?
a) user defined d) recursive Algorithms are expressed using
Ans: a) pure statements of a programming language
5.  valuation of__________ functions does 2.
E What is meant by Definition?
not cause any side effects to its output? Definitions are distinct syntactic blocks.
a) Impure b) built-in 3. Define Parameters.
c) Recursive d) pure Parameters are the variables in a function
 Ans: d) pure definition.
6. r andom() is an example of ______function. 4. Define Argument.
a) user defined b) impure Arguments are the values which are
c) pure d) recursive passed to a function definition through the
Ans: b) impure
function definition.
14

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

5. Write notes on Interface. 8. Differentiate parameters and arguments.


• An interface is a set of action that an Parameters Arguments
object can do. Parameters are Arguments are the
the variables in a values which are
• Interface just defines what an object can
function definition passed to a function
do, but won’t actually do it definition.
6. Define Implementation. 9. What are the roles of classes and
Implementation carries out the instructions implementation in Object oriented
programs?
defined in the interface In object oriented programs classes are the
7. What is Recursive function? interface and how the object is processed
and executed is the implementation.
A function definition which calls itself is
10. Define Object:
called Recursive function. An object is an instance created from the

n
class.
III. Answer the following questions (5 Marks)

l.i
1. Explain the syntax of function • The type x →→ y is the type of a function
that gets an input of type ‘x’ and returns

da
definitions.
• The syntax to define functions is close an output of type ‘y’ where as xl→→ x2
to the mathematical usage. -→→y is a type of a function that takes
ka
• The definition is introduced by the two inputs, the first input is of type ‹xl›
keyword let, followed by the name of and the second input of type ‘xl’ , and
the function and its arguments; then
vi
returns an output of type ‹y’ .
the formula that computes the image of
the argument is written after an = sign. • Likewise x1 →→...→→xn→→y has
al

• If you want to define a recursive type ‘x’ as input of n arguments and ‘y’
type as output.
.k

function: use “let rec” instead of “let” .


Syntax for function definitions: 3. In the island there are different types
w

 let rec fn a1 a2 ... an := k of chameleons. Whenever two different


 Here the ‘fn’ is a variable indicating color chameleons meet they both change
w

an identifier being used as a their colors to the third color. Suppose


function name.
two types of chameleons are equal in
w

 The names ‘a1’ to ‘an’ are variables


indicating the identifiers used as number.
parameters. Construct an algorithm that arranges
  The keyword ‘rec’ is required if meetings between these two types so that
‘fn’ is to be a recursive function; they change their color to the third type.
otherwise it may be omitted. In the end, all should display the same
2. Write a short note an syntax for function color.
types. let ree monochromatize a b c:=
• The syntax for function types if a > 0 then
x→→y a, b, c:= a - 1, b - 1, c + 2
xl →→x2→→y else
x1 →→ .... →→xn→→y a:= 0 b:= 0 c:= a + b + c
• The ‘x’ and ‘y’ are variables indicating return c
types.

15

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

4. What happens if you modify a variable outside the function? Give an example
• One of the most popular groups of side effects is modifying the variable outside of
function.
• For example:
let y: = 0
let inc (x:int):int:c
y: =y+x;
return (y)
 In the above example the value of y get changed inside the function definition due
to which the result will change each time.
 The side effect of the inc () function is it is changing the data of the external visible
variable‘y’.
HANDS ON PRACTICE
1. Write the algorithmic recursive function definition to find the sum of ‘n ‘ natural numbers.

n
let rec sum num:

l.i
If(num!=0) then
return num+sum(num-1)

da
else
return num
ka
☺☺☺☺☺
vi
al
.k
w
w
w

16

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science


CHAPTER - 2
Unit I DATA ABSTRACTION

DATA ABSTRACTION – An Overview


Data abstraction:
• Data abstraction is a powerful concept in computer science that allows programmers to treat
code as objects.
Abstraction:
• Abstraction provides modularity (modularity means splitting a program into many modules).
Classes (structures) are the representation for “Abstract Data Types”, (ADT).
• Abstract Data type (ADT) is a type (or class) for objects whose behavior is defined by a set of
value and a set of operations.

n
• The definition of ADT only mentions what operations are to be performed but not how these

l.i
operations will be implemented.
• The process of providing only the essentials and hiding the details is known as abstraction.

da
Constructors and Selectors:
• To facilitate data abstraction, we need to create two types of functions: constructors and
ka
selectors.
• Constructors are functions that build the abstract data type.
vi
• Selectors are functions that retrieve information from the data type.
• The basic idea of data abstraction is to structure programs so that they operate on abstract
al

data.
• A concrete data representation is defined as an independent part of the program.
.k

Two parts of a program:


w

• The two parts of a program are, the part that operates on abstract data and the part that
defines a concrete representation.
w

Concrete data type Vs Abstract data type :


• A concrete data type is a data type whose representation is known
w

• In abstract data type the representation of a data type is unknown


Tuple & List:
• To enable us to implement the concrete level of our data abstraction, some languages like
Python provides a compound structure called Pair which is made up of list or Tuple.
List :
• List is constructed by placing expressions within square brackets separated by commas.
• Example: List := [10,20]
Tuple:
• A tuple is a comma-separated sequence of values surrounded with parentheses.
• Example: colour= (‘red’, ‘blue’, ‘Green’)
Difference between List & Tuple :
• In a list, elements can be changed.

17

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

PART - I TEXT BOOK EVALUATION


Choose the best answer (1 Mark)
1. Which of the following functions that build the abstract data type ? Sep-2020 Aug-2021
a) Constructors b) Destructors c) Recursive d) Nested Aug-2022
Ans: a) Constructors
2. Which of the following functions that retrieve information from the data type? May-2022
a) Constructors b) Selectors c) recursive d) Nested
Ans: b) Selectors
3. The data structure which is a mutable ordered sequence of elements is called
a) Built in b) List c) Tuple d) Derived data
Ans: b) List

4. A sequence of immutable objects is called March 2020 Jun 2023

n
a) Built in b) List c) Tuple d) Derived data
Ans: c) Tuple

l.i
5. The data type whose representation is known are called QY-2019

da
a) Built in datatype b) Derived datatype c) Concrete datatype d) Abstract datatype
Ans: c) Concrete datatype
ka
6. The data type whose representation is unknown are called  PTA-2 Hy 2019 Mar 2023
 Mar 2024
a) Built in datatype b) Derived datatype c) Concrete datatype d) Abstract datatype
vi
Ans: d) Abstract datatype
al

7. Which of the following is a compound structure?


a) Pair b) Triplet c) single d) quadrat
.k

Ans: a) Pair
PTA-4 GMQ-2019
w

8. Bundling two values together into one can be considered as


a) Pair b) Triplet c) single d) quadrat Ans: a) Pair
w

9. Which of the following allow to name the various parts of a multi-item object?
a) Tuples b) Lists c) Classes d) quadrats
w

Ans: c) Classes
10. Which of the following is constructed by placing expressions within square brackets?
a) Tuples b) Lists c) Classes d) quadrats Ans: b) Lists
Answer the following questions (2 Marks)
1. What is abstract data type? Aug-2021 May-2022 Mar 2024
Abstract Data type (ADT) is a type (or class) for objects whose behavior is defined by a set of
value and a set of operations.
2. Differentiate constructors and selectors. PTA - 2 & 3 QY-2019 Aug-2022
Constructors Selectors
Constructors are functions that build the Selectors are functions that retrieve
abstract data type. information from the data type.

18

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

3. What is a Pair? Give an example. March 2020 Jun 2023


• Pair is a compound structure which is made up of list or Tuple
• Bundling two values together into one can be considered as a Pair.
• Example: Pr = [10,20]
a,b :=Pr
In the above example ‘a’ becomes 10, ’ b’ becomes 20.
4. What is a List? Give an example. QY-2019
• List is one of the ways to implement pairs.
• List is constructed by placing expressions within square brackets separated by commas.
• Example: list := [10,20]
5. What is a Tuple? Give an example. Mar 2023
• A tuple is a comma-separated sequence of values surrounded with parentheses.
• Example: colour= (‘red’, ‘blue’, ‘Green’)

n
l.i
Answer the following questions (3 Marks)
1. Differentiate Concrete Data Type and Abstract Data Type

da
Concrete Data Type Abstract Data Type
1 Concrete data types or structures (CDT’s) Abstract Data types (ADT’s) offer a
ka
are direct implementations of a relatively high level view (and use) of a concept
simple concept independent of its implementation
vi
2 In Concrete Data Type is a data type whose In Abstract Data Type the representation of
representation is known a data type is unknown
al

3 Dependent of its implementation Offer a high level view and use of a concept
.k

independent of its implementation.


2. Which strategy is used for program designing? Define that Strategy.
w

GMQ-2019
• A powerful strategy for designing programs: ‘wishful thinking’.
w

• Wishful Thinking is the formation of beliefs and making decisions according to what
might be pleasing to imagine instead of by appealing to reality.
w

3. Identify Which of the following are constructors and selectors? PTA - 5


a N1:=number() a Constructors
b accetnum(n1) b Selectors
c displaynum(n1) c Selectors
d eval(a/b) d Selectors
e x,y:= makeslope (m), e Constructors
makeslope(n)
f display() f Selectors
4. What are the different ways to access the elements of a list. Give example
• The elements of a list can be accessed in two ways.
i) Multiple assignment:
• Unpacks a list into its elements and binds each element to a different name.

19

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

lst := [10, 20]


x, y := lst
In the above example, ‘x’ becomes 10 and ‘y’ becomes 20.
ii) The element selection operator:
• It is also expressed using square brackets.
Example:
Ist[0]
10
lst[1]
20

5. Identify Which of the following are List, Tuple and class.


a arr [1, 2, 34] a List
b arr (1, 2, 34) b Tuple

n
c student [rno, name, mark] c Class

l.i
d day:= ( sun’, mon’, tue’, wed’) d Tuple
e x:= [2, 5, 6.5, [5, 6], 8.2] e List

da
f employee [eno, ename, esal, eaddress] f Class
IV. Answer the following questions (5Marks)
ka
1. How will you facilitate data abstraction. Explain it with suitable example. PTA - 2 & 4
vi
To facilitate data abstraction we need to create two types of functions namely Jun 2023
1.Constructors 2. Selectors. Mar 2024
al

Constructors :
.k

• Constructors are functions that build the abstract data type.


w

Selectors :
• Selectors are functions that retrieve information from the data type.
w

Example :
w

 We have an abstract data type called city.


 This city object will hold the city’s name, and its latitude and longitude.
 To create a city object, we use a function like
city: =makecity (name, lat, Ion)
 Here makecity (name, lat, Ion) is the constructor which creates the object city.
 To extract the information of a city object, we would use functions(Selectors) like
getname( city)
getlat( city)
getlon(city)
• In the above example makecity (name, lat, Ion) is the constructor and getname(city),getlat(
city) and getlon(city) are the selectors .
• Because the above functions extract the information of the city object.

20

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

2.
What is a List? Why List can be called as Pairs. Explain with suitable example
 PTA-6 Mar 2023
The first way to implement pairs is with the List construct.
List:
 List is one of the ways to implement pairs.
 List is constructed by placing expressions within square brackets separated by
commas.
 Such an expression is called a list literal. List can store multiple values.
 Each value can be of any type and can even be another list.
 Eg: Lst := [10,20].
 Here lst[0] represents the value 10
and lst[1] represents the value 20
 We can represent list similar to set as
lst [(0,10), (1,20)] - Where
(0, 10) (1, 20)

n
l.i
Index position Value Index position Value

da
• Any way of bundling two values together into one can be considered as a pair.
• Lists are a common method to do so. Therefore List can be called as Pairs.
Example: Representing rational numbers using list:
ka
• We can now represent a rational number as a pair of two integers in pseudo code : a
numerator and a denominator.
vi
rational(n, d):
   return [n, d]
al

numer(x):
  return x[0]
.k

denom(x):
w

  return x[1]
3. How will you access the multi-item. Explain with example.
w

• We can use the structure construct to represent multi-part objects where each part is
given a name.
w

• In OOP languages it’s called class construct


Eg: class Person:
creation()
firstName :=””
lastName :=””
id :=””
email :=””
The new data type Person is pictorially represented as
Person class name (multi part data representation)

creation( ) function belonging to the new data type

21

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

}
first Name
last Name
variable (field) belonging to the new data type
id
email

Let main() contains


p1:=Person() statement creates the object
firstName:=”Padmashri” setting a field called firstName with value Padmashri
lastName:=”Baskar” setting a field called lastName with value Baskar
id:=”994-222-1234” setting a field called id value 994-222-1234
email=”compsci@gmail.com” setting a field called email with value compsci@gmail.com

n
-- output of first Name: Padmashri

l.i
The class (structure) construct defines the form for multi-part objects that represent a person.

da
PART II - PTA & GMQ GOVT. EXAM QUESTION ANSWERS
I. Choose the best answer (1 Mark)
ka
1. ADT expansion is _________ PTA - 1
a) Abstract Data Tuple b) All Data Template
vi
c) Abstract Data Type d) All Data Type Ans: c) Abstract Data Type
al

2. ADT can be implemented using _________  PTA-5


a) singly linked list b) doubly linked list c) either (a) or (b) d) neither (a) nor (b)
.k

 Ans: c) neither (a) or (b)


II. Short Answer Questions
w

1. (a) What is selector ? Sep-2020


w

(b) What are the parts of a program?


w

a) Selectors are nothing but the functions that retrieve information from the data type.
Eg:
(i) getname(city)
(ii) getlat(city)
(iii) getlong(city)
are the selectors because these functions extract the information of the city object
b) The two parts of a program are,
i) The part that operates on abstract data
ii) The part that defines a concrete representation, that implements abstract data.
2. Define Abstraction. Aug-2021
The process of providing only the essentials and hiding the details is known as abstraction.

22

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

PART III - ADDITIONAL QUESTIONS


I. Choose the best answer (1 Mark)
1. What allows data abstraction in that we 9. Which of the following is used to build
can give a name to a set of memory cells. the abstract data type?
a) Tuple b) Set a) Destructors b) Constructors
c) Dictionary d) List  Ans: d) List c) Selectors d) All of these
Ans: b) Constructors
2. Expansion of CDT is __________
a) Collective Data Type 10. 
Which of the following function that
b) Class Data Type facilitate the data abstraction?
c) Concrete Data Type a) Constructors b) Destructors
d) Central Data Type c) Selectors d) a and c
 Ans: c) Concrete Data Type Ans: d) a and c
3. To facilitate data abstraction we need to 11. The process of providing only the

n
create _____ types of functions essentials and hiding the details is known
as ________

l.i
a) 2 b) 3
c) 4 d) 5 Ans: a) 2 a) Abstraction b) Pairs

da
c) Encapsulation d) Function
4. List can also be called as _________
Ans: a) Abstraction
a) Functions b) Class
c) Pairs d) Structure 12. Which provides modularity?
ka
 Ans: c) Pairs a) Data types b) Abstraction
c) Classes d) Subroutines
5. Which of the following is contracted
vi
Ans: b) Abstraction
by placing expressions within square
al

brackets separated by commas? 13. Powerful concept that allows


a) Tuple b) List programmers to treat codes as objects?
.k

c) Set d) Dictionary a) Encapsulation b) Inheritance


 Ans: b) List c) Polymorphism d) Data Abstraction
w

6. List is constructed by using ________ and Ans: d) Data Abstraction


_________
w

II. Answer the following questions (2 and 3 Marks)


a) ( ); b) [ ],
1. Write a note on Data Abstraction
w

c) < > ,; d) [ ],. Ans:b) [ ],


• Data abstraction is supported by
7. 
A powerful strategy for designing defining an abstract data type (ADT)
programs is _________ which is a collection of Constructors
a) Data Abstraction and Selectors.
b) ‘wishful thinking’ • Constructors create an object, bundling
c) Concrete data type together different pieces of information,
d) Abstract Data Template while selectors extract individual pieces
 Ans:b)’wishful thinking’ of information from the object.
8. 
Which of the following extract the III. Answer the following questions (5Marks)
information of the object?
a) Constructors b) Selectors 1. Explain the representation of Abstract data
c) Functions d) Destructors type using rational numbers.
Ans: b) Selectors • Any program consist of two parts - the part
that operates on abstract data and the part
23

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

that defines a concrete representation, is - - constructor


connected by a small set of functions that - - constructs a rational number
implement abstract data in terms of the with numerator x, denominator y
concrete representation. rational(x, y)
• To illustrate this technique, let us consider - - selector
an example to design a set of functions for numer(x) → returns the
manipulating rational numbers . numerator of rational number x
Example: denom(y) → returns the
• A rational number is a ratio of integers, and denominator of rational number y.
rational numbers constitute an important •  e have the operations on rational numbers
W
sub-class of real numbers. defined in terms of the selector functions
• A rational number such as 8/3 or 19/23
 numer and denom, and the constructor
is typically written as : < numerator > /< function rational, but you haven’t yet defined
denominator > where both the < numerator these functions.
> and < denominator > are placeholders for • We have to glue together a numerator and a

n
integer values. denominator into a compound value
• Both parts are needed to exactly characterize

l.i
• The pseudo code for the representation of the
the value of the rational number. rational number using the above constructor
• Actually dividing integers produces a float

da
and selector is
approximation, losing the exact precision of x,y:=8,3
integers. rational(n,d)
ka
• However, you can create an exact
 numer(x)/denum(y)
representation for rational numbers by - - output : 2.6666666666666665
combining together the numerator and
vi
denominator. ☺☺☺☺☺
al
.k
w
w
w

24

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science


CHAPTER - 3
Unit I SCOPING

SCOPING – An Overview
Scope: Module:
• Scope refers to the visibility of variables, • A module is a part of a program.
parameters and functions in one part of • Programs are composed of one or more
a program to another part of the same independently developed modules.
program.
Modular programming:
• The scope of a variable is that part of the
• The process of sub dividing a computer
code where it is visible.
program into separate sub-programs is
• The LEGB rule is used to decide the order
called Modular programming.
in which the scopes are to be searched for

n
scope resolution Access control:

l.i
• Access control is a security technique that
Mapping:
regulates who or what can view or use
• The process of binding a variable name

da
resources in a computing environment. It
with an object is called mapping.
is a fundamental concept in security that
• = (equal to sign) is used in programming
minimizes risk to the object.
ka
languages to map the variable and object.
Public members:
Namespaces:
• Public members (generally methods
• Namespaces are containers for mapping
vi
declared in a class) are accessible from
names of variables to objects.
outside the class.
al

Local scope:
Protected members:
• Local scope refers to variables defined in
• Protected members of a class are accessible
.k

current function.
from within the class and are also available
Global variable: to its sub-classes.
w

• A variable which is declared outside of


all the functions in a program is known as Private members: March 2020
w

global variable. • Private members of a class are denied


access from the outside the class. They can
w

Nested function:
be handled only from within the class.
• A function (method) within another
function is called nested function. Access Specifiers in Python and C++ and Java :
Enclosed Scope: PTA - 1 • Python prescribes a convention of prefixing
• A variable which is declared inside a the name of the variable/method with
function which contains another function single or double underscore to emulate the
definition within it, the inner function can behaviour of protected and private access
also access the variable of the outer function. specifiers.
This scope is called enclosed scope. • C++ and Java, control the access to class
members by public, private and protected
Built-in scope:
keywords
• Built-in scope has all the names that are
• All members in a Python class are public by
pre-loaded into program scope when we
default whereas by default in C++ and java
start the compiler or interpreter.
all members are private.

25

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

PART - I TEXT BOOK EVALUATION


Part-I
Choose the best answer (1 Mark)
1. Which of the following refers to the visibility of variablesin one part of a program to
another part of the same program.
a) Scope b) Memory c) Address d) Accessibility
Ans: a) Scope
2. The process of binding a variable name with an object is called Sep-2020 Aug-2021
a) Scope b) Mapping c) late binding d) early binding
Ans: b) Mapping
3. Which of the following is used in programming languages to map the variable and object?

n
a) :: b) := c) = d) == PTA-2 HY-2019

l.i
Ans:c) =
Containers for mapping names of variables to objects is called QY-2019 May-2022 Jun 2023

da
4.
a) Scope b) Mapping c) Binding d) Namespaces
Ans: d) Namespaces
ka
5. Which scope refers to variables defined in current function? Aug-2022
vi
a) Local Scope b) Global scope c) Module scope d) Function Scope
Ans: a) Local Scope
al

6. The process of subdividing a computer program into separate sub-programs is called


a) Procedural Programming b) Modular programming
.k

c) Event Driven Programming d) Object oriented Programming


w

Ans: b) Modular programming


7. Which of the following security technique that regulates who canuse resources in a
w

computing environment? Mar 2024


w

a) Password b) Authentication c) Access control d) Certification


Ans: c) Access control
8. Which of the following members of a class can be handled only from within the class?
a) Public members b) Protected members Mar 2020
c) Secured members d) Private members Ans: d) Private members
9. Which members are accessible from outside the class? Mar 2023
a) Public members b) Protected members
c) Secured members d) Private members Ans: a) Public members
10. The members that are accessible from within the class and are also available to its sub
classes is called PTA-6
a) Public members b) Protected members
c) Secured members d) Private members Ans: b) Protected members

26

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

Part - II
Answer the following questions (2 Marks)
1. What is a scope? Mar 2023
• Scope refers to the visibility of variables, parameters and functions in one part of a
program to another part of the same program.
2. Why scope should be used for variable. State the reason.
• It is a good practice to limit a variable’s scope to a single definition.
• Because, changes inside the function can’t affect the variable on the outside of the function
in unexpected ways.
3. What is Mapping? PTA - 5 May-2022 Jul 2022
• The process of binding a variable name with an object is called mapping.
• = (equal to sign) is used in programming languages to map the variable and object.
4. What do you mean by Namespaces? GMQ-2019 March 2020 PTA - 4
• Namespaces are containers for mapping names of variables to objects. Aug-2022

n
• Programming languages keep track of all the mappings with namespaces.

l.i
5. How Python represents the private and protected Access specifiers?

da
• Python prescribes a convention of prefixing the name of the variable/method with single
or double underscore to emulate the behavior of protected and private access specifiers.
Eg: –a → Protected variable
ka
– num → Private variable
Part - III
vi
Answer the following questions (3 Marks)
al

1. Define Local scope with an example. Aug-2021


Local scope:
.k

• Local scope refers to variables defined in current function.


• Always, a function will first look up for a variable name in its local scope.
w

Example:
w

Entire program
w

1. Disp():
Disp ( ) Output of the Program
2. a:=7
a:=7
3. print a 7
Print a
4. Disp()
Disp( )

2. Define Global scope with an example PTA - 6


Global variable:
• A variable which is declared outside of all the functions in a program.
• Global variable can be accessed inside or outside of all the functions in a program

27

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

Example:

Entire program
1. a:=10 a:=10
2. Disp(): Output of the Program
Disp ( )
3. a:=7
a:=7 7
4. print a Print a
5. Disp(): 10
6. print a Disp 1 ( ) :
Print a

• On execution of the above code the variable a which is defined inside the, function
displays the value 7 for the function call Disp() and then it displays 10, because a is

n
defined in global scope.

l.i
3. Define Enclosed scope with an example PTA - 3
Enclosed Scope :

da
• A variable which is declared, inside a function which contains another function definition
within it, the inner function can also access the variable of the outer function.
ka
Example:
Entire Program
vi

1. Disp():
al

Disp( )
2. a:=10 a:=10
Output of the Program
.k

3. Disp1()
4. print a Disp 1( ) : 10
w

Print a
5. Disp1()
10
w

6. print a Disp 1 ( ) :
7. Disp() Print a
w

Disp 1

• In the above example Disp1() is defined within Disp()


• The variable 'a' is defined in Disp() can be even used by Disp1()
4. Why access control is required? PTA - 1 HY-2019
• Access control is required because it is a security technique that regulates who or what
can view or use resources in a computing environment.
• It minimizes risk to the object.
• It is a selective restriction of access to data.

28

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

5. Identify the scope of the variables in the following pseudo code and write its output
color:= ‘Red’ Ans:
my color( ): Variables Scope Output:
b:=‘Blue’ Color Global Scope Red Blue Green
myfavcolor( ): Red Blue
b Enclosed Scope
g:=‘Green’ Red
g Local Scope
print color, b, g
myfavcolor( )
print color, b
mycolor( )
print color
Part - IV
Answer the following questions (5Marks)

n
1. Explain the types of scopes for variable or LEGB rule with example. PTA - 1 & 3

l.i
 Sep-2020 Mar 2022 Jun 2023 Mar 2024

da
LEGB rule:
• The LEGB rule is used to decide the order in which the scopes are to be searched for
scope resolution.
ka
• The scopes are listed below in terms of hierarchy (highest to lowest).
vi
BUILT IN Local(L) Defined inside function/class
GLOBAL Defined inside enclosing functions (Nested
al

ENCLOSED Enclosed(E)
function concept)
.k

Local
Global (G) Defined at the uppermost level
w

Built-in(B) Reserved names in built-in functions (modules)


w

Local Scope :
w

• Local scope refers to variables defined in current function.


• Always, a function will first look up for a variable name in its local scope.
Example:
Entire program

1. Disp(): Disp ( )
2. a:=7 Output of the Program
a:=7
3. print a 7
4. Disp()
Print a
Disp( )

29

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

Global Scope:
• A variable which is declared outside of all the functions in a program.
• Global variable can be accessed inside or outside of all the functions in a program.
Example:
Entire program

1. a:=10 a:=10
2. Disp(): Output of the Program
3. a:=7 Disp ( )
a:=7 7
4. print a
5. Disp(): Print a
10
6. print a Disp 1 ( ) :
Print a

n
• On execution of the above code the variable ‘a’ which is defined inside the function

l.i
displays the value 7 for the function call Disp() and then it displays 10; because a is

da
defined in global scope.
Enclosed Scope:
• A variable which is declared inside a function which contains another function definition
ka
with in it, the inner function can also access the variable of the outer function. This scope
is called enclosed scope.
vi
Example:
al

Entire Program
1. Disp():
.k

2. a:=10 Disp( )
w

a:=10 Output of the Program


3. Disp1()
w

4. print a Disp 1( ) : 10
Print a
5. Disp1()
w

10
6. print a Disp 1 ( ) :
Print a
7. Disp()
Disp ( )

• In the above example Disp1( ) is defined with in Disp( ).


• The variable ‘a’ defined in Disp( ) can be even used by Disp1( ).
Built-in Scope:
• It is the widest scope.
• The built-in scope has all the names that are pre-loaded into the program scope when we
start the compiler or interpreter.
• Any variable or module which is defined in the library functions of a programming
language has Built-in or module scope.

30

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

Entire program
Built in/module scope

Disp( )

Disp 1( ) : Library files associated with the software


Print a

Disp 1 ( ) :
Print a
Disp ( )

2. Write any Five Characteristics of Modules PTA - 4 & 6


• Modules contain instructions, processing logic, and data. HY-2019
• Modules can be separately compiled and stored in a library. Sep-2020 Jun 2023

n
• Modules can be included in a program.
• Module segments can be used by invoking a name and some parameters.

l.i
• Module segments can be used by other modules.

da
3. Write any five benefits in using modular programming.
• Less code to be written.
• A single procedure can be developed for reuse, eliminating the need to retype the code
ka
many times.
• Programs can be designed more easily because a small team deals with only a small part
vi
of the entire code.
• Modular programming allows many programmers to collaborate on the same application.
al

• The code is stored across multiple files.


• Code is short, simple and easy to understand.
.k

• Errors can easily be identified, as they are localized to a subroutine or function.


• The same code can be used in many applications.
w

• The scoping of variables can easily be controlled.


PART II - PTA & GMQ GOVT. EXAM QUESTION ANSWERS
w

I. Choose the best answer (1 Mark)


w

1. The kind of scope of the variable ‘a’ used in thepseudo code given below. GMQ-2019
(a) Disp( ): (b) a: = 7 (c) print a (d) Disp( )
a) Local b) Global c) Enclosed d) Built-in Ans: a) Local
2. The SQL command to make a database as current active database is GMQ-2019
a) CURRENT b) USE c) DATABASE d) NEW Ans: b) USE
3. A variable which is declared inside a function which contains another function definition:
a) Local b) Global c) Enclosed d) Built-in PTA-1
 Ans: c) Enclosed
4. Which are loaded as soon as the library files are imported to the program? PTA-3
a) Built-in scope variables b) Enclosed scope variables
c) Global scope variables d) Local scope variables
 Ans: a) Built-in scope variables
31

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

5. Which of the following is not the example of modules? PTA-5


a) procedures b) subroutines c) class d) functions 
 Ans: c) class
II. Short Answer Questions
1. What is LEGB rule ? QY-2019
Scope also defines the order in which variables have to be mapped to the object in order to
obtain the value.
2. What is a module? PTA
• A module is a part of a program.
• Programs are composed of one or more independently developed modules
• A single module can contain one or several statements closely related each other.
PART III - ADDITIONAL QUESTIONS
I. Choose the best answer (1 Mark)

n
1. The duration for which a variable is alive is called its_______

l.i
a) End time b) Scope time c) Life time d) Visible time

da
Ans: c) Life time
2. The scope of a_______ is that part of the code where it is visible
ka
a) Variable b) Keyword c) Function d) Operator
Ans: a) Variable
vi
3. A Function always first look up for a variable name in its______ scope
a) Enclosed b) Local c) Global d) Built-in
al

Ans: b) Local
.k

4. The inner function can access the variable of the outer function. This is called ____scope.
a) Local b) Enclosed c) Function d) Global
w

Ans: b) Enclosed
w

5. ______can be separately compiled and stored in a library


a) Characteristics b) Modules c) Syntax d) none of these
w

Ans: b) Modules
6. In Object Oriented Programming Language Access control is implemented through_____.
a) Access modules b) Access modifiers c) Access variables d) Keywords
Ans: b) Access modifiers
7. ___________is a selective restriction of access to data in a program?
a) Control variable b) Access control c) System authentication d) Module
Ans: b) Access control
8. The part of a program that can see or use the variables are called
a) Parameter b) Scope c) Function d) Indentation
Ans: b) Scope
9. How many variables can be mapped to the same instance?
a) 2 b) 3 c) Multiple d) 4 Ans: c) Multiple
32

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

10. Which of the following keeps track of all these mappings with namespaces?
a) Application software b) Programming languages
c) System software d) MySQL Ans: b) Programming languages
11. Which of the following rule is used to decide the order in which the scopes are to be
searched for scope resolution?
a) LGEB b) LEGB c) LBEG d) LGBEAns: b) LEGB
12. How many types of variable scope are there?
a) 2 b) 3 c) 4 d) 6 Ans: c) 4
13. A variable which is declared outside all the functions in a program is known as
a) Local b) Enclosed c) Global d) Extern
Ans: c) Global
14. Which of the following variable can be accessed inside or outside of all the functions in a
program?

n
a) Local b) Enclosed c) Global d) Built-in

l.i
Ans: c) Global
15. Which of the following programming enables programmers to divide up the work and

da
retry pieces of the program independently?
a) Procedural Programming b) Modular Programming
ka
c) Object Oriented Programming d) Structural Programming
Ans: b) Modular Programming
vi
16. Which of the following contain instructions, processing logic and data?
a) Scopes b) Indentation c) Modules d) Access control
al

Ans: c) Modules
17. Which of the following members of a class are denied access from outside the class?
.k

a) Protected b) Private c) Public d) Enclosed


w

Ans: b) Private
18. The arrangement of private instance variables and public methods ensure the principle of
w

a) Inheritance b) Polymorphism c) Abstraction d) Encapsulation


Ans: d) Encapsulation
w

19. By default the Python class members are


a) Private b) Protected c) Public d) Global
Ans: c) Public
20. By default the C++ and Java class members are
a) Protected b) Private c) Public d) LocalAns: b) Private
21. _______________are composed of one or more independently developed Modules
a) Access control b) Programs c) Encapsulation d) Members of a class
Ans: b) Programs
22. Scope refers to the visibility of___________
a) Variables b) Parameters c) All of these d) Functions
Ans: c) All of these

33

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

II. Answer the following questions (2 and 3 Marks)

1. Define variable.
Variable are addresses references, or pointers, to an object in memory.
2. Write a note on access modifiers of a class.
• Public members (generally methods declared in a class) are accessible from outside the
class.
• Protected members of a class are accessible from within the class and are also available
to its sub-classes.
• Private members of a class are denied access from outside the class. They can be handled
only from within the class.
III. Answer the following questions (5Marks)

1. Explain how Access Specifiers are activated in Python , C++ and Java.

n
• Python prescribes a convention of prefixing the name of the variable/method with single
or double underscore to emulate the behaviour of protected and private access specifiers.

l.i
• C++ and Java, control the access to class members by public, private and protected

da
keywords.
• All members in a Python class are public by default whereas by default in C++ and java
all members are private.
ka
• Any member can be accessed from outside the class environment in Python which is not
possible in C++ and java.
vi
2. Write a note on module
• A module is a part of a program.
al

• Programs are composed of one or more independently developed modules.


.k

• A single module can contain one or several statements closely related each other.
• Modules work perfectly on individual level and can be integrated with other modules.
w

• A software program can be divided into modules to ease the job of programming and
debugging as well.
w

• A program can be divided into small functional modules that work together to get the
output.
w

• The process of subdividing a computer program into separate subprograms is called


Modular programming.
• Modular programming enables programmers to divide up the work and debug pieces of
the program independently.
• The examples of modules are procedures, subroutines, and functions.
☺☺☺☺☺

34

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science


CHAPTER - 4
Unit I ALGORITHMIC STRATEGIES

ALGORITHMIC STRATEGIES – An Overview


Algorithm: Memoization:
• An algorithm is a finite set of instructions to • 
Memoization or memoisation is an
accomplish a particular task.
optimization technique used primarily to
• It is a step-by-step procedure for solving a
speed up computer programs by storing
given problem.
the results of expensive function calls and
Sorting:
returning the cached result when the same
• Sorting is the process of arranging
inputs occur again.
information or data in certain order either

n
in ascending or descending . Linear search:

l.i
Searching : • Linear search also called sequential search is
• Searching is a process of finding a particular a sequential method for finding a particular

da
element present in given set of elements. value in a list.
• Some of the searching types are: Binary search:
ka
i) Linear Search • Binary search is also called half-interval
ii) Binary Search. search algorithm.
vi
Algorithmic strategy: • It finds the position of a search element
• The way of defining an algorithm is called within a sorted array.
al

Algorithmic strategy. • The binary search algorithm can be done as


Algorithmic solution: divide-and-conquer search algorithm and
.k

• An algorithm that yields expected output executes in logarithmic time.


w

for a valid input is called an algorithmic Bubble sort:


solution
• Bubble sort is a simple sorting algorithm.
w

Algorithm analysis: • The algorithm starts at the beginning of the


• An estimation of the time and space
w

list of values stored in an array.


complexities of an algorithm for varying
• It compares each pair of adjacent elements
input sizes is called algorithm analysis .
and swaps them if they are in the unsorted
Best Algorithm: order.
• The best algorithm to solve a given problem
is one that requires less space in memory Dynamic programming:
and takes less time to execute its instructions Dynamic programming is an algorithmic
to generate output. design method that can be used when the
Asymptotic notations: solution to a problem can be viewed as the
• Asymptotic Notations are languages that result of a sequence of decisions.
uses meaningful statements about time and
space complexity

35

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

PART - I TEXT BOOK EVALUATION


Part- I
Choose the best answer (1 Mark)
1. The word comes from the name of a Persian mathematician Abu Ja’far Mohammed ibn-i
Musa al Khowarizmi is called? PTA-6 Aug-2021 May-2022
a) Flowchart b) Flow c) Algorithm d) Syntax
Ans: c) Algorithm
2. From the following sorting algorithms which algorithm needs the minimum number of
swaps?
a) Bubble sort b) Insertion sort c) Selection sort d) All the above
Ans: c) Selection sort
3. Two main measures for the efficiency of an algorithm are March 2020
a) Processor and memory b) Complexity and capacity

n
c) Time and space d) Data and space Ans: c) Time and space

l.i
4. The algorithm that yields expected output for a valid input is called as
a) Algorithmic solution b) Algorithmic outcomes

da
c) Algorithmic problem d) Algorithmic coding
 Ans : a) Algorithmic solution
ka
5. Which of the following is used to describe the worst case of an algorithm?
a) Big A b) Big S c) Big W d) Big O Ans : d) Big O
vi
6. Big is the reverse of GMQ - 2019 March 2024
a) Big O b) Big θ c) Big A d) Big S Ans : a) Big O
al

7. Binary search is also called as


a) Linear search b) Sequential search c) Random search d) half-interval search
.k

Ans : d) half-interval search


w

8. The Θ notation in asymptotic evaluation represents


a) Base case b) Average case c) Worst case d) NULL case
w

Ans: b) Average case


w

9. If a problem can be broken into subproblems which are reused several times, the problem
possesses which property?
a) Overlapping subproblems b) Optimal substructure
c) Memoization d) Greedy Ans: a) Overlapping subproblems
10. In dynamic programming, the technique of storing the previously calculated values is
called ? HY - 2019 Mar 2023
a) Saving value property b) Storing value property
c) Memoization d) Mapping Ans: c) Memoization
Part - II
Answer the following questions (2 Marks)
1. What is an Algorithm? Aug-2021 March 2020
• An algorithm is a finite set of instructions to accomplish a particular task.
• It is a step-by-step procedure for solving a given problem.

36

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

2. Write the phases of performance evaluation of an algorithm.


Analysis of algorithms and performance evaluation can be divided into two different phases:
i) A Priori estimates: This is a theoretical performance analysis of an algorithm. Effciency of
an algorithm is measured by assuming the external factors.
ii) A Posteriori testing: This is called performance measurement. In this analysis, actual
statistics like running time and required for the algorithm executions are collected.
3. What is Insertion sort?
• Insertion sort is a simple sorting algorithm.
• It works by taking elements from the list one by one and inserting then in their correct
position in to a new sorted list.
• This algorithm builds the final sorted array at the end.
4. What is Sorting?
Sorting is the process of arranging information or data in certain order either in ascending
or descending .

n
5.What is searching? Write its types. GMQ - 2019 HY - 2019 May - 2022 March 2024
• Searching is a process of finding a particular element present in given set of elements.

l.i
• Some of the searching types are:
i) Linear Search ii) Binary Search.

da
Part - III
Answer the following questions (3 Marks)
ka
1. List the characteristics of an algorithm Aug-2021 May - 2022
● Input ● Output ● Finiteness ● Definiteness
vi
● Effectiveness ● Correctness ● Simplicity ● Unambiguous
● Feasibility ● Portable ● Independent
al

2. Discuss about Algorithmic complexity and its types PTA - 3


.k

• The complexity of an algorithm f (n) gives the running time and/or the storage space
required by the algorithm in terms of n as the size of input data.
w

• Time Complexity: It is given by the number of steps taken by the algorithm to complete
the process.
w

• Space Complexity: It is the amount of memory required to run to its completion. The
space required by an algorithm is equal to the sum of fixed part and variable part.
w

Types of complexity:
1. Best case 2. Worst case 3. Average case
3.
What are the factors that influence time and space complexity.
The factors that influence time and space complexity are
1. Time 2. Space
Time Factor : Time is measured by counting the number of key operations like comparisons
in the sorting algorithm.
Space Factor: Space is measured by the maximum memory space required by the algorithm.
4. Write a note on Asymptotic notation QY - 2019 Mar - 2020 Jun 2023 Mar - 2024
• Asymptotic Notations are languages that use meaningful statements about time and
space complexity.
• The following three asymptotic notations are mostly used to represent time complexity
of algorithms:
37

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

Big O:
To describe the worst -case of an algorithm.
Big Ω:
To describe the lower bound (best -case).
Big Θ:
 When an algorithm has complexity with lower bound = upper bound, it has the
complexity Θ (n log n), which means the running time of that algorithm always falls
in n log n in the best-case and worst-case.
5. What do you understand by Dynamic programming? Sep - 2020
• Dynamic programming is an algorithmic design method that can be used when the
solution to a problem can be viewed as the result of a sequence of decisions.
• This approach is similar to divide and conquer.
• It is used whenever problems can be divided into similar sub-problems. So that their
results can be re-used to complete the process.

n
• These approaches are used to find the solution in optimized way.

l.i
Part - IV

da
Answer the following questions (5 Marks)
1. Explain the characteristics of an algorithm. HY - 2019 PTA - 5
ka
Input Zero or more quantities to be supplied.
Output At least one quantity is produced.
vi
Finiteness Algorithms must terminate after finite number of steps.
All operations should be well defined. For example, operations involving
Definiteness
al

division by zero or taking square root for negative number are unacceptable.
Effectiveness Every instruction must be carried out effectively.
.k

Correctness The algorithms should be error free.


Easy to implement.
w

Simplicity
Unambiguous Algorithm should be clear and must lead to only one meaning.
w

Feasibility Should be feasible with the available resources.


It should be generic, independent of any programming language or an
w

Portable
operating system able to handle all range of inputs.
It should have step-by-step directions, which should be independent of
Independent
any programming code.

2. Discuss about Linear search algorithm March 2020 PTA - 1 & 4 Aug-2022 Mar 2023
• Linear search also called sequential search is a sequential method for finding a particular
value in a list.
• This method checks the search element with each element in sequence until the desired
element is found or the list is exhausted. In this searching algorithm, list need not be
ordered.
Pseudo code:
 Traverse the array using for loop
 In every iteration, compare the target search key value with the current value of the list.

38

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

 If the values match, display the current index and value of the array.
 If the values do not match, move on to the next array element.
 If no match is found, display the search element not found.
Example:
index 0 1 2 3 4
values 10 12 20 25 30
 To search the number 25 in the array given below, a linear search will go step by step in a
sequential order starting from the first element in the given array if the search element is
found that index is returned otherwise the search is continued till the last index of the array.
 In this example number 25 is found at index number 3.
3.What is Binary search? Discuss with example. Aug-2021 Jun 2023 Mar 2024
Binary Search:
• Binary search also called half-interval search algorithm.

n
• It finds the position of a search element within a sorted array.

l.i
• The binary search algorithm can be done as a dividend- and -conquer search algorithm
and executes in logarithmic time.

da
Procedure code for Binary search
1. Start with the middle element:
ka
• If the search element is equal to the middle element of the array then return the index
of the middle element.
vi
• If not, then compare the middle element with the search value,
• If the search element is greater than the number in the middle index, then select the
al

elements to the right side of the middle index, and go to Step-1.


• If the search element is less than the number in the middle index, then select the ele-
.k

ments to the left side of the middle index, and start with Step-1.
w

2. When a match is found, display success message with the index of the element matched.
3. If no match is found for all comparisons, then display unsuccessful message.
w

Example:
1. List of elements in an array must be sorted first for Binary search. The following
w

example describes the step by step operation of binary search.


2. Consider the following array of elements, the array is being sorted so it enables to do the
binary search algorithm.
 Let us assume that the search element is 60 and we need to search the location or
index of search element 60 using binary search.
10 20 30 40 50 60 70 80 90 99
0 1 2 3 4 5 6 7 8 9
3. First, we find index of middle element of the array by using this formula:
mid = low + (high - low)/2
4. Here it is, 0+(9 - 0)/2 = 4 (fractional part ignored)v So, 4 is the mid value of the array.

10 20 30 40 50 60 70 80 90 99
0 1 2 3 4 5 6 7 8 9

39

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

5. Now compare the search element with the value stored at mid value location 4. The
value stored at location or index 4 is 50, which is not match with search element. As the
search value 60 is greater than 50.
10 20 30 40 50 60 70 80 90 99
0 1 2 3 4 5 6 7 8 9
6. Now we change our low to mid + 1 and find the new mid value again using the
formula.
low = mid + 1
mid = low + (high -low) / 2
7. Our new mid is 7 now. We compare the value stored at location 7 with our target value 31.

10 20 30 40 50 60 70 80 90 99
0 1 2 3 4 5 6 7 8 9
8. The value stored at location or index 7 is not a match with search element, rather it is
more than what we are looking for. So, the search element must be in the lower part

n
from the current mid value location

l.i
10 20 30 40 50 60 70 80 90 99
0 1 2 3 4 5 6 7 8 9

da
9. The search element still not found. Hence, we calculated the mid again by using the
formula.
ka
high = mid-1
mid = low + (high -low)/2
Now the mid value is 5.
vi

10 20 30 40 50 60 70 80 90 99
al

0 1 2 3 4 5 6 7 8 9
.k

10. Now we compare the value stored at location 5 with our search element. We found that
it is a match.
w

10 20 30 40 50 60 70 80 90 99
0 1 2 3 4 5 6 7 8 9
w

11. We can conclude that the search element 60 is found at location or index 5.
For example, if we take the search element as 95, For this value this binary search
w

algorithm returns unsuccessful result.


4.Explain the Bubble sort algorithm with example PTA - 3 & 6 May - 2022
Bubble sort :
• Bubble sort algorithm simple sorting algorithm.
• The algorithm is a comparison sort, is named for the way smaller elements “bubble” to
the top of the list.
• Although the algorithm is simple, it is too slow and less efficient when compared to
insertion sort and other sorting methods.
 Assume list is an array of n elements. The swap function swaps the values of the
given array elements.
Pseudo code:
• Start with the first element i.e., index = 0, compare the current element with the next
element of the array.
40

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

• If the current element is greater than the next element of the array, swap them.
If the current element is less than the next or right side of the element, move to the next
element. Go to Step 1 and repeat until the end of the index is reached.
Let’s consider an array with values {15, 11, 16, 12, 14, 13} Below, we have a pictorial
representation of how bubble sort will sort the given array.

n
l.i
da
ka
vi
al

• The above pictorial example is for iteration-d. Similarly, remaining iteration can be done.
The final iteration will give the sorted array. At the end of all the iterations we will get the
.k

sorted values in an array as given below:


w

11 12 13 14 15 16
w

5. Explain the concept of Dynamic programming with suitable example. Mar 2023
• Dynamic programming is an algorithmic design method that can be used when the
w

solution to a problem can be viewed as the result of a sequence of decisions.


• This approach is similar to divide and conquer.
• It is used whenever problems can be divided into similar sub-problems. So that their
results can be re-used to complete the process.
• These approaches are used to find the solution in optimized way.
• For every inner sub-problem, dynamic algorithm will try to check the results 0 the
previously solved sub-problems.
• The solutions of overlapped sub-problems are combined in order to get the better solution.
Steps to do Dynamic programming:
• The given problem will be divided into smaller overlapping sub-problems.
• An optimum solution for the given problem can be achieved by using result of smaller
sub-problems.
• Dynamic algorithms use Memoization.

41

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

Fibonacci Iterative Algorithm with Dynamic programming approach:


The following example, shows a simple Dynamic programming approach for the generation
of Fibonacci series. Initialize f0 = 0, f1 = 1
Step- 1: Print the initial values of Fibonacci f0 and f1
Step- 2: Calculate Fibonacci fib ← f0+ f1
Step- 3: Assign f0 ← f1, f1← fib
Step- 4: Print the next consecutive value of Fibonacci fib
Step- 5: Go to step-2 and repeat until the specified number of terms generated
For example, if we generate Fibonacci series up to 10 digits, the algorithm will generate the
series as shown below: The Fibonacci series is: 0 1 1 2 3 5 8 13 21 34 55.
PART II - PTA & GMQ GOVT. EXAM QUESTION ANSWERS
I. Choose the best answer (1 Mark)
1. What is another name for Binary search ? QY - 2019

n
a) Linear b) Half interval c) Decimal d) Boolean

l.i
Ans: b) Half interval

da
2. Which one of the following is not a factor to measure the execution time of an algorithm?
a) Speed of the machine b) Operating system Sep - 2020
c) Programming language used d) Selection Ans: d) Selection
ka
3. Time complexity of bubble sort in best case is PTA-1
a) θ (n) b) θ (n log n) c) θ (n2) d) θ (n(logn)2)
vi

 Ans: a) θ (n)
al

4. Step by step procedure for solving a given problem: PTA-2


a) Program b) Pseudo Code c) Flowchart d) Algorithm
.k

 Ans: d) Algorithm
w

5. Which of the following is not a characteristic of an algorithm? PTA-3


a) Input b) Program c) Finiteness d) Simplicity
w

 Ans: b) Program
w

6. This is a theoretical performance analysis of an algorithm: PTA-4


a) Priori estimates b) Posteriori testing c) Space factor d) Time factor
 Ans: a) Priori estimates
7. Which of the following algorithmic approach is similar to divide and conquer approach?
a) Insertion sorting b) Dynamic programming PTA-5
c) Selection searching d) Bubble programming
 Ans: b) Dynamic programming
II. Short Answer Questions
1. List the different factors in which the time efficiency of an algorithm its measured
The execution time that you measure in this case would depend on a number of factors such as:
• Speed of the machine PTA - 6
• Compiler and other system Software tools
42

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

• Operating System
• Programming language used
• Volume of data required
2. What are the different phases in the analysis of algorithms and performance ? PTA - 5
Analysis of algorithms and performance evaluation can be divided into two different phases:
1. A Priori estimates : This is a theoretical performance analysis of an algorithm. Efficiency
of an algorithm is measured by assuming the external factors.
2. A Posteriori testing : This is called performance measurement. In this analysis, actual
statistics like running time and required for the algorithm executions are collected.
III. Long Answer Questions
1. Explain the selection Sort Algorithm with an example. QY - 2019
(i) Let us assume a list of n number of values stored in an array. Suppose if we want to search
a particular element in this list, the algorithm that search the key element in the lis among n

n
elements, by comparing the key element with each element in the list sequentially.

l.i
(ii) The best case would be if the first element in the list matches with the key element to be
searched in a list of elements. The efficiency in that case would be expressed as O(1) because

da
only one comparison is enough.
(iii) Similarly, the worst case in this scenario would be if the complete list is searched and the
ka
element is found only at the end of the list or is not found in the list. The efficiency of an
algorithm in that case would be expressed as O(n) because n comparisons required to
complete the search.
vi

(iv) The average case efficiency of an algorithm can be obtained by finding the average number
al

of comparisons as given below:


Minimum number of comparisons = 1
.k

Maximum number of comparisons = n


If the element not found then maximum number of comparison = n
w

Therefore, average number of comparisons = (n + 1)/2


w

(v) Hence the average case efficiency will be expressed as O(n).


2. Write the procedure for selection sort algorithm. PTA-4
w

The selection sort is a simple sorting algorithm that improves on the performance of bubble
sort by making only one exchange for every pass through the list.
Procedure:
i) Start from the first element i.e., index-0, we search the smallest element in the array, and
replace it with the element in the first position.
ii) Now we move on to the second element position, and look for smallest element present in
the sub-array, from starting index to till the last index of sub - array.
iii) Now replace the second smallest identifed in step-2 at the second position in the or original
array, or also called first position in the sub array.
iv) This is repeated, until the array is completely sorted.
Let’s consider an array with values {13, 16, 11, 18, 14, 15}
Below, we have a pictorial representation of how selection sort will sort the given array.

43

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

PART III - ADDITIONAL QUESTIONS

n
I. Choose the best answer: (1 Marks)

l.i
1. 0(1) is an example of
a) Worst case b) Best case c) Average case d) Null case

da
Ans: b) Best case
2. Linear search is also called
a) Quick search b) Sequential search
ka
c) Binary search d) Selection search Ans: b) Sequential search
3. Binary search also called
vi
a) Half-interval search b) Sequential search
c) Unordered search d) Full-interval search
al

Ans: a) Half-interval search


4. Which search algorithm can be done as divide and- conquer search algorithm?
.k

a) linear b ) Binary search c) Sequential d) Bubble


Ans: b ) Binary search
w

5. Which of the following sorting algorithm is too slow and less efficient?
w

a) Selection b) Bubble c) Quick d) Merge


Ans: b) Bubble
w

6. Which of the following programming is used whenever problems can be divided into
similar sub-problems?
a) Object oriented b) Dynamic c) Modular d) Procedural
Ans: b) Dynamic
7. _______is a step-by-step procedure for solving a given problem
a) Program b) Algorithm c) Statements d) Structure
Ans: b) Algorithm
8. Which of the following is a finite set of instructions to accomplish a particular task?
a) Flowchart b) Algorithm c) Functions d) Abstraction
Ans: b) Algorithm
9. The way of defining an algorithm is called
a) Pseudo strategy b) Programmic strategy
c) Data structured strategy d) Algorithmic strategy
Ans: d) Algorithmic strategy

44

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

10. An algorithm that yields expected output for a valid input is called an
a) Algorithmic Structure b) Algorithmic Solution
c) Algorithmic Strategy d) Algorithmic Procedure
Ans: b) Algorithmic Solution
11. Efficiency of an algorithm decided by
a) Definiteness, portability b) Time, Space
c) Priori, Postriori d) Input/output Ans: b) Time, Space
12. Which of the following should be written for the selected programming language with
specific syntax?
a) Algorithm b) Pseudocode c) Program d) Process
Ans: c) Program
13. How many components required to find the space required by an algorithm?
a) 4 b) 3 c) 2 d) 6 Ans: c) 2
14. Which of the following component is defined as the total space required to store certain
data and variables for an algorithm?

n
a) Time part b) Variable part c) Memory part d) Fixed part

l.i
Ans: d) Fixed part

da
15. Which of the following component is defined as the total space required by variables,
which sizes depends on the problem and its iteration?
a) Time part b) Variable part c) Fixed part d) Memory part
ka
Ans: b) Variable part
16. Time and Space complexity could be considered for an
vi

a) Algorithmic strategy b) Algorithmic analysis


al

c) Algorithmic efficiency d) Algorithmic solution


Ans: c) Algorithmic efficiency
.k

17. Which of the following is not a factor use to measure the time efficiency of an algorithm?
w

a) Speed of the machine b) Operating system


c) Programming language d) Designing algorithm
w

Ans: d) Designing algorithm


w

18. How many asymptotic notations are mostly used to represent time complexity of
algorithms?
a) Two b) Three c) One d) Many Ans: b) Three

II. Answer the following questions (2 and 3 Marks)


1. Write a pseudo code for Insertion sort.
Step 1 - If it is the first element, it is already sorted.
Step 2 - Pick next element
Step 3 - Compare with all elements in the sorted sub-list
Step 4 - Shift all the elements in the sorted sub-list that is greater than the value to be sorted
Step 5 - Insert the value
Step 6 - Repeat until list is sorted

45

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

2. Give the examples of data structures.


Examples for data structures are arrays, structures, list, tuples, dictionary.
3. Define- Algorithmic Strategy?
The way of defining an algorithm is called Algorithmic Strategy.
4. Define- algorithmic solution?
An algorithm that yields expected output for a valid input is called an algorithmic solution
5. Define- Algorithm Analysis?
An estimation of the time and space complexities of an algorithm for varying input sizes is
called Algorithm Analysis.
6. Define- Best algorithm?
The best algorithm to solve a given problem is one that requires less space in memory and
takes less time to execute its instructions to generate output.

n
7. Write a note Asymptotic Notations?
Asymptotic Notations are languages that uses meaningful statements about time and space

l.i
complexity.

da
8. Write a note on memoization.
Memoization or memoisation is an optimization technique used primarily to speed up
computer programs by storing the results of expensive function calls and returning the
ka
cached result when the same inputs occur again.
vi
III. Answer the following questions (5 Marks)
al

1. Differentiate Algorithm and program


Algorithm Program
.k

1 Algorithm helps to solve a given problem Program is an expression of algorithm in a


w

logically and it can be contrasted with programming language.


the program
w

2 Algorithm can be categorized based on Algorithm can be implemented by structured


w

their implementation methods, design or object oriented programming approach


techniques etc
3 There is no specific rules for algorithm Program should be written for the selected
writing but some guidelines should be language with specific syntax
followed.
4 Algorithm resembles a pseudo code Program is more specific to a programming
which can be implemented in any language
language

☺☺☺☺☺

46

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

GOVT. SUPPLEMENTARY EXAM – JUNE 2023


Time : 3.00 Hours XII COMPUTER SCIENCE Maximum Marks : 70
Instructions: (1) C  heck the question paper for fairness of printing. If there is any lack of fairness,
inform the Hall Supervisor immediately.
(2) Use Blue or Black ink to write and underline and pencil to draw diagrams.
PART - I
Note : (i) Answer all the questions. 15×1=15
(ii) Choose the most appropriate answer from the given four alternatives and write the
option code and the corresponding answer.
1. The variables in a function definition are called as :
(a) Subroutines. (b) Function (c) Definition (d) Parameters
2. A sequence of immutable objects is called :
(a) Built in (b) List (c) Tuple (d) Derived data

n
3. Containers for mapping names of variables to object is called _______

l.i
(a) Scope (b) Mapping (c) Binding (d) Namespaces
4. The two main factors which decide the efficiency of an algorithm are ________

da
(a) Processor and Memory (b) Complexity and capacity
(c) Time and Space (d) Data and space
ka
5. The Shortcut key used to create new Python program is :
(a) Ctrl+C (b) Ctrl+F (c) Ctrl+B (d) Ctrl+N
vi
6. "clif" can be considered to be the abbreviation of:
(a) nested if (b) if..else (c) else if (d) if..elif
al

7. The function which is called anonymous un-named function :


(a) Lambda (b) Recursion (c) Function (d) Define
.k

8. _________ is used as placeholders or replacement fields which get replaced along with
w

format( ) function.
(a) { } (b) < > (c) ++ (d) ^^
w

9. Pick odd one in connection with collection data type.


w

(a) List (b) Tuple (c) Dictionary (d) Loop


10. The process of creating an object is called as :
(a) Constructor (b) Destructor (c) Initialize (d) Instantiation
11. A table is known as _______
(a) tuple (b) attribute (c) relation (d) entity
12. The clause used to sort data in a database:
(a) SORT BY (b) ORDER BY (c) GROUP BY (d) SELECT
13. The Command used to skip a row in a CSV file:
(a) next() (b) skip() (c) omit() (d) bounce()
14. The module which allows to interface with the Windows operating system:
(a) OS module (b) Sys module (c) CSV module (d) getopt module
15. The most commonly used statement in SQL is:
(a) cursor (b) select (c) execute (d) commit
12  Govt. Question Papers 215

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.
www.kalvikadal.in https://material.kalvikadal.in

Loyola EC – 12th Computer Science

PART - II
Note : Answer any six questions. Question No. 24 is Compulsory. 6×2=12
16. Differentiate - Interface and Implementation. Ln-1
17. What is a pair ? Give an example. Ln-2
18. Write short notes on Tokens. Ln-5
19. List the control structures in Python. Ln-6
20. What are the main advantages of function ? Ln-7
21. What is data consistency? Ln-11
22. Write the difference between table constraint and column constraint. Ln-12
23. Write notes on : Ln-7
(i) MAX() function (ii) MIN() function
24. What is Set in Python? Ln-9
PART - II
Note : Answer any six questions. Question No. 33 is compulsory.6×3=18

n
25. Write any three characteristics of modules. Ln-3

l.i
26. Write a note on Asymptotic notation. Ln-4
27. What are string literals ? Ln-5

da
28. Write a note on if..else Structure. Ln-6
29. Write about composition in functions with an example. Ln-7
ka
30. What are the differences between List and Dictionary ? Ln-9
31. What is the role of DBA? Ln-11
vi
32. Differentiate - Python and C++. Ln-14
33. Write a Python code to check whether a given year is leap year or not. Ln-7
al

PART - IV
Note : Answer all the questions. 5x5=25
.k

34. (a) What is Binary Search? Explain with an example. Ln-4


w

OR
(b) How will you facilitate data abstraction? Explain it with suitable example. Ln-2
w

35. (a) Explain input() and print() functions with examples. Ln-2
OR
w

(b) Explain the scope of variables with an example. Ln-3


36. (a) Explain about string operators in Python with suitable example. Ln-8
OR
(b) What are the different ways to insert an element in a list? Explain with suitable
example. Ln-9
37. (a) Explain the characteristics of DBMS. Ln-11
OR
(b) Explain about SQLite and the steps to be used. Ln-15
38. (a) Write the different methods to read a file in Python. Ln-13
OR
(b) Write any five features of Python. Ln-14
☺☺☺☺☺

216 12  Govt. Question Papers

Please send your Materials & Question Papers to kalvikadal.in@gmail.com (or) Whatsapp - 9385336929.

You might also like