0% found this document useful (0 votes)
157 views9 pages

PB QP Set B

Uploaded by

suganya divya
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)
157 views9 pages

PB QP Set B

Uploaded by

suganya divya
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/ 9

Class :XII session 2023-24

Time allowed : 3 Hours Computer Science(083)


MaximumMarks:70
General Instructions:
 Please check this question paper contains 35 questions.
B
 The paper is divided into 4 sections - A,B,C,D and E.
 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.
 Section D, consists of 2 questions (31 to 32). Each question
carries 4 Marks.
 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.
SECTION –A
1. State True or False:
range(-1,-5) return values -1,-2,-3,-4.

2. Rathin wants to create a table Players with a column playerid which


should carry non null values and unique values. Which constraint has to
be given to the column?
(a) Primary Key (b) Not Null
(c) Default (d) Check

3. Which of the following is a valid python if statement?


6 * 3 + 4 ** 2 // 5 – 8
(a) 13 (b) 14 (c) 12 (d)11

4. Write the output of the code given below:


mydict = {“name”: “Aman”, “age” : 26}
mydict[‘age’] = 27
mydict[‘address’] = “Delhi”
print(mydict.items())
(a) dict_items ([(‘name’,’Aman’), (‘age’, 27), (‘address’, ‘Delhi’)])
(b) dict_keys ([(‘name’,’Aman’), (‘age’, 27), (‘address’, ‘Delhi’)])
(c) dict_values ([(‘name’,’Aman’), (‘age’, 27), (‘address’, ‘Delhi’)])
(d) None of these

5. A table student has 15 columns and 100 rows. 10 are rows added later.
What is the degree and cardinality of the table now?
(a) Degree : 5, Cardinality:110 (b) Degree : 15,
Cardinality:110
( c) (a) Degree : 10, Cardinality:90 (d) (a) Degree : 150,
Cardinality:90

6. ABC corporation has its offices in the city of lucknow, connected together
in a network. These offices are separated by a distance of approximately
45-50km. which kind of network is formed?
(a) PAN (b) WAN (c) MAN (d) LAN

7. Given is a python string declaration: myexam=””@@CBSE Examination


2022@@” write the output of print(myexam[::-2])
(a) 20 otnx SC@ (b) @20 mx S@
(c ) @20 otnmx SC@ (d) @120 otnmx sc@

8. Consider following list for python language L = [13, 3.45, “Tree”, ‘Amar’,
[10, 8.91,”Apple”], 456]
The output of L[-2] will be
(a) (10, 8.91, ‘Apple’) (b) [10,8.91, ‘Apple’]
(c) {10, 8.91, ‘Apple’} (d) None of these

9. Which output lines of the following program will print the same result?
tup1 =(10, 20, 30, 40, 50, 60, 70, 80, 90)
print (tup1[ 5 : -1])
print (tup1[ 5])
print (tup1[ 5 :])
print (tup1[ -4 : 8])
(a) (1) and (2) (b) (1) and (4) (c) (2) and (3)
(d) (1), (3) and (4)

10.What possible output 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 From and
To .
Import random
AR = [20, 30, 40, 50, 60, 70 ]
FROM = random .randint (1, 3)
TO = random.randint (2, 4)
for K in rnage (FROM, TO +1):
print (AR[K],end =”#”)
(a) 10#40#70# (b) 30#40#50# (c) 50#60#70#
(d) 40#50#70#

11. Fill in the blanks:


The protocol used for remote login is __________
(a) FTP (b) Telnet (c) HTTP (d) IRCP
12.Given the following code. what should be filled in the missing statement
for proper execution of the code.
def reverse(n):
while n>0:
d= n% 10
rev =__________ + d
n//=10
print(“Reverse:”, rev)
(a) rev/10 (b) rev *10 (c) rev//10 (d) rev+10
13.State True or False:
“In a python program, if a break statement is given in a nested loop, it
terminates the execution of all loops in one go.
14.Which of the following refers to the attribute that can uniquely identify the
tuples within the relation?
(a) Foreign Key (b) Candidate key (c) Alternate key (d)
Primary key
15.A network with all client computer and no server is
called_________________.
16.Which of the following statements opens a csv file “stock.csv” for writing
records into it?
(a) f = open(“stock.csv”, “w”) (b) ) f =
open(“stock.csv”, “wb”)
(c) ) f = open(“stock.csv”, “ab”) (d) ) f =
open(“stock.csv”, “r”)

Q.17 and 18 are ASSERTION (A) and REASONING (R) based


questions.
(a) Both A and R are true and R is the correct explanation of A.
(b) Both A and R are true but R is not the correct explanation of A.
(c) A is true but R is false.
(d) A is false but R is true.
17. Assertion(A): A function is a block of organized and reusable
code that is used to perform a single, related action.

Reason(R): Function provides better modularity for your


application and a high degree of code reusability.
18. Assertion(A): Text file stores information in ASCII or unicode
characters
Reason(R): In text file, there is no delimiter for a line.

SECTION –B
19. (a) Differences between Switch and Router.

(b) Given below are two addresses.


(i) http://www.abc.com/index.htm
(ii) 182.68.9.165
Identify which one of the above is an IP address and which one is a URL?
OR
(a) Expand the following terms: TCP/IP, FTP
(b) Write any two differences between twisted pair cable and coaxial cable
20. Asish has written the following code, but I am getting some errors while
executing it. Rewrite the correct code removing all the error.
Value =30
for val in range(0, Value)
if val%4==0:
print (val 4)
else if val%5==0:
print(val +3)
else :
print (val+10)

21. Write a python program to swap three variables.


OR
Write a function namely big (LstStr) that receives a list of strings and
displays those strings that start and end with a lowercase vowel.

22. Identify the output of the following Python statements:


L1, L2 = [10, 15, 20, 25], []
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
functions/methods only:
(i) To add a key value pair "Email": "[email protected]" to the dictionary
Empdict.
ii) To replicate a list Lstnames=["Sonia", "Rahul", Siksha"], 5 times

24. What is the differences between Primary key and Alternate key.
OR
Differentiate between char(n) and varchar(n) data types with respect to
databases.
25. Find the output of the following code.
def displayString():
p = None
q=0
r=””
s=None
if(p==q):
print ("None is the same as 0” )
elif(p==r):
print ("None is the same as empty string")
elif (p ==s):
print ("None is the same as the string 'None'")
else:
print ("None of the above")
displayString()
SECTION –C
26. Write the program to read the content from one file and write it another
file.

27. Write the outputs of the following SQL queries:


Table : EMP
Eno Ename Dept Desig DOJ Salary
1 Jack Sales MGR 2012-09- 89000
12
2 priya Accts MGR 2005-04- 56000
22
3 Ria Pers MGR 2000-01- 25000
09
4 Anil Pers Clerk 1994-04- 67000
03
5 Sumit Sales Officer NULL 19000
6 Akash Sales Officer NULL 20000

(a) Select dept, sum(sal) from emp group by dept;


(b) Select desig, count(*) from emp group by desig;
(c) Select desig, count(*) from emp group by desig having count (*)> 1 ;

28. Write a function in Python that counts the number of “Me” or “My” words
present in a text file "STORY.TXT". If the "STORY.TXT" contents are as
follows:

My first book
was Me and
My Family. It
gave me
chance to be
Known to the
world.
The output of the function should be
Count of Me/My in file:
OR
Write a function to count the number of lines starting with a digit in a text
file "Diary.txt"

29. Consider the table Teacher given below:


T_ID NAME AGE DEPARTMENT SALARY GENDER
1 ARUN 34 CS 12000 M
2 SREE 31 HISTORY 20000 F
3 RAVI 32 MATHS 30000 M
4 SAMIRA 35 HISTORY 40000 F
5 RAMAN 42 MATHS 25000 M
6 SHYAM 50 HISORY 30000 M
7 SHIV 44 CS 21000 M
Based on the table write SQL queries for the following:
(i) To display only names of teachers of "History" department.
(ii) To display the name, age and department of teachers whose name has
"a" as the 2nd letter
(iii) To increase the salary of Male teachers by 5% who are in "Computer Sc "
department. 30. Write a function in Python.
30. what is stack? Write down the stack operations with example.
SECTION-D
31 . Write SQL queries for (1) to (iv) based on the table School and Admin
given below:

Table: School

CODE TEACHER SUBJECT DOJ PERIODS EXPERIENC


E
1001 RAVI ENGLISH 2000- 24 10
03-12
1009 PRIYA PHYSICS 1998- 26 12
03-09
1203 LISA ENGLISH 2000- 27 5
04-09
1045 RAJ MATHS 2000- 24 15
08-24
1123 GUNA PHYSICS 1999- 28 3
07-16
1167 HARI CHEMISRT 1999- 27 5
Y 10-19

Table: Admin

CODE GENDER DESIGNATION


1001 MALE VICE PRINCIPAL
1009 FEMALE COORDINATOR
1203 FEMALE COORDINATOR
1045 MALE HOD
1123 MALE SENIOR TEACHER
1167 MALE SENIOR TEACHER

(i) To display each designation and count of each type for designations
where count is <2.
(ii) To display the maximum experience
(iii) To display names of teachers who have more than 12 years of
experience in ascending order of teacher name.
(iv) To display teacher names and corresponding designations from
both the tables.

32. What is binary file? Write down the modes and operations in binary
files.
SECTION-E
33. Perfect Edu Services Ltd. Is an educational organization. It is planning to
setup its India campus at Karnataka with its head office at Delhi. The
Karnataka Campus has 4 main buildings-ADMIN, ENGINEERING, BUSINESS
and MEDIA.

You as a network expert have to suggest the best network related solutions
for their problems raised in (1) to ( keeping in mind the distances between
the buildings and other given parameters.

Shortest distances between various buildings:

Admin to Engineering -55mt


Admin to Business – 90mt
Admin to Media -90mt
Engineering to Business – 55mt
Business to Media – 45mt
Engineering to Media – 90mt
Delhi Head office to Karnataka campus -2175km

Number of computers installed at various buildings are as follows:


Admin - 110
Engineering - 75
Business - 40
Media – 12
Delhi Head office - 20

i) Suggest the most appropriate location of the server inside the


ii) Draw the cable layout to efficiently connect various buildings within the
Karnataka campus for connecting ( the computers.

iii) Which hardware device will you suggest to be procured by the company
to be installed to protect and control the internet uses within the campus?
iv) Which of the following will you suggest to establish the online face to face
communication between the people in the admin office of Karnataka campus
and Delhi Head office
v) The organization is planning to link its sale counter situated in various part
of the same city. Which type of network out of LAN, WAN, MAN will be
formed?
34. (i) Write any two needs for a data file.
(ii) How will you open a text file text.txt in write and read mode?
35. (i) Which keyword is used to sort the records of a table in descending
order?
(ii) Consider the tables FACULTY and COURSES with structure as follows.
COURSES FACULTY
C_ID F_ID
F _ID FName
Cname LName
Fees HiredDate
Salary
Write SQL Queries for above tables.
1. Create table Faculty and Courses.
2. Insert the values into the tables.
3. Alter the table column Fname into FirstName
4. delete the records from the courses table.

You might also like