0% found this document useful (0 votes)
86 views8 pages

Class 12 Cs Qp 3rd Preboard

Uploaded by

aayannkjain
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)
86 views8 pages

Class 12 Cs Qp 3rd Preboard

Uploaded by

aayannkjain
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/ 8

SAINIK SCHOOL AMARAVATHINAGAR

III PREBOARD EXAMINATION 2024-25


DATE: COMPUTER SCIENCE (083) MAX
MARKS: 70
CLASS: XII MAX TIME: 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. State True or False: If D and D1 are dictionaries, D1 + D will merge them. (1)
2. Select the correct output of the code: (1)
str="annual examination 2024"
t=str.partition("examination")
for i in t:
print((i.strip()).title(),end=”--“)
(A) Annual--Examination--2024-- (B).Annual--2024--
(C) Annual2024-- (D) Annual--Examination2024--
3. What will be the output of the following statement: (1)
print(not 5+ 5-5*5+5*True)
(A) True (B)-15
(C) False (D) Error
Consider the statements given below and then choose the correct output . (1)
4.
s="Computer Science with Python"
s[9:-9][5:].split()
(A) 'ce wi' (B) Error (C) ['ce’,‘wi'] D) ['nce’, ‘wit'].
Consider the statements given below and then choose the correct output . (1)
5.
S = "202302030231",
J=0
while S!=””
S = S[1:-1]
J+=0
print(J)
(A) 1 (B) 12 (C) 13 (D) 0
Given the following tuple t=(2,45,6) What should be output of given (1)
6.
statements:
>>> (t*3)[4:-2]
>>> (t*2)[1:3]
(A) error, (45, 6, 2) (B) (45, 6, 2) ,error
(C) error, error (D) (45, 6, 2), (45, 6)
7. Select the output of the code given below : (1)
dict1={ 1:["Rohit",20], 2:["Siya",90] }
dict2={ 1:["Rahul",95], 5:["Rajan",80] }
dict1.update(dict2)
print (dict1.values())
(A) { 1:["Rohit",20], 2:["Siya",90] , 5:["Rajan",80] }
(B) { 1:[ Rahul",95], 2:["Siya",90] , 5:["Rajan",80] }
(C) { 2:["Siya",90] , 5:["Rajan",80] }
(D) { 1:[ Rahul",95], 2:["Siya",90] }
Which of the following statement is/are not correct about tuples in python (1)
8.
1 Tuples can be modified in place
2 We can compare two tuples using relational operators
3 Two tuples can be joined using ‘+’ operator
4 If tup is a tuple, then max(tup)returns the index of maximum value in tuple
(A) Only Statement 1 (B) Statement 1 and Statement 3
(C) Only Statement 4 (D) Statement 1 and Statement 4
MYSql _____ to change the datatype ______ the constraint of a field. (1)
9.
(A) allows, and (B) does not allow, and
(B) allows, but does not allow (D) does not allow, but allows
To force Python to write buffer contents to a file while it's open, use: (1)
10.
(A) <fileobject>.close() (B) <fileobject>.write()
(B) <fileobject>.dump() (D) <fileobject>.flush()
11. State True or False: Raise Statement is used to raise user defined exception. (1)
12. What will be the output of given code? (1)
g=0
def fun1 (x,y):
global g
g=x+y
return g
def fun2 (m, n):
global g
g=m-n
return g
k=fun1 (2,3)
fun2 (k, 7)
print(g)
(A) 2 (B) -2 (C) 4 (D) -4
13. Which command can be used to find structure of the table in database? (1)

14. In MySQL, if table A has degree 6 and cardinality 5, and table B has degree 3 (1)
and cardinality 5, what are the degree and cardinality of their Cartesian
product?
(A) 25, 9 (B) 18,10 (C) 30,15 (D) 9,25
15. A ___________ specifies the permissible set or range of values a field can (1)
take, often defined by the data type and additional specifications.
(A)Domain (B) Cardinality (C) Degree (D) Attribute
16. An SQL clause used to sort the values in ascending or descending order in a (1)
column?
(A) Order By (B) Group By (C) Distinct (D) Having
17. Which of the following statements is false? (1)
(A) Telnet is used for remotely logging in to system.
(B) HTTPS is safer than HTTP.
(C) URL of a page is not always the same as its domain name.
(D) Interlinking of collection of webpages is called Internet.
18. Name the topology in which all the devices are directly connected to each (1)
other.
19. Name of the device that connects dissimilar networks is ________ (1)
(A) Modem (B) Gateway (C) Bridge (D) HUB
Q20 and Q21 are Assertion(A) and Reason(R) 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
20. (A) : To use a function from a particular module, we need to import the module (1)
(R) : An import statement can be placed anywhere before using the function.
21. (A): Foreign keys cannot be null. (1)
(R): Foreign key values must match primary key values of the referenced table.
Q No Section-B ( 7 x 2=14 Marks) Marks
22. (A) Lists cannot be used as keys in dictionary. Why? (2)
(B) If D={1:’A’,3:’H’,2:’L}. What will sum(D) and sort(D) return?
23. Give output of: (2)
(A) 7-2**3+5/3
(B) not(False)and True or False and True
24. Given a dictionary S=”CS Preboard 2024”, Write the built-in functions: (2)
(A) To replace the spaces in the string with “-“.
(B) To count the occurrences of “2” in the string.
25. What possible outputs(s) will be obtained when the following code is executed? (2)
from random import randint
x="ComputerScienceExamination2024"
k=0
for i in x:
if i.isalpha() and i.isupper():
k+=1
y=randint(1,k)
for j in range(y):
print(x[j:len(x)-j])
(A) ComputerScienceExamination202 (B) ComputerScienceExamination202
4 4
omputerScienceExamination2024
mputerScienceExamination2024
(C) ComputerScienceExamination202 (D) ComputerScienceExamination202
4 4
omputerScienceExamination202 omputerScienceExamination2024
mputerScienceExamination2024
puterScienceExamination2024
26. Find the error in the given code: (2)
even_no=odd_no=0
for i in Range(0,len (L))
if L[i]%2=0:
even_no+=1
Else:
odd_no+=1
print(even_no, odd_no)
27. I Write SQL command to change Rohan's phone number in the student table? (2)
OR
Which command will you use to delete a table along with its structure?
II Write an SQL command to add a field Blood_group to employee table which
cannot be left blank.
OR
Write an SQL command to rename the field DOB to Birthdate in Employee table.
28. Give 2 point of differences between packet switching and circuit switching. (2)
OR
Expand the term XML. How is it different from HTML?
Q No. Section-C ( 3 x 3 = 9 Marks) Marks
29.. Write a Python function dispdigit() reads a text file “test.txt” and that displays (3)
all the digits in the file.
OR
Write a Python function disp() that finds and displays longest line of the file
“test.txt”
29. Julie has created a dictionary containing names and marks as key value pairs of 6 (3)
students. Write a program, with separate user defined functions to perform the
following operations:
(A) Push the keys (name of the student) of the dictionary into a stack, where the
corresponding value (marks) is greater than 75.
(B) Pop and display the content of the stack.
For example: If the sample content of the dictionary is as follows:
R={"OM":76, "JAI":45, "BOB":89, "ALI":65, "ANU":90, "TOM":82}
The output from the program should be:
TOM ANU BOB OM
d={"Om":76,"A":90,"b":67,"c":45,"d":78}
(C) Peep the last value inserted in the stack.
OR
(A) Write the definition of a user-defined function `push (N)` which accepts a list of
numbers in a parameter `N` and pushes the numbers greater than 99 on the
stack.
(B) Write function pop() to pop the topmost string from the stack and returns its
length. If the stack is already empty, the function should display "Empty".
(C) Write function Disp() to display all element of the stack. If the stack is empty,
the function should display 'None'.
30. Predict the output of the Python code given below: (3)
value=50
print("value before",value)
def display(N=80):
global value
if N%7==0:
value=value+N
else:
value=value-N
print("value in function",value)
display(20)
display()
print("value after",value)
OR
Name="@@@#PreBoard2024#@@@"
R=""
for x in range(len(Name)):
if Name[x].isupper():
R=R+Name[x+1]
elif Name[x].islower():
R=R+Name[x-1].upper()
elif Name[x].isdigit():
R=R+Name[x-1]
else:
R=R+"$"
print(R)
Q No. Section-D ( 4 x 4 = 16 Marks) Marks
31. Consider the table Product given below: (4)

Write SQL queries for the following:


(A) Create the table.
(B) Display Product no.(Pno),name of products with Quantity less than 150 .
(C) insert the given record in primary table: (117,”Stapler”,65,”24-23-2014”)
(D) Increment quantity of products bought on “12-12-2011” by 10.
OR
Write the outputs for:
(A) Select sum(qty) from product;
(B) Select count(*) from product where Name not like 'p%’;
(C) Select Pno, name, qty from personal where year(purchasedate)>2011;
(D) Select max(qty) from personal where Pno in (113,103,101);
32. Write the code for csv file “record.csv” as per given instruction: (4)
(A) ADD() – To accept and add data of an student to a CSV file ‘record.csv’. Each
record consists of a list with field elements as admnno, name and class to store
admission number, student name and student class respectively.
(B) DisplayR12() – To display the records of students in class 12 in the CSV file
named ‘record.csv’.
33. Study the following tables and write SQL commands to : (4)
Table: Staff
ID NAME DEPT GENDER EXPERIENCE
10 Siddharth Sales M 12
1
10 Naman Research M 10
7
11 Nupur Sales F 3
4
10 Janvi Finance F 9
9
10 Rama Research M 10
5
11 James Sales F 3
7
11 Samuel Sales M 15
3
Table:Salary
ID BASIC ALLOWANCE COMMISSION%
101 12000 1000 3
104 23000 2300 5
107 32000 4000 5
114 12000 5200 10
105 18900 1690 3
130 21700 2600 30
(A) Display name of those who are in “sales” and more than 10 years of
experience
(B) Display the basic +allowance as salary of all staff working in “finance”
department.
(C) Display the minimum allowance of female staff.
(D) Display the highest commission% among all male staff.
OR
(D) Write SQL command to perform left join on both the tables.
Write the code that reads the following record from the table named Vehicle and (4)
displays only those records which has the type “Luxury”
VID– integer
Vehicle_name –string (unique)
cost-float
type-string
Note the following to establish connectivity between Python and MYSQL:
Username is root
Password is “12345”
The table exists in a MYSQL database named INVENTORY.
Q.No. SECTION E (2 X 5 = 10 Marks) Marks
34. Consider a Binary file SCHOOL.DAT containing a dictionary having multiple (5)
elements. Each element is in the form of a dictionary with following information for
each record SCHOOL_NO,NAME,LOCATION,
Write a user-defined functions as per the given direction:
(A) FindBook(price), displays all those records from the binary file where location is
Greater Noida
(B) Add(),that adds a new record to the file.
(C) Modify() that name of school to “BPP School” whose School_no is 12344.
35. ABC Consultants are setting up a secure network for their office campus at Noida (5)
for their day-to-day office and web-based
Distance between various blocks
Number of computers
Building Distance
Building Number of Computers
Building 1 to Building 3 120 m
Building 1 25
Building 1 to Building 2 50 m
Building 2 51
Building 2 to Building 3 65 m
Building 3 150
Noida Branch to Head Office1500 km
Head Office10

activities. They are planning to have connectivity between three buildings and the
head office situated in Bengaluru. As a network consultant, give solutions to the
questions (i) to (v), after going through the building locations and other details
which are given below :

(A) Suggest the most suitable place to install the server for this organization. Also,
give reason to justify your suggested location.
(B) Suggest the cable layout of connections between the buildings inside the campus.
(C) Suggest the placement of the following devices with justification:
i)Switch ii) Repeater
(D) The organization is planning to provide a high-speed link with the head office
situated in Bengaluru, using a wired connection. Suggest a suitable wired medium
for the same.
(E) The System Administrator does remote login to any PC, if any requirement arises.
Name the protocol, which is used for the same.

You might also like