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

Class 12 Cs QP 2nd 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)
162 views10 pages

Class 12 Cs QP 2nd 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/ 10

PRE-BOARD- II EXAMINATION

2024-2025
CLASS XII
COMPUTER SCIENCE (083)
TIME: 03 HOURS M.M.: 70
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:1,1,1, is a valid tuple definition. (1)
2. If S is a string with value PYMYSQL, (S*2).split("MY")[::-1] will return (1)
(A) ['SQL', 'PYSQL', 'PY'] (B)['SQL', 'SQLPY', 'PY']
(C) ['SQL', 'SQL', 'PY', 'PY'] (D)['SQL', 'PY', 'SQL', 'PY']
3. Which of the following expression(s) results in an error? (1)
1. True + False +True
2. True +5+7
3. Not(7 and 6)
4. “67”+67
5. 7+3+7j
(A) Only 4 (B)Both 4 and 5
(C) 2,4 and 5 (D)None
Given: (1)
4.
S=”String”
L=str(list(S))
Which one is true?
(A) len(S)==len(L) (B)len(S)==5*len(T)

Page No. 1
(C) len(L)==5*len(S) (D)Can not be determined.
Given S=”0120131201010” (1)
5.
I=0
while S[0]==S[len(S)-I-1]:
S=S[1:-1]
print(S)
Which of the following statement(s) would give an error after executing? (1)
6.
Tup=(1,2,3,4) # Statement 1
print (Tup*2) # Statement 2
Tup+=(12,3) # Statement 3
Tup+=(1) # Statement 4
print(Tup) # Statement 5
(A) Statement 4,5 (B) Statement 3
(C)Statement 4 (D) Statement 3 and 4
7. Consider the dictionary D: D={1:11,2:22,3:33,4:44,5:55} (1)
What will be the output of statements?
print(sum(D))
print(len(D))
(A) Error and 5 (B)165 and Error
(C)15 and Error (D)15 and 5
Given T=(1,(2,(3,(4),5),6),7), What would print(len(T)) (1)
8.
return?
(A) 3 (B)5
(C) 4 (D)7
Which of these is not true about keys in database?
9. (1)
(A) The primary key field should be unique and Not Null.
(B) There can be only one foreign key in the table.
(C) Foreign key can be Null.
(D) Primary key is chosen from the candidate keys.
Given the following statements in the context of binary files: (1)
10.
1. There is no delimiter to end a line.
2. Since they are directly in the form of binary, hence there is no need to
translate them
3. We can open some binary files in the normal text editor but we cannot
read the content present inside the file.
4. Once the record is created, it is appended to the binary file using the

Page No. 2
dump() method, which writes the object onto the opened file.
5. To read the contents from binary use load() method of pickle module
(A) Only 2,4 are correct (B) 1,2,3,4 are correct
(C)1,2,4,5 are correct (D)1,2,3,5 are correct.
11. State True or False: There can be only one except block for a try block. (1)
12. What will be the output of given code? (1)
count = 5
def increment():
count = 10
count += 1
print(count,end=”%”)
def decrement():
global count
count=10
count-=1
print(count,end=”%”)
increment()
decrement()
print( count)
(A) 11%9%5 (B) 11%9%9
(C) 11%9%10 (D) 11%10%9
13. Which command can be used to find cardinality of a table in SQL? (1)
14. In SQL, if the where clause in select command has the condition name like ‘_ (1)
%B%” then, out of the given names which will be there in the output?
1. BRIJESH 4. BHASKAR
2. ABHISHEKH 5.BINAY
3. PRABHAT 6.SOHAIB
(A) Only 1,4 and 5 (B) Only 2,3 and 6
(C) Only 2 (D) All
15. What is the default length of char data type? (1)
(A) 1 (B)255 (C)8 (D)0
16. Which of the following SQL clauses is used to fetch unique values from a (1)
column?
(A) Group By (B)Unique (C)Distinct
(D)Having
17. Which of these is used for sending emails? (1)

Page No. 3
(A) HTTP (B) FTP (C)SMTP (D) IP
18. Name the device that connects similar networks:
(1)
(A) Modem (B) Gateway (C)Bridge (D) HUB
19. Name the topology in which If the central hub fails, all communication (1)
between connected devices is disrupted.
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. Assertion: If a value mutable datatype is passed to a function the changes (1)
are reflected in the value outside the function also.
Reasoning: This is because mutable data types are passed by reference,
meaning the function receives a reference to the same memory location of
the original object rather than a copy of the object.
21. Assertion: In a select query we can test multiple conditions. (1)
Reasoning: For each condition a separate where clause is required.
Q No Section-B ( 7 x 2=14 Marks) Marks
22. Which of the following is/are not a valid key value pair(s) in the given dictionary?(2)
Dict={“A”:5,1:44,[2,5]:[6,7],(3,4):[3,4]}
Also, state the reason for the same.
23. Give two examples of each of the following: (2)
(A) Logical expressions (B)Arithmetic Expression.
24. Given a dictionary d={1:1,2:2,3:3,4:4},Write built-in functions to: (2)
(A) Remove the last element from the dictionary.
(B) To display value at key=2
25. Given the following program which of these can be the possible output(s)? (2)
import random
str="Preboard2024”
Rindex=random.randint(0,len(str))
print(Rindex)
for i in range(0,Rindex,2):
print(str[i]*2,end=" ")
(A) PP (B) PP ee oo
(C) PP rr ee (D) PP bb rr
26. Find the error in the given code: (2)
Page No. 4
numbers = [1, 2, 3, 4, 5]
squares = []
if len(numbers) > 0
for num in numbers:
square = num ** 2
squares.append(square)
Print("The squared numbers are: ",squares)
elif:
print("The list is empty’)
27. I Write name of the constraint to ensure that field age does not exceed
17.
OR
II
Write name of the constraint to ensure that age field is having value 17
if no age is given.
Write an SQL command to add a field Blood_group to employee table
which can not be left blank or set NULL.
OR
Write an SQL command to make the rename the field mname to
Mother_name
in Employee table.
28. How is Bus topology different from Star topology? Give two points. (2)
OR
Expand the term FTP. Also, give its definition.
Q No. Section-C ( 3 x 3 = 9 Marks) Marks
29. Write a Python function find5() that displays all the lines having more than 5 (3)
words from a text file named “prep.txt”.
OR
Write a Python function findvowel() that finds and displays all the words
starting with a vowel.
30. A list named items contains details of items available in a stationery shop. (3)
Each item is represented as a list in the form [Item_name, Price, Quantity].
Write the following user-defined functions to perform operations on a stack
named Shop:
(A) Push_item(): Push an item onto the stack if its price is greater than
50.
(B) Pop_item(): Pop the top item from the stack and display it. Also,
Page No. 5
display "Underflow" if there are no items in the stack.
(C) Peep():To display the item at top of the stack.
OR
(A) Write the definition of a user-defined function `push (N)` which accepts
a list of strings in a parameter `N` and pushes the strings starting with
capital letters.
(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'.
31. Predict the output of the Python code given below: (3)
def short_sub(lst,n) :
for i in range(0,n) :
if i<n:
lst[i]=lst[i]+lst[i]
else:
lst[i]=lst[i]*len(lst[i])
subject=['CHEMISTRY', 'HINDI', 'PHYSICS', 'CS', 'MATHS']
x=len(subject)
short_sub(subject,x)
print(subject)
OR
s=”Cbse Examination 2022-2023”
num=2020
n=""
sum=num
for i in s:
if i.isdigit():
n+=i
for i in n:
sum+=int(i)
print(sum)
Q No. Section-D ( 4 x 4 = 16 Marks) Marks
Table: Personal (4)
32. P_ID Name Designation Salary Allowance
P01 Rohit Manager 89000 4800

Page No. 6
P02 Kashish Clerk NULL 1600
P03 Mahesh Superviser 48000 NULL
P04 Salil Clerk 31000 1900
P05 Ravina Superviser NULL 2100
Consider the table Personal given below:

Write SQL queries for the following:


(A) Increase the salary by 5% of personals whose allowance is known.
(B) Display name, designation of employees who is getting minimum salary.
(C) Arrange all data of table in descending of their salary.
(D) Display the clerks whose salary is unknown.
OR
Write outputs of following queries:
(A) Select designation, average(Salary) as average_sal from personal group
by designation;
(B) Select * from personal where name like '%sh’';
(C) Select p_id, name, designation from personal where allowance between
1500 and 2000;
(D) Select max(Salary) from personal;
33. Write functions for a csv file as per the given instructions: (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’.
34. A departmental store “ABC” is considering to maintain their inventory (4)
using SQL to store the data and maintain the basic transaction. As a
database manager, Mehak has decided the table as (Customer &
Transaction)
Table :Transaction
TRNO CNO AMOUNT TYPE DOT
T01 101 1500 Credit 23-11-2017

Page No. 7
T02 103 2000 Debit 12-05-2017
T03 102 3000 Credit 10-06-2017
T04 103 12000 Credit 12-09-2017
T05 101 1000 Debit 05-09-2017

Table :Customer
CNO CNAME ADDRESS
101 Richa Jain Delhi
102 Surbhi Sinha Chennai
103 Lisa Thomas Bangalore
104 Imran Ali Delhi
105 Roshan Singh Chennai

Write Queries to perform the following on the Database tables:


(A) To Display the total amount of each type of account.
(B) To Display transaction details of customer living in Delhi.
(C) To Display the date of transaction of those who have their names
starting from R and ending n.
(D) Show Average transaction amount of people living in Chennai and
Delhi
OR
(D) To display the Natural Join of the two tables.
35. Sameera maintains a database named STORE which contains a table named (4)
ITEM with the structure given below:
Ino(Item number )- integer
Iname(Item Name) – string
Price (Item Price) – float
Discount (Discount) – float
Note the following to establish connectivity between Python -MySQL:
Username - root
Password - tiger
Host - localhost
Help her to remove the record by creating python function from the table
ITEM for the item name given as input by the user.
Q.No. SECTION E (2 X 5 = 10 Marks) Marks
36. Consider a Binary file BOOK.DAT containing a dictionary having multiple (5)
elements. Each element is in the form [BNO,BNAME,BTYPE,PRICE] as
key:value pair
Page No. 8
Where BNO – Book Number, , BNAME – Book Name, , BTYPE -
Book Type , PRICE – Book price
Write a user-defined functions as per the given direction:
(A) FindBook(price), that accepts price as parameter and displays all those
records from the binary file BOOK.DAT which has a book price more
than or equal to the price value passed as a parameter.
(B) Add(),that adds a new record to the file.
(C) Modify() that increases the PRICE by 100 of the books having booktype
as fictional.
37. ABC Consultants are setting up a secure network for their office campus at (5)
Noida for their day-to-day office and web-based 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) Distance between various blocks Suggest the most suitable place to
Building Distance
Building 1 to Building 3 120 m Number of computers
Building 1 to Building 2 50 m Building Number of Computers
Building 2 to Building 3 65 m Building 1 25
Noida Branch to Head 1500 km Building 2 51
Office Building 3 150
Head Office 10
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

Page No. 9
requirement arises. Name the protocol, which is used for the same.

Page No. 10

You might also like