Computer Science +2 DGE Final Key EM
Computer Science +2 DGE Final Key EM
PART – II
Answer any Six Questions. Question number 24 is compulsory. 6×2=12
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
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
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
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
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