ARMY PUBLIC SCHOOL No.
1 JABALPUR
PRE BOARD - II EXAMINATION
CLASS – XII (2023 - 2024)
SUB – COMPUTER SCIENCE (083)
TIME :- 03:00 Hr. M. M. :- 70
No. of Question – 35 No. of Pages : - 06
General Instructions:
1. The question paper contains five sections i.e Section A to E
2. All sections are compulsory
3. Section A have 18 MCQ types of questions carrying 01 mark each
4. Section B has 07 very short answer types of questions carrying 2 marks each
5. Section C has 05 short answer types questions carrying 03 marks each
6. Section D has 03 long answer types questions carrying 05 marks each
7. Section E has 02 questions carrying 04 marks each
SECTION “A”
Q.1 State True or False
Dictionary is ordered collection of elements stored in key-value pair
Q.2 What will be the output of following statement
print(4>5 and not 15>10 or 20>15)
a) False b) True c) None d) Error
Q.3 Select the correct output of the code
D={“a:20,”b”:30,”c”:40}
print(len(D.keys())
a) 6 b) 5 c) 3 d) 4
Q.4 Modem at receivers computer end act as a ……
(a) Model (b) Modulator (c) Demodulator (d) Converter
Q.5 What possible outputs will be obtained when the following code is executed ?
import random
Number=random.randint(0,3)
Color=[“Yellow”,”White”,”Black”,”Red”]
for I in range(1,Number) :
print(Color[I],end=”*”)
print()
(a) Red* (b) White* (c) White*White* (d) Yellow*
White* Black* Black*Black* White*White*
Black* Black*Black*Black*
Q.6 Which of the following will delete key-value pair for key=”red” from dictionary D1
(a) delete D1(“red”) (b) del D1[“red”] (c) Del D1[“red”] (d) del D1
Q.7 Choose the correct output from the options given below
Pride= “#G20 Presidency”
print(Pride[-2:2:-2])
a) ndsr b) ceieP0 c) ceieP d) yndsr
Q.8 …………..file opening mode is called default file opening mode
a) r b) r+ c) w d) a
Q.9 Number of attributes in a relation is called ……………
a) Attribute b) Degree c) Domain d) Cardinality
Q.10 …….is unicast network device
a) Router b) Switch c) Hub d) Gateway
Q.11 ………protocol primarily live communication such as video conferencing,
chatting etc
a) http b) Telnet c) VOiP d) TCP/IP
Q.12 What will be the output of the following python code ?
V=25
def fun(Ch):
V=50
print(V,end=Ch)
V*=2
print(V,end=Ch)
print(V,end=”*”)
fun(“!”)
print(V)
a) 25*50!100!25 b) 50*100!100!100 c) 25*50!100!100 d)Error
Q.13 An alternate key can be
a) only 1 in a table b) table can have maximum 2 alternate keys
c) table can have at most 3 alternate keys d) multiple in a relation
Q.14 In ………topology each node is connected to all remaining nodes of a network
a) Star b) Bus c)Mesh d) Ring
Q.15 F=open(“Story.txt”)
A=F.readline()
print(type(A))
a) String b) List c)tuple d) Error
Q.16 In a stack if user tries to remove an element from empty stack is called ..?
a) Underflow b) Overflow c)Empty d) Garbage Collection
Q.17 & Q.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 and R is not the correct explanation of A
(c) A is True and R is False
(d) A is False and R is True
Q.17 Assertion (A): Python overwrites an existing file or creates a non existing file when
we open a file with “w” mode
Reason (R) : a+ mode is used only for writing operation
Q.18 Assertion (A) : Python supports addition of data in a file ,preserving previous data
Reason (R) : Write mode erases all previous data of a pre-existing file
SECTION “B”
Q.19 What is the output of following code :
List1=[1,2,3,4,5]
Str1=”6”
for I in List1:
Str1=Str1+I
print(Str1)
Q.20 (i) Name the protocol which is used to remotely access other computer
(ii) Why switch is called as Intelligent Hub?
Q.21 Define UPDATE command of SQL with its basic syntax and examples
Q.22 Explain the use of Exception handling in Python with example
Q.23 Expand the following
(i) POP (ii) PPP
Q.24 Rewrite the following code using for loop:
I=3
while I<5:
if I==4:
print(“Welcome”)
else:
print(“No Entry”)
i=i+1
print(“Value of I”,I)
Q.25 Find the output of following code
def cal_result():
i=9
while i>1:
if i%2==0:
x=i%2
i=i-1
print(x)
SECTION “C”
Q.26 Based on Books table given below write SQL queries for following
Table : Books
Book_id Book_name Author Price Type Qty
F0001 The Tears
William 700 Fiction 10
Hopkins
F0002 Thunderbolts Anna 700 Fiction 5
Roberts
T0001 My First C++ Brain & 250 Text 10
Brooke
T0002 C++ AW 325 Text 5
Brainworks Rossaine
(i) Display average price of the books of Text type
(ii) Display records of books table as per price from lowest to highest
(iii) Display No of books in each type
Q.27 Based on Books table given above write output of following SQL queries
(i) select count(*) from books;
(ii) select count(distinct price) from books;
(iii) select * from books where book_name like ‘the%’ ;
Q.28 Write a user defined function change(L) to accept a list of numbers and replace the
numbers in the list with its factorial
Example : Input: [3,4,5,6,7]
Output : [6,24,120,720,5040]
Q.29 Write a method Filterwords() to display words from text file “News.txt” whose
length is less than 4
Q.30 Write a python program to input a sentence and create a new sentence storing each of
the word in its reverse form
Input: “Board Exam are coming”
Output: “draob smaxe era gnimoc”
Section “D”
Q.31 Write a program to show the details of the student who scored the highest
marks .Data stored in “Data.csv” is given below
Rollno Name Marks
1 Aman 35
2 Kanak 1
3 Anuj 33
4 Suman 25
Q.32 Write SQL Commands for following :-
(i) To add new column address in teacher table
(ii) To view table names in aps database
(iii) Increase salary of all employees by 1000
Table : Employee
Fields: Eid,Name,salary
(iv) delete all records of Employee table
SECTION “E”
Q.33
Q.34
5. select sum(distinct F_ID) from Company;
Q.35 (i) What is the difference between text file and binary file
(ii) Write a definition of function which will add 5 records into binary file
“teacher.dat”. Fields of teacher.dat file are [Tid,Name,Salary]