0% found this document useful (0 votes)
20 views

MSSC -CS QP

computer science question paper class 12 cbse

Uploaded by

clat25materials
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)
20 views

MSSC -CS QP

computer science question paper class 12 cbse

Uploaded by

clat25materials
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/ 14

MADURAI SAHODAYA SCHOOLS COMPLEX

PRE BOARD EXAMINATION


ACADEMIC YEAR 2024-2025
ROLL NO: SUBJECT CODE: 083
GRADE : XII SUBJECT: COMPUTER SCIENCE
MAX MARKS : 70 DURATION: 3 Hrs.

General Instructions:

 This question paper contains 37 questions.

 All questions are compulsory. However, internal choices have been provided

in some questions. Attempt only one of the choices in such questions

 The paper is divided into 5 Sections- A, B, C, D and E.

 Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.

 Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.

 Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.

 Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.

 Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.

 All programming questions are to be answered using Python Language only.

 In case of MCQ, text of the correct answer should also be written.


Q No. Section-A (21 x 1 = 21 Marks) Marks
1 What will be the output of the following code snippet? 1
a="CBSE DATE-SHEET"
print(a[:-11:])
A. CBSE
B. DATE-SHEET
C. DATE
D. CBSE DAT
2 1
If my_dict is a dictionary as defined below, then which of the following
statements will raise an exception?

my_dict={‘X’:48,’XI’:50,’XII’:89}

A. my_dict.get(48)

B. my_dict.get('X')

C. my_dict.update({'XII':95})

D. my_dict.pop()
3 1
Which SQL command can change the cardinality of an existing relation?

A. ALTER

B. UPDATE

C. INSERT INTO

D. SELECT
4 What will be the output of the following code? 1
A='ncert.nic.in'
print(A.title())
A. 'Ncert.Nic.In'
B. 'Ncert.nic.in'
C. 'NCERT.NIC.IN'
D. ‘Ncert.Nic.IN’
5 Identify the output of the following code snippet: 1

2**2+5**2+10//2.0

A. 34
B. 34.0
C. 19
D. 19.0

6 State True or False: 1


The finally block is used to ensure that certain code runs after the try and
catch blocks, regardless of whether an exception was thrown.
7 What will be the output of the following code? 1
a=b=20
def check(a):
global b
b=15
a=20
a-=b
print(b,end='#')
return a
a=check(2)
print(a,b,sep='$')

A. 15#5$21
B. 15#5$15
C. 15#5$20
D. 16#4$21

8 Which of the following statements about IP addresses is true? 1

A) An IP address is used to identify a computer on a network.


B) IP addresses are only used in local networks.
C) There are only IPv6 addresses available for networking.
D) IP addresses are permanent and cannot be changed.
9 Which of the following is true about the 'Hub'? 1

A) It operates at the Network Layer of the OSI model.


B) It is used to connect multiple computers in a network.
C) It filters data before forwarding it.
D) It provides error correction.
10 Which of the following SQL functions does not ignore NULL values? 1
A) SUM()
B) COUNT()
C) AVG()
D) MAX()
11 Identify the output of the following code snippet: 1

A='MSSC - MDU'

b=A.split('S')

print(b)

A. ['M', '', 'C - MDU']


B. ['M', 'C - MDU']
C. ['M', '', '','C - MDU']
D. ['MSSC', '-', 'MDU']

12 State True or False: 1


In SQL, the WHERE clause is used to filter records based on a specified
condition.
13 Which of the following statements is true about a Foreign Key? 1

A) A foreign key uniquely identifies records within its own table.

B) A foreign key is used to establish a relationship between two

tables.

C) A foreign key cannot contain NULL values.

D) A foreign key must be the primary key of the same table.


14 Which type of network uses Circuit Switching for establishing 1
communication?

A) Telephone network.

B) Internet.

C) Local Area Network (LAN).

D) Wi-Fi networks.
15 Which of the following data types is more efficient in terms of storage when 1
the length of the string is highly variable?

A) CHAR

B) VARCHAR

C) TEXT

D) DATE
16 Which of the following is true about the with open() statement in Python? 1

a) It is used to open files in binary mode


b) It automatically closes the file after the block of code is executed
c) It is used to open a file for writing
d) It does not require closing the file
17 What is the output of the expression? 1
a='Computer Sci'
a1=a.partition('C')
print(a1)
A. ('', 'C', 'omputer Sci')
B. ('Computer S', 'c', 'i')
C. ('Computer Sc', 'i', '')
D. ('Computer S', 'I',’’)
18 Which of the following is the correct syntax to rename a table using the 1
ALTER command in SQL?

A) ALTER TABLE <old_table_name> RENAME TO <new_table_name>


B) ALTER TABLE <old_table_name> CHANGE NAME TO <new_table_name>

C) ALTER TABLE <old_table_name> SET NAME = <new_table_name>

D) ALTER TABLE <old_table_name> UPDATE <new_table_name>


19 Which of the following mode in the file opening statement creates a new file 1
if the file does not exist?
(a) r+ (b) w+ (c) a+ (d) Both (b) and (c)
20 Assertion (A): The HAVING clause in SQL is used to filter the results after 1
grouping the data with GROUP BY.
Reason (R): The WHERE clause can be used to filter grouped data in SQL.
21 Assertion (A): Default arguments in Python allow you to specify default 1
values for parameters in a function.

Reason (R): A default argument is used only when the caller does not
provide a value for that argument.
Q No. Section-B (7 x 2 = 14 Marks) Marks
22 What advantages do tuples have over lists? 2
23 Difference between identity operator and membership operator. Give some 2
examples.
24 If D1={‘Rollno’:’A12’,’Class’:12,’Gender’:’F’} and 2
D2={‘Grade’:’A’,’Mark’:450}
I) Find the output from the following code:
a) A=D1.get('12','Class') What is the value of A?
b) B=D1.popitem() What is the value of B?
OR
II) If L1=[1,2,3,2,1,2,4,2, . . . ], and L2=[10,20,30, . . .], then
a) Write a statement to insert all the elements of L2 at the end of
L1.
b) Write a statement to sort the elements of list L1 in ascending
order.
25 Identify the incorrect output(s) of the following code. Also write the minimum 2
and the maximum possible values of the variable b.
import random
City=['Chennai','Madurai','Trichy','Coimbatore']
pop=[12000,25000,32000,23000]
a=random.randint(1,2)
b=random.randrange(0,4)
for i in range(a,b):
print(City[i],pop[a],sep='#')
a. Trichy#32000
b. Madurai#25000
Trichy#25000
c. Madurai#32000
d. Madurai#25000
26 Rewrite the following code in Python after removing all the syntax errors. 2
Underline each correction done in the code.
def factorial(n)
f=+i
return f
n=5
f1=factorial(5)
Print(f)
27 I. 2
A) What constraint should be applied on a table column so that duplicate
values are not allowed in that column, but NULL is allowed.
B) Write an SQL command to remove the Primary Key constraint from
a table, named MOBILE. M_ID is the primary key of the table.
OR
II.
A) Write an SQL command to make the column M_ID the Primary Key
of an already existing table, named MOBILE.
B) What constraint should be applied on a table column so that NULL is
not allowed in that column, but duplicate values are allowed.
28 (i) Write the full forms of the following: 2
(a) SMTP
(b) VOIP
(ii) Which protocol is used in creating a connection with a remote machine?
Q No Section-C (4 x 3 = 12 Marks) Marks
29 Write a function COUNT() in Python to read from a text file 'Anthem.txt' and 3
display the count of the letter 'a' in each line.
Example: If the file content is as follows:

A national anthem is a patriotic musical


composition symbolizing and evoking eulogies of
the history and traditions of a country or nation.

The COUNT() function should display the output as:


Line 1 : 5
Line 2 : 1
Line 3 : 4
Or
Write a function Ending_with_L() in Python, which should read a text file
'Anthem.txt' and then display lines ending with 'l'.
Example: If the file content is as follows:

A national anthem is a patriotic musical


composition symbolizing and evoking eulogies of the history
and traditions of a country or nation.
The majority of national
anthems are marches.

Then the output should be


A national anthem is a patriotic musical
The majority of national
30 A list contains following record of course details for a University : 3
[Course_name, Fees, Duration]
Write the following user defined functions to perform given operations on the
stack named 'Univ' :
(i) Push_element() To push an object containing the
Course_name, Fees and Duration of a course, which has fees
greater than 100000 to the stack.
(ii) Pop_element() To pop the object from the stack and display it.
Also, display “Underflow” when there is no element in the
stack.
For example :
If the lists of courses details are:
[‘BBA’,250000,3]
[‘MBA’,200000,4]
[‘BA’,100000,5]

The stack should contain:


[‘MBA’,200000,4]
[‘BBA’,250000,3]
OR
A dictionary, d_city contains the records in the following format : {state:city}
Define the following functions with the given specifications :
(i) push_city(d_city): It takes the dictionary as an argument and
pushes all the cities in the stack CITY whose states are of more
than 4 characters.
(ii) pop_city(): This function pops the cities and displays "Stack
empty" when there are no more cities in the stack.
31 Predict the output of the following code: 2+1
def sample(a1):
for i in a1:
if 'hi' in a1:
a1[i]=a1[i]+20
if 'hello' not in a1:
a1[i]=a1[i]-20
elif 'hi' in a1:
a1[i]=a1[i]-30
return a1
a={'hi':45,'hello':100}
a=sample(a)
print(a)
or
Predict the output of the following code:
a=[2,5,6,9,18]
for i in range(len(a)):
if 2%a[i]==0:
a[i]+=a[i]
if a[i]%2==0:
a[i-1]=2
print(a.count(i),a,sep='#')
Q No. Section-D (2 x 4 = 8 Marks) Marks
32 Write a Program in Python that defines and calls the following user defined 4
functions:
i) APPEND() – To add two records of book to a CSV file “BOOK.csv”.
Each record consists of a list with field elements as bookid, bname
and price to store book id, book name and book price respectively.
ii) DISP() – To count and display the number of records in the
following format. Books above price 500 :
33 Consider the table ORDERS as given below 4

Write the following queries:


i. Write an SQL query to count the number of orders placed by each
customer.
ii. To display the distinct customerID from the Orders table.
iii. To display the total Quantity for each Product, excluding Products
with total Quantity more than 2.
iv. Write an SQL query to retrieve all orders placed between 2024-
11-01 and 2024-11-04.
Or
Write the Output of the following SQL queries:
i. SELECT CUSTOMERID,SUM(TOTALAMOUNT) FROM ORDERS
GROUP BY CUSTOMERID;
ii. SELECT DISTINCT(COUNT(CUSTOMERID)) FROM ORDERS;
iii. SELECT PRODUCT,QUANTITY FROM ORDERS WHERE PRODUCT
LIKE ‘%O%’ OR QUANTITY >1;
iv. SELECT ORDERID,CUSTOMERID FROM ORDERS WHERE PRODUCT
IN(‘MOUSE’,’LAPTOP’) and TOTALAMOUNT<>100;
34 Consider the following tables:
Table : Student
4

Table : Sports
ROLLNO GAMENAME GRADE Fees
11A05 CRICKET A 15000
11A06 FOOTBALL B 25000
11A05 NULL NULL 12000
I. To display the Natural join of these two tables.
II. To increase students age of all students by 3 which have mobile
no ends with 4;
III. To display names (SName and FName) of students their
Gamename is not known.
IV. To display the details of students whose fees is in the range of
15000 to 20000 (both values included).
or
Write the output for SQL query:
SELECT SNAME,DOB,GRADE FROM STUDENT,SPORTS WHERE
STUDENT.ROLLNO=SPORTS.ROLLNO;
35 Aarya has created a table named Emp in MySQL: 4
EmpNo – integer
EmpName – string
Age– integer
Salary – integer
Note the following to establish connectivity between Python and MYSQL:
• Username - root
• Password - tiger
• Host - localhost
The Emp table exists in a MYSQL database named company. The details of
Emp table (EmpNo, EmpName, Age and Salary) Aarya wants to display All
Records of Emp relation whose age is greater than 55.
Help Aarya to write program in python.
Q No. Section-E (3 x 5 = 15 Marks) Marks
36 Surya is a manager working in a recruitment agency. He needs to manage 5
the records of various candidates. For this, he wants the following
information of each candidate to be stored:
- Candidate_ID – integer
- Candidate_Name – string
- Designation – string
- Experience – float
- Salary - int
You, as a programmer of the company, have been assigned to do this job
for Surya.
(I) Write a function to input the data of a candidate and append it
in a binary file.
(II) Write a function to update the data of candidates whose
experience is more than 10 years and to increase their salary
by 5%.
(III) Write a function to read the data from the binary file and to
display the candidates whose experience is more than 10
years.
37 OMS International School, Madurai has different wings Administrative Block, 5

Sai Block, Krishna Block and Amritha Block as shown in the diagram.
K
Amrita
Block R

A I
D DELHI
M S BRANCH
I
Sai Block N H

The school also has a branch in Delhi. The school management wants to
connect all the blocks as well as all the computers of each block.

Distance between the blocks are as follows:


Amrita to Admin 200 m
Amrita to Sai 250 m
Amrita to Krishna 120 m
Krishna to Admin 8m
Krishna to Sai 230 m
Sai to Admin 300 m
Number of computer in each blocks are as follows:
Amrita 250
Admin 300
Sai 75
Krishna 152
Based on the above specifications, answer the following questions:
(i) Suggest the kind of network required(out of
PAN,LAN,MAN,WAN) for connecting
a) Sai block with Admin Block
b) Krishna Block with the Admin Block
(ii) Suggest the topology and draw the most suitable cable layout
for connecting all the blocks of Madurai Branch.
(iii) Out of the four blocks on campus, suggest the location of the
server that will provide the best connectivity. Explain your
response.
(iv) Is there a requirement of a repeater in the given cable layout?
Why/ Why not?
(v) Which hardware device will you suggest to connect all the
computers within each building?

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy