0% found this document useful (0 votes)
40 views6 pages

12csc QP - Set4

The document is a pre-board exam question paper for Class XII in Computer Science, consisting of 37 questions divided into five sections (A to E) with varying marks. It includes questions on Python programming, SQL, and general computer science concepts. The exam is designed to assess students' knowledge and skills in these areas over a duration of three hours.

Uploaded by

vedeshadaikkalam
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)
40 views6 pages

12csc QP - Set4

The document is a pre-board exam question paper for Class XII in Computer Science, consisting of 37 questions divided into five sections (A to E) with varying marks. It includes questions on Python programming, SQL, and general computer science concepts. The exam is designed to assess students' knowledge and skills in these areas over a duration of three hours.

Uploaded by

vedeshadaikkalam
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/ 6

Pre-Board Exam (2024-25)

Class –XII Set- 3


Time :3 hours Subject – CS (083) MM-70
Instructions:
1. This question paper contains 37 questions.
2. This Question Paper is divided into 5 sections from A to E
3. Section A has 21 questions carrying 01 mark each.
4. Section B has 07 questions carrying 02 marks each.
5. Section C has 03 questions carrying 03 marks each.
6. Section D has 04 questions carrying 04 marks each.
7. Section E has 02 questions carrying 05 marks each.
8. All programming questions are to be answered using Python Language only. Please Give the
correct answer

SECTION - A
1. State True or False 1
“Divide by zero is an exception or runtime error”.
2. Find the output of the following code- 1
msg=“ this is wonderful”
L=msg.index(‘is’)
print(L)
a. 1 b. 2 c. 3 d. 4
3. Consider the given expression: 1
not True and False or True
Which of the following will be correct output if the given expression is evaluated?
(a) True (b) False (c) NONE (d) NULL
4. What is the output of the expression? 1
S=’This is wow world’
print(S.find(‘wow’))
a. 6 b. 7 c. 8 d. 9
5. What is the output of the following python code – 1
st=”hello”
print(st[ : 3]+st[ 3: ])
a. “hello” b. “hell” c. “olleh” d. None of these

6. Identify the output of the following code – 1


T=(10,20,30)
T1=T+40
print(T1)
(10,20,30,40) b. (10,20,30) c. (40,10,20,30) d. error

7. Which command of SQL is used to change the degree of a table - 1


(a) Insert (b)Drop (c) Alter (d) Update
8. What does the list.pop( ) method do in Python? 1
(a) Removes the first element from the list
(b) Removes the last element from the list

1
(c) Removes all the elements from the list
(d) Removes first and last element from the list.

9. If two tables T1 and T2 have 3 and 5 rows respectively, what is the cardinality of T1xT2 1
resultant table.
a. 8 b. 15 c. 2 d. 35
10. Write the missing statement to complete the following code for counting the number of lines 1
of a text file.
file = open("example.txt", "r")
data = ______________ # to read the file in form of list.
lcount=len(data)
file.close()
11. State whether the following statement is True or False: 1
The finally block in Python is executed whether any exception occurs in the try block or not.
12. What will be the output of the following code? 1
value= 50
def display(N):
global value
value=25
if N%7==0:
value=value+N
else:
value=value-N
print(value,end='#')
display(20)
print(value)
(A) 50#50 (B) 50#5(C) 50#30(D) 5#50
13. Which two constraints can make a primary key of a table – 1
NOT NULL, Default b. NULL, Unique c. NOT NULL, Unique d. None of these
14. Write SQL statement used to find the total number of NULL values in “Salary” column of 1
“Employee” table.
a. Select Count(*) from Employee;
b. Select Count(Salary) from Employee;
c. Select Count(*)-Count(Salary) from Employee;
d. Select Count(Salary)-Count(*) from Employee;
15. Which clause is used in Mysql to eliminate redundant data of a column from a table. 1
a. Desc b. Distinct c. order by d. Group by
16. Which SQL command is used to change the cardinality of a table. 1
a. Delete b. Update c. Insert d. both a and c
17. The hardware or software that prevents unauthorized access to or from a private network.
a. Cookies b. Firewall c. Repeater d. Gateway
18. Which protocol is used for Video conferencing – 1
a. IP b. VoIP c. SMTP d. FTP
19. Which switching technique allow data to be routed entirely from source node to destination 1
node and there is no physical path is established.
Q.20 and Q.21 are ASSERTION AND REASONING based questions. Mark the correct 1
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

2
20. Assertion (A):- The Pickle module is import for Binary files in Python Language. 1
Reasoning (R):- For using load() and dump() function in our Python program.
21. Assertion (A):- The Drop command is used to remove the data as well as structure of a table 1
Reasoning (R):- The Syntax of drop table is – Drop <tablename>;
SECTION - B

22 If L1=[1,3,5] and L2=[2,4,6,8] then write built functions for the following- 1+1
a. To add all elements of L2 at the end of L1.
b. Remove the last element of L1.
23. Write short note on – 1+1
a. two examples of Logical operators b. Unpacking of tuples
24. a. Write one example of mutable and immutable objects each. 1+1
b. Write the output of the code given below:
city = {"name": "Dehradun", "state": “UK”}
city[“state”] = "Delhi"
print(city.values())
25. Write possible output(s) of the following code- 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#
26. Identify the syntax error and logical error in the following code and rewrite the correct code 1+1
to add an element at the end of a tuple.
Def tup_add(T)
T1=T+40
print(T1)
Tp=(10,20,30)
Tup_add(Tp)
27. a. Write the reason why count(*) and count(marks) are giving 10, 8 as output for the 1+1
following SQL command-
Select count(*) from student;
Select count(marks) from student;
b. Write an SQL command to make column “Empid” the Primary key of an already
created table “Employee”.
28. a. Write the full form of Wi-fi, WLL. 1+1
b. Write one example of Client side scripting language and Server side scripting language
each.
SECTION – C
29. Write a user defined function in Python that displays the number of lines starting with “J” in 3
a text file named as “Para.txt”.
30. A list contains following record of an Employee: 1+1
[Name, Salary, Department] +1
Write the following user defined functions to perform given operations on the stack named
‘mystk’:
(i) Push_element() - To Push an object containing Name, Salary and department of
employees to the stack .

3
(ii) Pop_element() - To Pop the objects from the stack and display them. Also, display
“Stack Empty” when there are no elements in the stack.
(iii) Peek_element()- To show the topmost element of the stack without deleting it.
31. Predict the possible output(s) of the following code.. Also specify the maximum and 1+1
minimum value that can be assigned to the variable R when K is assigned value as 2. +1
import random
Signal=[‘stop’,’wait’,’go’]
for K in range(2,0,-1):
R=randrange(K)
print(Signal[R],end=”#”)
a. Stop#wait#go# b. wait#stop# c. go#wait# d.go#stop#

SECTION – D
32. Consider the following table “Client”- 1+1
+2
Cid Name City Bal_due
C01 Ivan Mumbai 150
C02 Henry Delhi NULL
C03 Smith Goa 350
C04 John Delhi 120
a. Write SQL query based on Client table for the following –
1. Drop the column “City”.
2. Change the city from “Mumbai” to “Kolkata”.
b. Write the output of the queries (i) to (iv) based on the table ”Client” :
i. Select count(Bal_due) from Client;
ii. Select City from Client where City like ‘%i’;
iii. Select name from Client order by City desc;
iv. Select distinct city from Client;

33. A csv file “Employee.csv” contains data of staff of an organization. Each record contains 4
following information- Empid, Name , Salary , Department
For example a sample record of file may be-
[101,’lokesh’,12000,’HR’]
Write the following python functions to perform the specified operations on this file-
a. Read all records from the file and display all those records that having salary>10000.
b. Count the number of records in the file.
34. (a) Write the SQL queries for (i) to (iv) based on the relations Employee and Manager given 4
below:
Table: Employee
Empid Name Salary Mngid
101 Amit 12000 M02
102 Aman 21000 M01
103 Jay 18000 M03
Table : Manager
Mngid Mname Dept
M01 Jerry Marketing
M02 Andrew HR
M03 Jack Finance
i. Display name of employee with their corresponding manager name.

4
ii. Display the name of employee and their department that having salary more than
12000.
iii. List the name of employee with their salary and department who belongs to “HR”
department.
iv. To display the highest and lowest salaries of the employee .

35. In database “Details”, there is a table named as “student” having the following structure- 4
Column Type
Rno Integer
Name Varchar(20)
Percent float
Write a python function named as Display() to add one record and show all records of the
student table.Assume the following for Python Database Connectivity-
Host: localhost, User: root, Password : xyz

SECTION – E
36. Ajay has written a code and created a binary file product.dat with pid, name, brand and cost. 5
The file contains 10 records. Help him to do the following task –
a. Write a function to input data of product and append in the binary file.
b. Write a function to update the data of product whose cost is more than 200 and
change their brand as “sony”.
c. Write a function to read all the data from binary file and display those products
whose brand is not “LG”.
37. Bright Future University is planning to set up a network for its Academic schools at 5
Dehradun. The university has 3 academic schools (Law School, Business School and
Technology School) and 1 admin center building in their campus.
The distance between the buildings and number of computers in each building are given
below
The distance between the buildings::
Law School to Business School 60 m
Law School to Technology School 90 m
Law School to Admin center 115 m
Business School to Technology School 40 m
Business School to Admin center 45 m
Technology School to Admin center 25 m
Number of computers in each building::
Law School 25
Technology School 50
Admin Center 125
Business School 35
1. Suggest the most suitable place to install server.
2. Suggest a device for data security for the campus.
3. Draw an ideal cable layout for campus.
4. Suggest a device to connect all the computers in each building.
5. University is planning to connect its admission center in the closest city which is 350
km apart from Campus. Which type of network (LAN/MAN/WAN) will be formed.
Justify your answer.
*********

5
6

You might also like