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

Set-3 QP

Cs class 12 practice question
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)
476 views7 pages

Set-3 QP

Cs class 12 practice question
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

KENDRIYA VIDYALAYA SANGATHAN : BHUBANESWAR REGION

PRE-BOARD EXAMINATION 2023-24


CLASS XII
COMPUTER SCIENCE (083) ( SET – I)
TIME: 3 HOURS M.M.70
General Instructions:
1. Please check this question paper contains 35 questions.
2. The paper is divided into 4 Sections- A, B, C, D and E.
3. Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
4. Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
5. Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
6. Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
7. Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
8. All programming questions are to be answered using Python Language only.

Q. SECTION A Marks
No.
1. State True or False: 1
‘‘A dictionary key must be of a data type that is mutable.”
2. A table has initially 5 columns and 8 rows. Consider the following sequence of operations 1
performed on the table
i. 8 rows are added
ii. 2 columns are added
iii. 3 rows are deleted
iv. 1 column is added
What will be the cardinality and degree of the table at the end of above operations?
(a) 13,8 (b) 8, 13 (c) 14,5 (d) 5,8
3. Predict the correct output of the following Python statement – 1
7%5==2 and 4%2>0 or 15//2==7.5
(a)True (b) False (c)None (d)Null
4. Predict the output of the following code. 1

data=[‘‘Python”,”Language”]
print(‘‘#”.join(data))
(a)Python#Language (b) Python Language# (c)#PYTHONLANGUAGE (d) None

5. Which of the following constraint is used to prevent a duplicate value in a record? 1


(a) Empty (b) check (c) unique (d) not null
6. Identify the device on the network which is responsible for forwarding data from one device 1
to another
(a) NIC (b) Router (c) RJ45 (d) Repeater
7. Choose the most correct statement among the following – 1
(a) a dictionary is a sequential set of elements
(b) a dictionary is a set of key-value pairs
(c) a dictionary is a sequential collection of elements key-value pairs
(d) a dictionary is a non-sequential collection of elements
8. Consider the string state = ‘‘BHUBANESHWAR”. Identify the appropriate statement that 1
will display the last five characters of the string state?
(a) state [-5:] (b) state [4:] (c) state [:4] (d) state [:-4]
9. What will be the data type of d, if d = (15,) ? 1
(a) int (b) tuple (c) list (d) string
10. Identify the output of the following python statements . 1
import random
for n in range(2,5,2):
print(random.randrange(1,n),end=’*’)
(a)1*3* (b) 2*3* (c) 1*3*4* (d)1*4*
11. Website stores the browsing activity through: 1
(a) web page (b) passwords (c) Cookies (d) server
12. Given the following code.What should be filled in the missing blank for proper execution of 1
code.
def square(n):#find square of last digit of the argument and return it
d=n%10
d=d**2
_______
(a) ret d (b) print(n) (c) return d (d) return n**2
13. State whether the following statement is True or False: 1
‘‘try – catch block is used to handle exceptions in Python”.
14. The structure of the table/relation can be displayed using __________ command. 1
(a) view (b) select (c) show (d) describe
15. The first page that appears when a web site is opened is called ____________. 1
16. How do you change the file position to an offset value from the start? 1
(a) fp.seek(offset, 0) (b) fp.seek(offset, 1) (c) fp.seek(offset, 2) (d) None of them
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
17. Assertion (A): It is not possible to delete/remove elements(s) from the list. 1
Reason (R) : The pop(), remove() functions are used to delete /remove items from the list.

18. Assertion (A): Modules provide reusability of code. 1


Reason (R) : We can define our most defined functions in a module and import it , instead of
copying their definitions into different programs.

SECTION B
19. (i) Write the full forms of the following. 1+1=2
a. SMTP b. PPP
(ii) How is http different from https.
OR
(i) Define modem and what is its purpose in networking.
(ii) Write any two differences between twisted pair cable and coaxial cable.
20. Find error in the following code(if any) and correct code by rewriting code and underline the 2
correction;‐

x= int(‘‘Enter value of x:”)


for in range [0,10]:
if x=y
print( x + y)
else:
print( x‐y)

21. Write a user defined function that receives two string arguments and checks whether they 2
are same length strings (returns True in this case otherwise False).
OR
Write a user defined function zeroend(SCORE) to add all those values in the list SCORE,
which are ending with 0 and display the sum.
For example :
If the SCORE contains SCORE=[200,456,300,100,234,678]
The sum should be displayed as 60.

22. Find output generated by the following code: 2


L1=[10,15,20,25]
L2=[]
for i in range(len(L1)):
L2.insert(i,L1.pop())
print(L1,L2,sep= ‘‘& ‘‘)
23. Write the Python statement for each of the following tasks using BUILT-IN 1+1=2
functions/methods only.
(i) To sort the contents of a list Lst in reverse order.
(ii) To check if string named S1, contains only alphabets or not.
OR
Raju is new to Python programming and he is trying to find the square root of a number.
Help him in importing required module and with python statement to perform the same.

24. A table ITEM has been created in a database with the fields : ICODE,INAME,QTY,PRICE. 2
Write a query to add a new filed DISCOUNT (type integer) to the above table.
Then write query to delete column QTY from the table.

OR
Harish has written a query to increase the marks of students of ‘science’ stream by 5.But
he is not getting correct output. Help him by the correct query.
Table Student : [rno,name,class,stream,marks]
Query : Modify student change marks=marks+5 where stream equals ‘science’
Then write query to delete the commerce stream students whose name ends with ‘A’ from
table.
25. What is the output of the following python code. 2
L=[2,6,9,10]
def ListChange():
for i in range(len(L)):
if L[i]%2==0:
L[i]=L[i]*2
elif L[i]%3==0:
L[i]=L[i]*3
else:
L[i]=L[i]*5
ListChange()
for i in L:
print(i,end=‘‘#”)
SECTION C
26. Predict the output of the code given below. 3
def Convert(old):
l=len(old)
new=‘‘ ‘‘
for i in range(0,l):
if old[i].isupper():
new=new+old[i].lower()
elif old[i].islower():
new=new+old[i].upper()
elif old[i].isdigit():
new=new+”* ‘‘
else:
new=new+”% ‘‘
return new
older=‘‘InDia@2020”
newer=Convert(older)
print(‘‘Newer String is ‘‘,newer)
27. Consider the following table and write the outputs for the below queries. 1*3=3

TRAINER
TID TNAME CITY HIREDATE SALARY
101 SUNAINA MUMBAI 1998‐10‐15 90000
102 ANAMIKA DELHI 1994‐12‐24 80000
103 DEEPTI CHANDIGAR 2001‐12‐21 82000
104 MEENAKSHI DELHI 2002‐12‐25 78000
105 RICHA MUMBAI 1996‐01‐12 95000
106 MANIPRABHA CHENNAI 2001‐12‐12 69000

i.select count(distinct(city)) from trainer;


ii.select tname,salary from trainer where hiredate < '1998-10-15 ' and tname like '%A ';
iii. select tname,city,salary from trainer where tid<105 and salary between 70000 and
80000;

28. Write a use defined function SHOWWORD () in python to read from a text file STORY.TXT, 3
and display those words, whose length is less than 5.

OR
Write a user defined function LINESH(): in python that displays the number of lines starting
with 'H' in the file para.txt

29. Consider the table FLIGHT given below and write SQL queries for the following. 1*3=3
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
F105 DELHI BENGALURU 2021-01-15 5000

i) Write a query to change the fare to 6000 of the flight whose FNO is F104.
ii) Write a query to delete the records of flights which end at MUMBAI.
iii)To display the average fare of all the flights.
30. Write a function in Python PUSH(Num), where Num is a list of numbers. From this list push 3
all numbers divisible by 5 into a stack implemented by using a list. Display the stack if it has
at least one element, otherwise display appropriate error message.

For example:
If the list Num is:
[66, 75, 40, 32, 10, 54]

The stack should contain:


[75, 40, 10]
OR
Write a user defined function Push(student) where student is a dictionary containing –
{Rollno:Marks} . The function should push the rollno of those students in the stack
whose marks are greater than 75 and display the count of students pushed onto the
stack.
SECTION D
31. Consider the following tables and write the SQL queries as below. 4
WORKER
ECODE NAME DESIGN PLEVEL DOJ DOB
11 Radhe Shyam Supervisor P001 2004-09-13 1981-08-23
12 Chander Nath Operator P003 2010-02-22 1987-07-12
13 Fizza Operator P003 2009-06-14 1983-10-14
15 Ameen Ahmed Mechanic P002 2006-08-21 1984-03-13
18 Sanya Clerk P002 2005-12-19 1983-06-09
PAYLEVEL
PLEVEL PAY ALLOWANCE
P001 26000 12000
P002 22000 10000
P003 12000 6000
(i) Write statement to increase the width of the column ‘‘Name” to varchar(40).
(ii) To display the worker name, designation and corresponding total pay (Pay +Allowance).
(iii) To display the name of the workers , DOB and corresponding pay for Supervisors.
(iv) To count the total number of operators.
32. Rohini is a CS student and has been assigned her teacher to write functions ADD() and 4
COUNTR() for working with records of employees.
i)ADD() – to accept and add data of an employee to a CSV file ‘record.csv’. Each record
consist of a list with filed elements as empid,name and sal to store id,name and salary
respectively.
ii)COUNTR() - To count the number of records present in the CSV file names ‘record.csv’.
SECTION E
33. An International Bank has to set up its new data center in Delhi, India. It has five blocks of 1*5=5
buildings – A, B, C, D and E.

A B C

D E

Distance between the blocks and number of computers in each block are as given below:
Distance Between Blocks No of Computers
Block B to Block C 30m Block A 55
Block C to Block D 30m Block B 180
Block D to Block E 35m Block C 60
Block E to Block C 40m Block D 55
Block D to Block A 120m Block E 70
Block D to Block B 45m
Block E to Block B 65m

(i) Suggest the most suitable block to host the server. Justify your answer.
(ii) Draw the cable layout (Block to Block) to economically connect various blocks within the
Delhi campus of International Bank.
(iii) Suggest the placement of the following devices with justification:
(a) Repeater (b) Hub/Switch
(iv)The bank is planning to connect its head office in London. Which type of network out of
LAN, MAN, or WAN will be formed? Justify your answer.
(v) Suggest a device/software to be installed in the Delhi Campus to take care of data
security

34. (i) Difference between ‘‘w” and ‘‘a” modes in text file handling. 2+3=5
(ii)A file sports.dat contains information about formal event participant. Write a user defined
function copydata() that would read contents from sports.dat and creates a file named
athletics.dat copying only those records from sports.dat where event name is ‘‘Atheltics”.
Record structure in sports.dat is as follows: [eventname,teamname,no_players]
OR
(i) How are text files different from binary files.
(ii) Write a user defined function to search and display the details of the employees (name,
designation and salary) whose salary is greater than 5000. The records are stored in the file
emp.dat. consider each record in the file emp.dat as a list containing name, designation and
salary.
35. (i) Define the term foreign key with respect to RDBMS. 1+4=5
(ii) Kiran wants to write a program in Python to insert the following record in the table
named EMP in My SQL Database HRMS.
 Empno – integer
 Empname – varchar(20)
 Salary – integer
 DOJ – date
Details to establish database connectivity between python and MySQL are :
{ username – root, password – cts , host – localhost }
Values of fields empno, empname and salary are to be accepted from user .
Help kiran in accomplishing the same using code in Python.

OR
(i) What is the purpose of ROLLBACK command in database transactions.
(ii) Satya has created a table named CRICKETERS in MYSQL database SPORTS with
following felds.
 Rank – integer
 Name – varchar(20)
 DOB – date
 Runs – int
 Average – float
Details to establish database connectivity between python and MySQL are :
{ username – root, password –play, host – localhost }
Satya wants to display the records of those cricketers who scored more than 5000 runs.
Help Satya in accomplishing the same using code in Python.

-end-

You might also like