0% found this document useful (0 votes)
4 views5 pages

Computer Science +2 DGE Final Key EM

This document contains the answer key for the HSE Second Year Examination in Computer Science for March/April 2023. It includes multiple parts with questions and answers, covering topics such as Python programming, data manipulation, and database management. The document specifies evaluation criteria and marks distribution for each question.

Uploaded by

C. Adithya
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)
4 views5 pages

Computer Science +2 DGE Final Key EM

This document contains the answer key for the HSE Second Year Examination in Computer Science for March/April 2023. It includes multiple parts with questions and answers, covering topics such as Python programming, data manipulation, and database management. The document specifies evaluation criteria and marks distribution for each question.

Uploaded by

C. Adithya
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/ 5

DIRECTORATE OF GOVERNMENT EXAMINATION, CHENNAI -6

HSE SECOND YEAR EXAMINATION, MARCH / APRIL -2023


COMPUTER SCIENCE ANSWER KEY
NOTE :
1. Answer written only in BLACK or BLUE ink pen should be evaluated.
2. Choose the correct answer and write the option code.
3. In one of them (option or answer) is wrong, then award zero mark
only.
Maximum Marks : 70
PART – I
Answer all questions : 15×1=15
Q.No OPTION ANSWER MARK
1 B Public members 1
2 C Operator 1
3 B Subroutines 1
4 B 3 1
5 D . 1
6 A Hierarchical 1
7 B + 1
8 B Wrapping 1
9 B DROP TABLE 1
10 B MAX( ) 1
11 A Concrete datatype 1
12 D Recursion 1
13 D Binary mode 1
14 A Memorization 1
15 C {1,3,6,9} 1

PART – II
Answer any Six Questions. Question number 24 is compulsory. 6×2=12

16 A tuple is a comma-separated sequence of values surrounded with 1


parentheses.
Ex: lst:=(10,20) or Any Suitable example 1
17 Scope refers to the visibility of variables, parameters and functions in one
2
part of a program to another part of the same program.
18 del command is used to remove the entire string variable. 2
19 In python, for loop uses the range( ) function in the sequence to
specify the initial, final and increment values.
1
(or)
range( ) generates a list of values starting from start till stop-1

Syntax : range(Start, Stop, [step]) 1


20 class is the main building block in Python.class is a template for the object 2
21 A Data Manipulation Language(DML) is a computer programming
language used for adding (inserting), removing(deleting) and 2
modifying(updating) data in a database.

1|Page
22 The default modes of the file reading is text mode, while reading from the
file the data would be in the format of strings. 2

23 [Any four] Charts, Table, Graphs, Maps, Info graphics, Dashboards 2


24 [1,4,9,16,25,36,49,64,81,100] (or) Error Program 2

PART – III
Answer any Six Questions. Question number 33 is compulsory. 6×3=18
25 The class template specifies the interfaces to enable an object to be created 2
and operated properly.
An object’s attributes and behaviours is controlled by sending functions to 1
the object.
26 The given problem will be divided into smaller over lapping sub- 1
problems 1
An optimum solution for the given problem can be achieved by using
result of smaller sub- problem. 1
Dynamic algorithms uses memorization.
27 Ternary operator is also known as conditional operator. 1
It evaluate something based on condition being True or False 1
A Suitable example 1
28 Syntax of While loop
while <condition> :
statements block 1 3
[else :
Statements block 2]
29
ceil( ) floor( ) 2
Returns the smallest integer greater Return the largest integer less than
than or equal to x or equal to x
print(math.ceil(26.7)) 27 print(math.floor(26.7) 26 1
Syntax (or) A suitable Example Syntax (or) A suitable Example

30 The main difference between the csv.reader( ) and DictReder ( ) is in simple


terms csv.reader and csv.writer work with list/tuple, while csv.DictReader and 3
csv.DictWriter work with dictionary.
31 The fetch one ( ) : method returns the next row of a query result set or
None in case there is no row left.
fetch many () : Displaying specified number of records is done by 3
using fetch many( ). This method returns the next number of rows (n) of
the result set.

2|Page
32 str1 =”COMPUTER”
index = len (str1)
for i in str1 :
print (str1 [0: index]) 3
index - =1
(or ) A suitable python program to display the given pattern.
33 1. Type the c++ program in notepad and save it as with .cpp extension.
2. Type the python program and save it as with .py extension.
3. Click the Run Terminal and open the command window 3
4. Type the command python <program_name.py> -i <c++ program>

PART – IV

Answer all the questions. 5×5=25


34 • List is constructed by placing expressions within square brackets
(a) separated by commas. List can store multiple values. Each value can be 2
any type and can even be another list.
• Any way of bundling two values together into one can be considered as a 2
pair. Lists are a common method to do so. Therefore List can be called
as Pairs.
• A Suitable example 1
(OR)
34 Linear Search also called sequential search is a sequential method for 2
(b) finding a particular value in a list.
Pseudo Code
• Traverse the array using for loop.
• In every iteration, compare the target search key value with the current 2
value of the list.
• If the values match, display the current index an value of the array.
• If the values do not match, move on the next array element.
• If no match is found, display the search element not found.
A Suitable example 1
35 Python breaks each logical line into a sequence of elementary lexical
(a) components known as Tokens. The normal token types are
• Identifiers 1
• Keywords 1
• Operators 1
• Delimiters 1
• Literals. 1
An Explanation with suitable example
(OR)

3|Page
35 i) id () – Returns the “ Identity” of an object id 1
(b) (object) – example
ii) chr ()- Returns the Unicode character for the given ASCII value. 1
chr(i) - example
iii) round ( ) – Returns the nearest inreger to its input round 1
( nuber[,ndigits]) - example 1
iv) type ( ) – Returns the type of object for the given single object
type (object) - example 1
v) pow ( ) Returns the computation of ab i.e (a **b) a raised to the
power of b pow (a,b) – example

36 In Python, a Tuple can be defined inside another Tuple called Nested tuple.
(a) In a nested tuple, each Tuple is considered as an element. The for loop will 3
be useful to access all the elements in a nested tuple.
A Suitable Example 2
(OR)
36 The types of relationships :
(b) 1. One-to-One Relationship
2. One-to-Many Relationship 1
3. Many-to-One Relationship
4. Many-to-Many Relationship
Explanation for each 4

37 Syntax :
(a) <opts>,<args> =getopt.getopt 1
(argv,options,[Long – options])

argv – Explain
Options – Explain 2
Long options – Explain

getopt( ) method returns value consisting of two elements. Each of these


values are stored separately in two different list (arrays) opts and args. Opts 1
contains list of splitted strings like mode and path. args contains error string.
if at all the comment is given with wrong path or mode. args will be an
empty list if there is no error.

Example :
opts. args =getopt(argv,”i:”,[‘ifile=’] 1

(OR)

4|Page
37 Differentiate DBMS and RDBMS (Any Five)
(b) Basis of comparison DBMS RDBMS
Expansion Database Relational Data Base
Management System Management system
Data Storage Navigational model Relational model
Date redundancy Exhibit Not present
Normalization Not performed It uses normalization to
reduce redundancy
Data access Consumes more Faster, compared to
times DBMS.
Keys and indexes Does not use. used to establish 5
relationship. Keys are
used in RDBMS
Transaction inefficient Efficient and secure
management
Distributed Databases Not supported Supported by RDBMS
Example Dbase, FoxPro SQL server,
Oracle,mysql,MariaDB,S
QLite.
38 Differences between Histogram and Bar Graph (Any Five)
(a)
Histogram Bar Graph
Displays data by way of bars to Data that uses bars to compare
show the frequency of numerical different categories of data
data
Frequency distribution of Diagrammatic comparison of
continuous variables. discrete variables
Presents numerical data Shows categorical data 5
No gap between the bars Proper spacing between the bars.
categorized together, to represent Items are considered as individual
ranges of data entity.
Width of the rectangular blocks Width of the bars are always same
may or may not be same

(OR)
38 Continue statement is used to skip the remaining part of a loop and start 2
(b) with next iteration. The syntax - Continue
Explanation - continue statement 1
A suitable example 2

5|Page

You might also like