Sample Paper 5cs
Sample Paper 5cs
COM
SAMPLE PAPER - 5 (2023-24)
XII - COMPUTER SC(083)
om
Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
.c
Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
se
Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
All programming questions are to be answered using Python Language only.
b
4c
SECTION-A
Question
Q. No. Marks
on
1 State True or False: 1
“Lexical unit is the smallest unit of any programming language”
h
yt
c. -18.0 d. Error
w
[1]
5 In MYSQL database, if a table, Emp has degree 10 and cardinality 5, and 1
another table, Dept has degree 5 and cardinality 10, what will be the degree
and cardinality of the Cartesian product of Emp and Dept ?
a. 50,15 b. 15,50
c. 50,50 d. 15,15
6 Ankur wants to transfer songs from his mobile phone to his laptop. He uses 1
Bluetooth Technology to connect two devices. Which type of network will be
formed in this case?
om
a. PAN b. LAN
c. MAN d. WAN
7 Give the output: 1
.c
dic1={‘r’:’red’,’g’:’green’,’b’:’blue’}
se
for i in dic1:
print (i, end =’ ’)
b
a. r g b b. R G B
4c
c. R B G d. red green blue
8 Consider the statements given below and then choose the correct output 1
on
from the given options:
MN="Bharat @G20"
h
print(MN[-2:2:-2])
yt
Options:
np
a. rt@2 b. 2@tr
c. @G20 d. 02G@
ar
print(S) # Statement 2
w
(a) Statement 3
(b) Statement 4
(c) Statement 5
(d) Statement 4 and 5
[2]
10 What possible outputs(s) will be obtained when the following code is 1
executed?
import random
Signal=['Stop','Wait','Go']
for K in range (2,0,-1):
R=random.randrange(K)
print(Signal[R], end='#')
options:
a. Stop#Go#
om
b. Wait#Stop#
c. Go#Stop#
.c
d. Go#Wait#
se
11 Fill in the blank: 1
b
…………….is a communication methodology designed to deliver emails over
Internet protocol.
a. VIOP
4c
on
b. SMTP
c. PPP
h
d. HTTP
yt
x=5
def function1():
global x
ar
y=x+x*2
print(y,end=”,”)
.le
x=7
function1()
print(x)
w
Output:
w
a. 21 , 7
w
b. 15 , 5
c. 21 , 5
d. 15, 7
[3]
13 State whether the following statement is True or False: 1
Exception handling can be done for both user-defined and built-in exceptions.
om
15 Fill in the blank: 1
.c
In case of switching, each information or message to be
se
transmitted between sender and receiver is broken down into smaller pieces.
b
16 Which method is used to move the file pointer to a specified position.? 1
a.tellg()
4c
on
b.tell()
c.seek()
h
d.seekg()
yt
Q17 and 18 are ASSERTION AND REASONING based questions. Mark the
correct choice as
np
(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
ar
Reasoning(R): The file pointer is at the end of the file if the file exists.
w
18 1
Assertion(A): A function is block of organized and reusable code that is used to
perform a single, related action.
Reasoning(R): Function provides better modularity for your application and a high
[4]
SECTION B
OR
(i) Define the term Protocol with respect to networks.
om
(ii) How is Hub different from Switch?
.c
20 Harsh has written a code to input a number and find a table of any number. His 2
se
code is having errors. Rewrite the correct code and underline the corrections
made.
b
def table():
n=int(("Enter number which table U need: ")
4c
for i in (1,11):
print("Table of Enter no=”,i*i)
on
Table()
subjects whose names are longer than 5 characters. For example, Consider the
np
following dictionary
SUBJECT={1:"Hindi",2:"Physics",3:"Chemistry",4:"cs",5:"Math"}
ar
PHYSICS
CHEMISTRY
w
OR
w
[5]
22 Predict the output of the following code: 2
tuple1 = (11,22,33,44,55,66)
list1 =list(tuple1)
new_list = []
for i in list1:
if i%2==0 :
new_list.append(i)
new_tuple = tuple(new_list)
om
print(new_tuple)
23 Write the Python statement for each of the following tasks using BUILT-IN 1+1=
.c
functions/methods only: 2
se
(i) To insert an element 100 at the Second position, in the list L1.
(ii) To check whether all the characters in the string S1 are digits or not.
b
OR
How the pop( ) function is different from remove( ) function working with
list in python ? Explain with example.
4c
on
24 Pooja wrote a query in SQL for student table but she is not getting desired result 2
select * from student where fee = NULL;
Rewrite the above query so that she gets desired result
h
OR
yt
def Diff(N1,N2):
if N1<N2:
w
return N1-N2
w
else:
return N2*N1
w
NUM= [10,23,14,54,32]
for CNT in range (4,0,-1):
A=NUM[CNT]
B=NUM[CNT-1]
print(Diff(A,B),'#', end=' ')
[6]
SECTION C
om
my_city(sub,6)
print(sub)
.c
27 Write the outputs of the SQL queries (a) to (c) based on the relation Furniture 1*3
=
se
No Itemname Type Dateofstock Price Discount 3
1 White lotus Double Bed 23/02/2002 30000 25
2 Pink feather Baby Cot 20/01/2002 7000 20
b
3 Dolphin Baby Cot 19/02/2002 9500 20
4c
4 Decent Office 01/01/2002 25000 30
Table
5 Comfort Double Bed 12/01/2002 25000 25
on
Zone
6 Donald Baby Cot 24/02/2002 6500 15
7 Royal finish Office 20/02/2002 18000 30
h
Table
yt
Comfort
12 Old Fox Sofa 20/02/2003 17000 20
.le
[7]
29 Consider the table Emp given below: 1*3=
3
Table : EMP
om
E04 Sakila Clerk 30000 2000
.c
E05 Prachi Supervisor NULL 2800
b se
Based on the given table, write SQL queries for the following:
(i)
4c
Increase the salary by 10% of employees whose allowance is known.
on
(ii) Display Name and Total Salary (sum of Salary and Allowance) of all
employees. The column heading ‘Total Salary’ should also be
h
displayed.
yt
(iii) Delete the record of employess who have salary greater than 40000.
np
30. Mr.Abhishek has created a list of elements. Help him to write a program in 3
ar
python with functions, PushEl (S,element) and PopEl (S) to add a new
element and delete an element from a List of element named ‘S’ considering
.le
them to act as push and pop operations of the Stack data structure . Push the
element into the stack only when the element is divisible by 4.
w
w
32 <- Top
24
[8]
SECTION D
31 Consider the doctor and patient table and write the output of (i) to (iv) 1*4=
4
Doctor
docid Dname Specialization Outdoor
D1 MANISH PHYSICIAN MONDAY
D2 PARESH EYE FRIDAY
D3 KUMAR ENT SATURDAY
D4 AKASH ENT TUESDAY
Patient
Pid Pname did Date_visit
P1 Lal singh D2 2022-04-25
om
P2 Arjun D1 2022-05-05
P3 Narender D4 2022-03-13
P4 Mehul D3 2022-07-20
.c
P5 Naveen D2 2022-05-18
P6 Amit D1 2022-01-22
se
(I) select count(*) from patient where date_visit like ‘%2_’;
b
(II) select specialization ,count(*) from doctor group by specialization;
(III)
(IV) 4c
select a.dname, b.pname from doctor a, patient b where a.docid=b.did;
select dname from doctor,patient where docid=did and pname=’Arjun’;
on
32 A csv file “ result.csv” contains record of student in following order 4
[rollno, name, sub1,sub2,sub3,total]
h
Initially student total field is empty string as example data is given below
yt
A another file “final.csv” is created which reads records of “result.csv” and copy all
ar
records after calculating total of marks into final.csv. The contents of final.csv
should be
.le
(a) Define a function createcsv() that will create the result.csv file with the
w
(b) Define a function copycsv() that reads the result.csv and copy the same
data after calculating total field into final.csv file.
[9]
SECTION E
om
FINANCE BLOCK
.c
se
Block to block distance (in m)
Block (From) Block (To) Distance
HR Block MEETING 110
b
HR Block Finance 40
4c
MEETING Finance 80
Expected number of computers
Block Computers
on
HR 25
Finance 120
MEETING 90
h
yt
(i) Which will be the most appropriate block, where M/s Computer
Solutions should plan to install their server?
np
(ii) Draw a block to block cable layout to connect all the buildings in the
most appropriate manner for efficient communication.
(iii) What will be the best possible connectivity out of the following, you will
ar
Satellite Link
Infrared
Ethernet
w
(iv) Which of the following device will be suggested by you to connect each
w
Modem
Gateway
(v) Company is planning to connect its offices in Hyderabad which is less
than 1 km. Which type of network will be formed?
[10]
34 2+3=
5
(i) Differentiate between rb+ and wb+ file modes in Python.
(ii) Consider a binary file “employee.dat” containing details such as
(empno, ename, salary). Write a python function to
display details of those employees who are earning between 20000 and
30000 (both values inclusive).
OR
(i) Differentiate between dump and load functions in binary files?
om
(ii) Write a Python function in Python to search the details of the employees
.c
[name, designation, salary] whose salary is greater than 5000. The
se
records are stored in the file “emp.dat”. consider each record in the file
emp.dat as a list containing name, designation and salary.
b
4c
35 (i) How many candidate key and primary key a table can have in a Database? 1+4=
5
on
(ii) Manish wants to write a program in Python to create the following table
named “EMP” in MYSQL database, ORGANISATION:
Eno (Employee No )- integer , Ename (Employee Name) - string
h
user. Help Manish to write the program in Python to insert record in the above
table..
ar
OR
(i) Differentiate between degree & cardinality key in RDBMS?
.le
(iii) Vihaan wants to write a program in Python to create the following table
w
[11]