0% found this document useful (0 votes)
273 views7 pages

12th - CS Preboard - Set A

This document contains instructions and questions for a Preboard Examination in Computer Science for Class XII. It has 35 total questions divided into 5 sections (A-E). Section A contains 18 1-mark questions. Section B contains 7 2-mark questions. Section C contains 5 3-mark questions. Section D contains 3 5-mark questions. Section E contains 2 4-mark questions. All programming questions must be answered in Python. The document provides sample questions on topics like Python concepts, databases, networking, and more. Students are instructed to answer the questions in the allocated time of 3 hours.

Uploaded by

tslingesswar
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)
273 views7 pages

12th - CS Preboard - Set A

This document contains instructions and questions for a Preboard Examination in Computer Science for Class XII. It has 35 total questions divided into 5 sections (A-E). Section A contains 18 1-mark questions. Section B contains 7 2-mark questions. Section C contains 5 3-mark questions. Section D contains 3 5-mark questions. Section E contains 2 4-mark questions. All programming questions must be answered in Python. The document provides sample questions on topics like Python concepts, databases, networking, and more. Students are instructed to answer the questions in the allocated time of 3 hours.

Uploaded by

tslingesswar
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/ 7

SEKSARIA SUSHILA DEVI PUBLIC SCHOOL, HATHRAS

PREBOARD EXAMINATION 1 (2023–24)


CLASS – XII
SUBJECT – COMPUTER SCIENCE (083) Date : 00/12/2023
Time : 3 hours Max. Marks : 70

General Instructions:
(i) Please check this question paper contains 35 questions.
(ii) The paper is divided into 5 Sections- A, B, C, D and E.
(iii) Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
(iv) Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
(v) Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
(vi) Section D, consists of 3 questions (31 to 33). Each question carries 5 Marks.
(vii) Section E, consists of 2 questions (34 to 35). Each question carries 4 Marks.
(viii) All programming questions are to be answered using Python Language only.

SECTION A (1 mark each)

Q1. In a Python program, a control structure: [1]


(a) Defines program-specific data structre
(b) Directs the order of Execution of statements in the program
(c) Dictates what happens before the program starts and after it terminates
(d) None of above
Q2. Find the invalid Identifier from the following: [1]
(a) Myname (b) 1Myname (c) My_name (d) Myname2
Q3. Which of the following is invalid method for fetching the records from database within Python? [1]
(a) fetchone() (b) fetchmany() (c) fetchall() (d) fetchmulti()
Q4. What is the default EOL Character in python ? [1]
(a) \n (b) \t (c) \l (d) \h
Q5. This method is used to load (unpickling) data from binary file [1]
(a) load() (b) dump() (c) seek() (d) tell()
Q6. Identify the valid arithmetic operator in python [1]
(a) ? (b) < (c) ** (d) and
Q7. Given the following dictionaries [1]
dict_exam={"Exam":"AISSCE", "Year":2023}
dict_result={"Total":500, "Pass_Marks":165}
Which statement will merge the contents of both dictionaries? [1]
(a) dict_exam.update(dict_result) (b) dict_exam + dict_result
(c) dict_exam.add(dict_result) (d) dict_exam.merge(dict_result)
Q8. Consider the given expression [1]
False, True, NOT, OR, True, False, AND, OR
Which of the following is the correct output if expression is evaluated?
(a) True (b) False (c) None (d) Null
Q9. Give the output of the following [1]
x=3
x+=x-x
print(x)
(a) 3 (b) 0 (c) 2 (d) 1

SSDPS / A.Y. 23-24 / PREBOARD 1 / XII / COMPUTER SCIENCE Page 1 of 7


Q10. Bluetooth is an example of [1]
(a) LAN (b) WAN (c) PAN (d) Virtual private network
Q11. State True or False. [1]
“ Immutable data type are those that can never change their values ”
Q12. Which of the following statement(s) would give an error after executing the following code? [1]
x=50 # Statement 1
Def func(x) # Statement 2
x=2 # Statement 3
func(x) # Statement 4
print(x) # Statement 5
(a) Statement 1 (b) Statement 3 & 4 (c) Statement 4 (d) Statement 2
Q13. Which of the following is the correct output for executing the following python statement? [1]
print(5 + 3**2 / 2)
(a) 32 (b) 8.0 (c) 9.5 (d) 32.0
Q14. Which topology is based on a central node which acts as a hub? [1]
(a) Bus topology (b) Star topology (c) Tree topology (d) Hybrid Topology
Q15. To establish a connection between Python and SQL database, what of the following statement is
connecting database server? [1]
(a) importMySQLdb (b) MySQLdb.connect
(c) db.cursor (d) None of the above
Q16. _______function place the pointer at the specified position of the file pointer by in an opening file. [1]
(a) seek() (b) tell() (c) read() (d) load()

Q17 and 18 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
Q17. Assertion (A): If the arguments in a function call statement match the number and order of arguments
as defined in the function definition, such arguments are called positional arguments. [1]
Reason (R): During a function call, the argument list first contains default argument(s) followed by
positional argument(s).
Q18. Assertion (A): CSV is a file format for data storage which looks like a text file. [1]
Reason (R): The information is organized with one record on each line and each field is separated by
comma.

SECTION B (2 marks each)

Q19. What possible outputs(s) are expected to be displayed on screen at the time of execution of the
program from the following code? Also specify the maximum values that can be assigned to each of the
variables Lower and Upper. [2]
import random
AR=[20,30,40,50,60,70];
Lower=random.randint(1,3)
Upper=random.randint(2,4)
for K in range(Lower, Upper+1):
print (AR[K],end="#")
(a) 10#40#70# (b) 30#40#50# (c) 50#60#70# (d) 40#50#70#
Q20. (a) Write the full form of the following: i) ARPANET ii) WiMax [1 × 2 = 2]

SSDPS / A.Y. 23-24 / PREBOARD 1 / XII / COMPUTER SCIENCE Page 2 of 7


(b) Name the different guided media for data transmission.
Q21. Predict the output of the following code [2]
def Alter(M,N=50):
M=M+N
N=M-N
print(M,"@",N)
return(M)
A=200
B=100
A=Alter(A,B)
print(A,"#",B)
B=Alter(B)
print(A,"@",B)
Q22. Rewrite the following code in Python after removing all syntax error(s). Underline each correction
done in the code. [2]
30=Value
for VAL in range(0,Value)
If val%4=0:
print (VAL*4)
Else val%5==0:
print (VAL+3)
Q23. What are the different switching techniques in networking? [2]
Q24. (a) Given is a Python string declaration: [1 × 2 = 2]
title="## ICC CRICKET T20 W’Cup 2022@@"
Write the output of: print(title[::-1])
(b) Write the output of the code given below:
my_dict = {"name": "Aman", "age": 26}
my_dict['age'] = 27
my_dict['address'] = "Delhi"
print(my_dict.items())
Q25. Differentiate between WHERE and HAVING clause. [2]

SECTION C (3 marks each)


Q26. a) Consider the following tables – student and games: [1+2=3]

What will be the output of following statement?


SELECT Name, gname FROM student, games;
b) Write the output of queries 1) to 4) based on the table, LOANS given below:
Table : LOANS
AccNo Cust_Name Loan_Amount Instalments Int_Rate Start_Date Interest
1 R.K.Gupta 300000 36 12.00 2009-07-19 1200
2 S.P.Sharma 500000 48 10.00 2008-03-22 1800
3 K.P. Jain 300000 36 NULL 2007-03-08 1600

SSDPS / A.Y. 23-24 / PREBOARD 1 / XII / COMPUTER SCIENCE Page 3 of 7


4 M.P.Yadav 800000 60 10.00 2008-12-06 2250
5 S.P.Sinha 200000 36 12.50 2010-01-03 4500
6 P.Sharma 700000 60 12.50 2008-06-05 3500
7 K.S. Dhall 500000 48 NULL 2008-03-05 3800
1) SELECT SUM(Loan_Amount) FROM LOANS WHERE Int_Rate > 10 ;
2) SELECT MAX(Interest) FROM LOANS;
3) SELECT COUNT(*) FROM LOANS WHERE Int_Rate IS NULL;
4) SELECT * FROM LOANS GROUP BY Interest HAVING Instalments >= 10;
Q27. Write a user – defined function countH() in Python that displays the number of lines starting with ‘H’
in the file ‘Para.txt”. [3]
For Example , if the file contains:
Whose woods these are I think I know.
His house is in the village though;
He will not see me stopping here
To watch his woods fill up with snow.
Output: The line count should be 2.
OR
Write a function countmy() in Python to read the text file “DATA.TXT” and count the number of times
“my” occurs in the file.
For example , if the file “DATA.TXT” contains –
“This is my website. I have displayed my preference in the CHOICE section.”
The countmy( ) function should display the output as: “my occurs 2 times”
Q28. (a) Write the output of the SQL queries i) to iv) based on the relations SHOP and ACCESSORIES
given below: [2+1=3]
Table : SHOP
Id SName Area
S01 ABC Computronics CP
S02 All Infotech Media GK II
S03 Tech Shopee CP
S04 Geek Tenco Soft Nehru Place
S05 Hitech Tech Store Nehru Place

Table : ACCESSORIES
No Name Price Id
A01 Motherboard 12000 S01
A02 Hard Disk 5000 S01
A03 Keyboard 500 S02
A04 Mouse 300 S01
A05 Motherboard 13000 S02
A06 Keyboard 400 S03
A07 LCD 6000 S04
T08 LCD 5500 S05
T09 Mouse 350 S05
T010 Hard Disk 450 S03
1) SELECT DISTINCT Name FROM ACCESSORIES WHERE Price > = 5000;
2) SELECT Area, COUNT(*) FROM SHOP GROUP BY Area;
3) SELECT COUNT(DISTINCT Area) FROM SHOP;
4) SELECT A.Name , A.Price FROM ACCESSORIES A, SHOP S
WHERE A.Id =S.Id and Price >=12000;

SSDPS / A.Y. 23-24 / PREBOARD 1 / XII / COMPUTER SCIENCE Page 4 of 7


(b) Write the command to create a database employee.
Q29. Write a python function is_even_num(l), where l is the list of elements passed as arguments to the
function. The function returns even numbers from a given list: [3]
Sample List : [1,2,3,4,5,6,7,8,9]
Expected Result:[2,4,6,8]
Q30. Write a program to implement a Stack for these book-details (book no, book name). That is, now each
item node of the stack contains two types of information – a book no, and its name. Just implement
PUSH and Display Operations create a Push( ) and Display( ) functions: [3]
OR
Write a function in Python MakePush(Package) and MakePop(Package) to add a new Package and
delete a Package from a List of package description, considering them to act as puch and pop operations
of the Stack data structure.

SECTION D (5 marks each)

Q31. “Vidya for All” is an educational NGO. It is setting up its new campus at Jaipur for its web-based
activities. The campus has four building as shown in diagram below: [1 × 5 = 5]
Center to Center distance between various building as per architectural drawings (in meters is as follows:
Main Building to Resource Building 120m
Main Building to Training Building 40m
Main Building to Accounts building 135m
Resource Building to Training Building 125m
Resource Building to Account Building 45m
Training building to Account Building 110m

Expected number of computers in each building is as follows:


Main Building 15
Resource Building 25
Training Building 250
Accounts Building 10
1) Suggest the layout of connection between the building.
2) Suggest the most suitable (i.e. building) to house the server of this NGO. Also provide a suitable
reason for your suggestion.
3) Suggest the placement of the following devices with justification:
(a) Repeater (b) Hub / Switch
4) The NGO is planning to connect its International office situated in Delhi. which out of the following
wired communication links will you suggest for a very high speed connectivity?
(a) Telephone Analog line (b) Optical Fiber (c) Ethernet Cable
5) Suggest the protocol to be used to update website of their organization from Training Building.
Q32. (a) Predict the output of the following code fragment? [2+3=5]
def check(n1=1, n2=2):
n1=n1+n2
n2+=1
print(n1, n2)
check( )
check(2,1)
(b) Study the database ‘company’ that has a table ‘Emp’ that stores IDs of employees. Code contain
the connectivity to retrieve data, one record at a time, for employees with IDs less than 10.
Write the missing statements:

SSDPS / A.Y. 23-24 / PREBOARD 1 / XII / COMPUTER SCIENCE Page 5 of 7


1) Statement1 2) Statement2 3) Statement3
import MYSQLdb as mycon
try:
db=______.connect(host=”localhost”, user =”root”,
passwd=” ”,database =”company”) ## missing Statement1
cursor = _________________ ## missing Statement2
sql=”select * from Emp where id < 10”)
number_of_rows=cursor.execute(sql)
print(cursor.fetchone())
db._______ ## missing statement3
except mycon.DataError as e:
print(“DataError”)
print(e)
OR
(a) Predict the output of the following code given below:
def fun(s):
k=len(s)
m=” “
for i in range(0,k):
if(s[i].isupper()):
m=m+s[i].lower( )
elif s[i].isalpha( ):
m=m+s[i].upper( )
else:
m = m + ‘bb’
print(m)
fun(‘school2@com’)
(b) Consider the following code which is doing following, updating the records of employees by
increasing the salary by Rs.1000 of all those employees who are getting less than Rs. 80000.
Write the following missing statements:
2) Statement1 2) Statement2 3) Statement3
import _______.connector #Statement1
db1=mysql.connector.connect(host=”localhost”,
user=”root”,password=””, databse=”company”)
cursor = _______________ #Statement2
sql=”update emp set salary = salary + 1000 where salary
<80000;”
try:
cursor._______________ #Statement3
bd1.commit( )
except:
db1.rollback( )
bd1.close( )
Q33. Write a user defined function to perform read and write operations onto a ‘student.csv’ file having
fields roll number, name, stream and marks. [5]
OR
Write the difference between text and csv file?

SSDPS / A.Y. 23-24 / PREBOARD 1 / XII / COMPUTER SCIENCE Page 6 of 7


Ranjan kumar of class 12 want to write a program on csv file “user.csv” he wants to store user id and
password in user.csv files.
Example he wants to write following data where first is user id and second is password in the file:
“Arjun”, “123@456”
“Arunima”, “123#453”
“Shyam”, “12&1234”
Create following functions:
addCsvFile( ):- which will add user id and password in “user.csv” file.
defReadCsvFile( ):- which will read the user id and password form “user.csv”file.

SECTION E (4 marks each)

Q34. Consider the following table STORE: [1+1+2=4]


Table : STORE
ItemNo ItemName Scode Quantity
2005 Sharpener Classic 23 60
2003 Ball Pen 0.25 22 50
2002 Get Pen Premium 21 150
2006 Get Pen Classic 22 220
2001 Eraser Small 22 220
2004 Eraser Big 22 110
Based on the above STORE Table and data in it answer the following questions:
1) Identify the attribute best suitable for Primary key.
2) Write the degree and cardinality of the table STORE.
3) Write the following statement :
(a) Insert the following data in the table.
ItemNo=2010, ItemName=”Note Book” , Scode=25, quantity = 50
(b) Increase the quantity of all the item by 10.
OR
3) Write the statement to:
(a) Delete the record from store table where item No. 2005.
(b) Add column price in the above store table with datatype as float.
Q35. Vishal has been given following incomplete code which takes a students details (rollnumber, name and
marks) and writes into binary file stu.dat using pickling. Help Vishal to complete the code. [1 × 4 = 4]
import ______________________ # statement 1
sturno = int(input(“Enter the rollno”))
stuname= input(“Enter the name”))
stumarks=float(input(“Enter marks”))
stu1={“RollNo”:sturno, “Name”:stuname, “Marks”:stumarks}
with ____________________ as fh: # statement 2
pickle.dump(________) # statement 3
with open(“Stu.dat”,”rb”) as fin:
_____________________ # statement 4
print(Rstu)
if Rstu[“Marks”] >= 85:
print(“Eligible for merit certificate”)
else:
print(“Not Eligible for merit certificate”)
_______________

SSDPS / A.Y. 23-24 / PREBOARD 1 / XII / COMPUTER SCIENCE Page 7 of 7

You might also like