0% found this document useful (0 votes)
17 views10 pages

QP-Computer Science-12-Common Exam

The document outlines the general instructions for the Common Examination 2024 for Class 12 Computer Science, including the structure of the question paper, which consists of 35 questions divided into 5 sections with varying marks. It specifies the reading time, total marks, and the requirement to write the question serial number before answering. Additionally, it includes sample questions and tasks related to programming, databases, and theoretical concepts in computer science.

Uploaded by

moammed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views10 pages

QP-Computer Science-12-Common Exam

The document outlines the general instructions for the Common Examination 2024 for Class 12 Computer Science, including the structure of the question paper, which consists of 35 questions divided into 5 sections with varying marks. It specifies the reading time, total marks, and the requirement to write the question serial number before answering. Additionally, it includes sample questions and tasks related to programming, databases, and theoretical concepts in computer science.

Uploaded by

moammed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

CHENNAI SAHODAYA SCHOOLS COMPLEX

General Instructions COMMON EXAMINATION-2024


 Please check that this question Class-12
paper contains 9 printed pages.
(COMPUTER
 Please check that this question paper SCIENCE - 083)
contains 35 questions.
Roll No.:  Please write down the serial number of the question before attempting
Maximumit.Marks: 70
 Reading time of 15 minutes is given to read the question paper
Date: 12/01/2024 alone.
Time No writing
allowed: 3 hours
during this time.
Qno  The paper is divided into 4 Sections-
Questions
A, B, C, D and E. Marks
SECTION
 Section A, consists of 18 questions A Each question carries 1 Mark.
(1 to 18).
1 State True or False:
 Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks. 1
 Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
The data type of a variable in Python can be modified during the execution of the
 Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
program.
 Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
2 In atable
Allinprogramming questions
MYSQL database, are to beEname
an attribute answered using Python
of datatype Language
varchar(6) only.
has the value 1
“Keshav”. But the user wants to update the name “Keshav” into “SHANMUGA
RAJAN”. While executing the Command it says the following error message.

ERROR 1406 (22001): Data too long for column 'Ename' at row 1

How to you overcome the above error. And also write the SQL command to solve the
above error.

3 Evaluate the following: 1


print(2*7+2**3-2/5+3%4)
4 Write the Cartesian product of Passenger and Flight tables. [Passenger X Flight] 1

PASSENGER
PNO NAME GENDER
1001 Suresh MALE
1002 Anita FEMALE
1003 Nita FEMALE

FLIGHT
FNO START END F_DATE FARE
F104 KOLKATA MUMBAI 2021-12-20 4500
F105 DELHI BENGALURU 2021-01-12 5000

Page 1 of 9
5 Select the correct output of the code: 1
s="GOOD MORNing"
print(s.capitalize(),s.title(),s.casefold(),s.swapcase(),end="!")

Options:
a) Good morning Good Morning good morning good MORNing!
b) Good morning Good Morning good morning good mornING
c) Good morning! Good Morning! good morning! good mornING!
d) Good morning Good Morning good morning good mornING!
6 Name the transmission media best suitable for connecting to desert areas ? 1

7 Write an appropriate statement to check if value 200 exists in the following dictionary: 1
mydict={'a':100,'b':200,'c':300}
print( )

The output of the print statement is True.

8 Consider the statements given below and then choose the correct output from the given 1
options:
x='IncredibleIndia'[-2:-7:-1]
print (x, x[2: -2],sep='$')

a) idnIIe$n
b) idnIe$n
c) idn Ien$
d) idnIen$
9 What will be the output of the following code? 1
X, Y =(1,2), (3,4)
Y, X=X, Y+(2,)
print(X, Y)

a) TypeError- Tuple does not support item assignment


b) (3, 4, 2) (1, 2)
c) TypeError- Can only concatenate tuple to tuple
d) (1, 2, 2) (1, 2)
10 What possible outputs(s) will be obtained when the following code is executed? 1

from random import randint


Vibgyor=[ ['V','Violet'],['I','Indigo'],['B','Blue'],['G','Green'],['Y','Yellow'], ['O','Orange'],
['R','Red'] ]
for i in range(3):
first=randint(0,1)
last=randint(1,2)+1
print(Vibgyor[last-first], end= ':')

Options:
a) ['G','Green']:['G','Green']:['Y','Yellow']:
b) ['G','Green']:['B','Blue']:['G','Green']:
c) ['V','Violet']:['B','Blue']:['B','Blue']:
d) ['I','Indgo']:['B','Blue']:['B','Blue']:

Page 2 of 9
11 Fill in the blank: 1
is a communication methodology designed to deliver both
voice and multimedia communications over Internet protocol.

a) VoIP b) SMTP c) PPP d)HTTP


12 Consider the code given below: 1

b=100
def CSSC(a):
#Missing statement
b=b+a
CSSC(20)
print(b)

Which of the following statements should be given in the blank for #Missing
Statement, if the output produced is 120?

Options:
a) global a
b) global b=100
c) global b
d) global a=100
13 State True or False . 1
‘r’ mode, opens a file for reading only. The file pointer is placed at the beginning of the
file. If the specified file does not exist, it will generate ‘File Not Found Error’.

14 Which of the following statements is FALSE in a relational database? 1


a) Any candidate key is eligible to become a primary key.
b) Data dictionary is a file containing metadata. i.e, data about data.
c) A candidate key that is not a primary key is a foreign key.
d) Foreign key is a non-key attribute, whose values are derived from the primary key
of some other table.
15 Fill in the blank. 1
is a device that forwards data packets from one network to another.

16 An is caught in the try block and handles in except block. 1

Q17 and Q18 are ASSERTION AND REASONING based


questions. Mark the correct choice as.
a) Both A and R are true and R is the correct explanation for A.
b) Both A and R are true and R is not the correct explanation for A.
c) A is True but R is False.
d) A is false but R is True.
17 Assertion(A):Text file stores information in ASCII or Unicode characters. 1

Reason(R) :In text file, there is no delimiter for a line.


18 Assertion(A): Dictionaries are mutable, hence its keys can be easily changed. 1

Reason(R) : Mutability means a value can be changed in place without having to create
new storage for the changed value.
SECTION B
19 a) What any one difference between circuit switching and packet switching? 2
b) Write the full form: NIU,URL
OR
a) Write the full form : MODEM, GPRS
b) What is Web Hosting?
20 Ranjit has written a code to input a number and check whether it is even number or odd 2
number. His code is having errors. Rewrite the correct code and underline the correction
made.

Page 3 of 9
Def Check_No( N ):

status = N%2
return
# main code
num=int(input(“Input enter a number to check:))
K=Check_No(num)
if k = 0:
print(“This is EVEN
Number”) else:
print(“This is ODD Number”)

21 A dictionary called vehicle with the following key:value pairs: 2

veh={vtype:[brand,model,year,price], vtype:[brand,model,year,price], … }
Write a program to accept the dictionary and counting the number of vehicles released in
2020. Also display all vehicles in alphabetical order with its brand name.
OR
Write a function INDEX_TUPLE(T), where T is the list of tuple elements passed as
argument to the function. The function returns another list named ‘indexList’ that stores
the indices of all Non-Zero Elements of T.
For example:
If L contains (12,4,0,11,0,56)
The indexList will have - [0,1,3,5]

22 Predict the output of the following code: 2


def Qud_Mod (L1):
L1.extend([33,52])
for i in
range(len(L1)): if
L1[i]%10==0:
L1[i]=L1[i]/5
elif L1[i]%2==0:
L1[i]=L1[i]//10
else:
L1[i]=L1[i]%10

L=[100,212,310]
print(L)
Qud_Mod(L)
print(L)
23 Answer the following: 2
a) Name the package imported for connecting Python with MySQL database.
b) What is the purpose of cursor object?

OR
a) Write the output of the code given below:
list= [10, 20, 30, 40, 50, 60, 70, 80]
print(list[ : : -2])

Page 4 of 9
b) Write the output of the code given below:
squares = {1: 1, 2: 4, 3: 9, 4: 16, 5: 25}
print(squares.pop(4))
24 a) Write a command to create the following table: 2
Table: Project_info
Field Datatype Size Constraints
Stud_roll integer 3 Not to be left empty and
unique
Name Variable character 15 Not to be left empty
Project_name Variable character 20 Not to be left empty
and unique
Number_of_students Integer 4 Should be more than 1
Date_of_submission Date Default date is
6th June,2022

b) Write a command to add primary key constraint to stud_roll field.

OR
a) John is working in a database named GAME, in which he has created a
table named “Sports” containing columns SportId, SportName,
no_of_players, and category.

After creating the table, he realized that the attribute, ‘category’ has to be
deleted from the table and a new attribute ‘TypeSport’ of data type string
has to be added. This attribute ‘TypeSport’ cannot be left blank. Help John
write the commands to complete both the tasks. Write the complete SQL commands to
solve it.
25 Write the output of the code given below: 2
def IamERROR(denom=10):
try:
numerator=50
quotient=(numerator/denom)
print ("Division performed
successfully") except ZeroDivisionError:
print ("Denominator as ZERO is not
allowed") else:
print ("The result of division operation is ",
quotient) finally:
print ("OVER AND OUT")

IamERROR(5)
IamERROR()
IamERROR(0)

SECTION C
26 Predict the output of the Python code given below:
def Change_text(Text):
T=" "
for K in range(len(Text)):
if Text[K].isupper():
T=T+Text[K].lower();
elif K%2==0:
T=T+Text[K].upper()
else:
T=T+T[K-1]
print(T)
Text="Good go Head ?*& 489" #Each word is separated by single space.
Change_text(Text)

Page 5 of 9
27 Consider the following tables: BANK and BRANCH. 1+2

Table1: BANK
ACode Name Type
A01 Amrita Savings
A02 Parthodas Current
A03 Miraben Current

Table2: BRANCH
Acode City
A01 Delhi
A02 Mumbai
A01 Nagpur

a) What will be the output of the following statement?

SELECT * FROM BANK NATURAL JOIN BRANCH;

b) Write the output of the queries (i) to (iv) based on the table, TECH_COURSE
given below:

i) SELECT DISTINCT TID FROM TECH_COURSE;

ii) SELECT TID, COUNT(*), MIN(FEES) FROM TECH_COURSE


GROUP BY TID HAVING COUNT(TID)>1;

iii) SELECT CNAME FROM TECH_COURSE WHERE FEES>15000


ORDER BY CNAME;

iv) SELECT AVG(FEES) FROM TECH_COURSE WHERE FEES


BETWEEN 15000 AND 17000;
28 Write a function Count_words() in Python that counts the number of words containing 3
digits in it present in a text file “myfile.txt”.

Example: If the “myfile.txt” contents are as follows:


This is my 1st class on Computer Science. There are 100 years in a Century. Student1 is
present in the front of the line.
The output of the function should be: 3
OR

Write a function Count_CAR() to count and display number of lines starting and ending
with same letter in “car.txt”. Also, calculate the average word size.
[Note: Each line end with full stop. Each word is separated by a single space or full stop]
Example:
File content: Ratha madam has a racecar.
She loves to drive the car.

Output should be:


Number of lines= 1
Word average = 3.8

Page 6 of 9
Note: Calculating word average as follows:
Line1: 5+5+3+1+7=21
Line2: 3+5+2+5+3+3=21 = (42/11)=3.8
29 Write the outputs of the SQL queries (a) to (c) base on the relations
Emp and Eaddress given below: 3
Table1: Emp
No Name Age Dept Salary Commission Gender
1 Anuj 23 Comp 4500 3000 M
2 Radha 34 Sales 5600 2000 F
3 Rekha 32 Admin 7600 2000 F
4 Leena 54 Advt 8000 5000 F
5 Rajan 43 Comp 9000 5000 M
6 Prakash 34 Sales 7500 1200 M
7 Mukesh 56 Admin 9500 2100 M
8 Poonam 31 Admin 2500 2500 F
9 Shweta 33 Advt 1200 5000 F

Table2: Eaddress
No Address City
1 24,ABC Enclave Chennai
5 27-k,Westend Mumbai

a) select e.no,e.name,e.salary,a.address,a.city from emp e, Eaddress a


where e.salary>5000 and a.city='Mumbai' and a.no=e.no;
b) Select no,name, dept from emp where name LIKE “_ _ e%”;
c) Select dept,count(no),sum(salary) from emp where
gender=”M” group by dept HAVING sum(salary)>10000;
30 A programmer wants to prepare a stack from given list of integer elements only for the 3
numbers which are divisible by 3. Help him to write user defined functions to perform
the following operations based on this list.
o Traverse the content of the list and push the numbers into the stacks which are
divisible by 3.
o Pop and display the content of the stack
Example: If the sample content of the list
is:
N=[3,5,10,12,21,23,45,56,60,78]

Sample output is:


78 60 45 21 12 3
SECTION D
31 Write SQL queries for (i) to (iv) based on the tables PASSENGER and FLIGHT given 4
below:
Table: PASSENGER
PNO NAME GENDER FNO
1001 Suresh MALE F101
1002 Anita FEMALE F104
1003 Harris MALE F102
1004 Nita FEMALE F103

Table: FLIGHT
FNO START END F_DATE FARE
F101 MUMBAI CHENNAI 2021-12-25 4500
F102 MUMBAI BENGALURU 2021-11-20 4000
F103 DELHI CHENNAI 2021-12-10 5500
F104 KOLKATA MUMBAI 2021-12-20 4500

Page 7 of 9
F105 DELHI BENGALURU 2021-01-12 5000

Page 8 of 9
i) Write a query to display the NAME, corresponding FARE and
F_DATE of all passengers who have flight to start from “DELHI”.

ii) Insert the following record into the table: Passenger.


PNO-1005, NAME-Kavi, GENDER-FEMALE, FNO-F104

iii) Write a query to delete the records of flights which ends at ”MUMBAI”.

iv) Add a column REMARKS in FLIGHT table with data type


as varchar with 30 characters.
32 Write a program to create a CSV file called ‘data.csv’ to store four students details like 4
name, age and gender. Also write functions: Create(), Display() and Search().

[Note: To search a record, whose name is inputted by the user.]

SECTION – E
33 Indian School, in Mumbai is starting up the network between its different wings. 5
There are Four Buildings named as SENIOR, JUNIOR, ADMIN and HOSTEL as
shown below:

CRICKET ADMIN SENIOR


GROUND
JUNIOR HOSTEL

And also they have a Cricket ground 2000 KM away from the school wing.

The distance between various buildings is as follows:

ADMIN TO SENIOR 200m


ADMIN TO JUNIOR 150m
ADMIN TO HOSTEL 50m
SENIOR TO JUNIOR 250m
SENIOR TO HOSTEL 350m
JUNIOR TO HOSTEL 350m
PLAYGROUND TO SCHOOL WING 2000 Kilometer

Number of Computers in Each Building:

SENIOR 130
JUNIOR 80
ADMIN 160
HOSTEL 50

1) Suggest the cable layout of connections between the buildings and the
topology thus formed (school wings only).

2) Suggest the most suitable place (i.e. building) to house the server of this
school, provide a suitable reason.

3) Suggest the placement of the following devices with justification.


i) Repeater
ii) Hub /Switch

Page 9 of 9
4) The organization also has Inquiry office in another city about 50-60 Km away in a
Hilly Region. Suggest the suitable transmission media to interconnect the school
and Inquiry office out of the following
o Fiber Optic Cable
o Microwave
o Radio wave
What would be the type of network thus formed?

5) Which fast and very effective wireless transmission medium should preferably
be used to connect the school wing at MUMBAI with the Cricket ground for live
Telecast?

1+4
34 a) What is pickling and unpickling?

b) Write a function CREATE_DIC() to store N records in a binary file “ISRO.DAT”


and write an another function SEARCH_DIC() to search a record whose name is
“Chandrayan_3”.

Consider the following definition of dictionary:


Dictionary={“rocketno”:rno, “rocketname”:name, “speed”:speed}
[Note: Accept the values from user]

OR

a) What are standard file streams? Explain it.


b)Write a function CREATE_TUPLE() to store N tuples in a binary file
‘HAPPY.DAT’ and write an another function, SEARCH_TUPLE(temp), that accepts
‘temp’ as parameter and displays all the records from binary file ‘HAPPY.DAT’, that
have the value of ‘rollno’ as ‘temp’.
Consider the following definition of tuple: tup=(rollno, name, mark)
35 a) What are the limitations of file system that can be overcome by a relational DBMS? 1+4

b) Write a function pwd_create() to create ‘password.csv ‘ which accepts user id and


password. Write a another function search() to accept the user id and print the password,
if the user id is present, otherwise print the error message “user id is not present”

OR

a) Define the term Degree and Cardinality with respect to RDBMS. Give one example
to support your answer.

b) Write a program to integrate Python with MySQL to create a table, insert the records
(two records) in to the table and display it.

Table name: emp


Record Type: Eno-integer, Name-string of 20 characters, Salary-float.

Note: The values of fields Eno, Name and Salary has to be accepted from
the user.

Name the following to establish connectivity between Python and Mysql:


Host=”localhost”, user name=”root”, password="tiger", db="employee".

END OF PAPER

Page 10 of
9

You might also like