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

Xii Comp Sci MQP 11

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)
55 views9 pages

Xii Comp Sci MQP 11

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

KENDRIYA VIDYALAYA SANGATHAN HYDERABAD REGION

MODEL QUESTION PAPER


2024-25
कक्षा/CLASS: XII समय/TIME : 3
Hours
विषय/ SUBJECT COMPUTER SCIENCE (083) अधिकतम अंक/MAX MARKS: 70
General Instructions:

● Please check this question paper contains 35 questions.

● The paper is divided into 5 Sections- A, B, C, D and E.

● Section A, consists of 21 questions (1 to 21). Each question carries 1 Mark.

● Section B, consists of 7 questions (22 to 28). Each question carries 2 Marks.

● Section C, consists of 3 questions (29 to 31). Each question carries 3 Marks.

● Section D, consists of 4 questions (32 to 35). Each question carries 4 Marks.

● Section E, consists of 2 questions (36 to 37). Each question carries 5 Marks.

● All programming questions are to be answered using Python Language only.

● In case of MCQ, text of the correct answer should also be written.

प्र. अंक
क्र. Mar
प्रश्न Question
Ques ks
No
SECTION A (1 MARK QUESTIONS)
1 1
State whether the following statement is True or False
“It is difficult to identify logical errors in a program”
2 Select the correct output of the code : 1
S=”hello india"
C=S.title()
print(C)
(a) HELLO INDIA (b) Hello india (c) Hello India (d) hello India
3 Which of the following expressions evaluates to True? 1
a) (5>10) and (12<20) b) (1<5) or (12>14)
c) not ((1<5) or (23>62)) d) not (32>41) and (25==26)
4 What is the output of the given code? 1
s1=’KVS’
s2=’@@’
print(s1.join(s2))
a) K@V@S b) @KVS@ c) K@@V@@S d) None of these
5 What will be the output of the following code snippet? 1
s= "Good Morning"
print(s[-3::-2])
6 Which of the following statement(s) would give an error after executing the following 1
code?
T=(10,20,30,40,50) # Statement 1
print(T) # Statement 2
T=(1,2,3,4,5) # Statement 3
T[1]= 20 # Statement 4
T=T+(60,70) # Statement 5
a. Statement 1 b. Statement3 c. Statement 4 d. Statement 5
7 Given the following dictionary 1
Day={1:"January", 2: "February", 3: "March", 4:”April”}
Which statement will return "March".
(a) Day.pop() (b) Day.pop(2) (c) Day.pop(3) (d)
Day.pop("March")
8 What does list.pop(x) do in a python program? 1
(a) Remove the element at index x from a list
(b) Removes the first occurrence of value x from the list
(c) Removes all occurrences of value x from the list
(d) Removes the last occurrence of value x from the list
9 _________ is a non-key attribute, whose values are derived from the primary key of 1
some other table.
(a) Foreign Key (b) Primary Key (c) Candidate Key (d) Alternate Key
10 Write the missing statement to complete the following code: 1
f = open("STORY.txt", "r")
d = f.read(50)
____________________ #Print the position of the file pointer
f.close()
11 State whether the following statement is True or False: 1
The else part of try-except-else be executed when an exception occurs.
12 What will be the output of the following code? 1
a = 20
def display():
global a
a = a *2
print(a, end='#')
display()
a=15
print(a , end='%')
(a) 15%40# (b) 15#40% (c) 40#15% (d) 40%15#
13 Which SQL keyword is used to retrieve only unique values? 1
(a) DISTINCTIVE (b) UNIQUE (c) DISTINCT (d) DIFFERENT
14 What will be the output of the query? 1
SELECT Empname, Salary FROM Employee WHERE Salary IS NOT NULL;
(a) Empname and Salary of all employees whose salary is known
(b) Details of all employees whose salary is NOT NULL
(c) Names of all employees whose salary is NOT NULL
(d)Number of employees whose salary is NOT NULL
15 Which of the following is a DML Command? 1
(a) CREATE (b) DROP (c) DELETE (d) Both a and b
16 Which clause is used to arrange the records of a table in ascending or descending order? 1
(a) ASC ORDER (b) ARRANGE (c) ORDER BY (d) BY ORDER
17 Which protocol establishes a dedicated and direct connection between two 1
communicating devices?
a) HTTP b) FTP c) PPP d) SMTP
18 Which network device is used to amplify the signals to transmit them over longer 1
distances?
(a) Modem (b) Gateway (c) Switch (d) Repeater
19 What does the acronym MAN stand for? 1
a) Metropolitan Area Network c) Multi Area Network
b) Magnetic Access Network d) Multi –Access Net
Q 20 and 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 but R is not the correct explanation for A
(c) A is True but R is False
(d) A is false but R is True
20 Assertion (A):- If the arguments in a function call statement match the number and order 1
of arguments as defined in the function definition, such arguments are called positional
arguments.
Reasoning (R):- During a function call, the argument list first contains positional
argument(s) followed by default argument(s).
21 Assertion(A): SQL SELECT's GROUP BY clause is used to divide the result in groups. 1
Reason(R): The GROUP BY clause combines all those records that have identical values
in a particular field or in group by fields.
SECTION B (2 MARK QUESTIONS)

22 Rewrite the following code in Python after removing all syntax error(s) : 2
Underline each correction done in the code.

Marks = ( 35,40,56,23,64)
For I in Marks:
if I<23
print(Failed)
else
print(Not Failed)
23 Evaluate the following Python expressions : 2
(a) 2 * 3 + 4 ** 2 + 5 // 2
(b) 6 < 12 and not (20 > 15) or (10 > 5)
24 If A=[10,20,30,40,50,60,70,…. ], and B=[2,4,6,8,2,4,6,8, . . .], then 2
(Answer using built-in functions only)
I.
a) Write a statement to find the position of the first occurrence of 4 in B.
OR
b) Write a statement to delete an elements 30 from the list A.
II.
a) Write a statement to insert an element 5 at an index 3 in the list B
OR
b) Write a statement to sort the elements of list A in descending order.

25 What possible output(s) is/are expected to be displayed on the screen at the time of 2
execution of the program from the following code ? Also specify the maximum and
minimum value that can be assigned to the variable j when i is assigned value as 3.

import random
Sub = [ 'Math', 'Phy', 'Chem',’Bio’ ]
for i in range(3, 0, -1):
j = random.randint(0,i)
print (Sub[j], end = ' # ')
(a) Bio # Chem # Phy #
(b) Phy # Math # Math#
(c) Bio # Bio #Math#
(d) Chem # Bio #Math#
26 Write a function DisplayMarks (Student) in python that takes the dictionary, Student as 2
an argument. Display the name of the students whose marks is more than 90
Consider the following dictionary
Student={“Rahul”:95, “Sai” : 80 ,”Satwik”:75, “Shiv” :92}
The output should be:
Rahul
Shiv
27 2
I. A) Write an SQL command to delete a column Marks from a table STUDENT.
OR
B) Write an SQL command to change the data type of marks attribute of a
table STUDENT from int to float.
II. A) Write an SQL command to delete all the records from a table EMPLOYEE.
OR
B) Write an SQL command to delete a database SCHOOL from the server
28 (a) Write the difference between hub and switch. 2
OR
(b)
i. Expand the following: FTP,TCP /IP
ii. Give one disadvantage of Bus topology.
SECTION C (3 MARK QUESTIONS)

29 Write a python function that displays all the words starting with a vowel from a text file 3
‘STORY.TXT’.
OR
Write a python function that counts and displays the number of words starting with ‘a’ or
‘A’ in each line of a text file ‘STORY.TXT’

30 A. Consider a Nested List ‘Stationery’ in which all the elements are lists of the format – 3
[ItemID, ItemName, Price, Quantity]. Write the following user defined functions in
python to perform the task specified on the stack named ‘items’ which is initially an
empty list.
• Push_item(Stationery) – It takes nested list Inventory as argument and pushes records
of those items onto stack which have quantity > 100.
• Pop_items(Stationery) –It repeatedly pops the top element of stack and displays it.
Appropriate message should be displayed when there are no more elements left in the
stack.
• Peep_items(Stationery)- This function displays the topmost element of the stack
without deleting it. If the stack is empty, the function should display 'None'.

For example:
Stationery = [[101, ‘Pen’, 10, 120],
[102, ‘Pencil’, 10, 100],
[103, ‘Eraser’, 5, 90],
[104, ‘Notebook’, 20, 52],
[105, ‘Marker’, 30, 130],
[106, ‘Sharpener’, 5, 110]]
After execution of Push_Items(Stationery), Stack should contain:
[[101, ‘Pen’, 10, 120], [105, ‘Marker’, 30, 130], [106, ‘Sharpener’, 5, 110]]
The output after Pop_Items(Stationery) should be:
[106, ‘Sharpener’, 5, 110]
[105, ‘Marker’, 30, 130]
[101, ‘Pen’, 10, 120]
Stack Empty
OR
B. Write a function in Python Square(N) which takes a list N as the parameter and pushes
the squares of all the odd numbers and cubes of all the even numbers in a stack.
Write a popstack() to pop the topmost number from the stack and returns it. If the stack is
already empty, the function should display "Empty".
Write a function Dsiplay() which displays the elements present in the stack without
deleting them, if the stack is empty the function should display ‘None’.

31 Write the output of the following python code. 3


msg= ‘Hello World123’
n = len(msg)
new_msg = ‘’
for i in range(0,n):
if not msg[i].isalpha():
new_msg = new_msg + ‘@’
else:
if msg[i].isupper():
new_msg = new_msg + msg[i]*2
else:
new_msg = new_msg + msg[i]
print( new_msg)

OR
Write the output of the following python code.
L=[3,10,6,13]
for I in L:
for J in range(I%2,5):
print(J,'#',end='')
print()
SECTION D (4 MARKS QUESTIONS)

32 Consider the BIKES table given below: 4

BIKE_ID BIKENAME BRAND PRICE CC

B1 DUKE KTM 350000 390

B2 VERSEYS KAWASAKI 730000 650

B3 BENELLI BENELLI 630000 600

B4 NINJA KAWASAKI 7700000 1000

B5 S1000RR BMW 2000000 1000

A. Write the following queries:


i. To display the total Price of the bikes, whose price is more than 60000.
ii. To display the details of the bikes in alphabetical order of the bike names.
iii. To display the distinct brand names from the Bikes table.
iv. Display the maximum CC of all the bikes whose brand is ‘BMW’.

OR
B. Write the output:
i. Select * from bikes where cc>600;
ii. Select Bikename, Brand from bikes where price<70000;
iii. Select max(Price), min(Price) from Bikes;
iv. Select count(*) , brand from Bikes group by brand;
33 4
Vijay has created a csv file ‘FOOTBALL.CSV’ to store player name, matches and goals
scored.
Write a program in python that defines and calls following user defined functions.
i. addPlayer(name, matches, goals) : Three parameters – name of the player, matches
played and goals scored are passed to the function. The function should create a list
object and append it to the csv file.

ii. AverageGoals( ): The function should read the csv file and display the name of the
player with their average goals (goals/matches).

34 Consider the tables COMPANY and CUSTOMER and extract the following 4
information by writing the desired SQL queries as mentioned below
COMPANY

CID NAME CITY PRODUCTNAME

101 LG KOLKATA TV
102 HP DELHI LAPTOP
103 DELL MUMBAI KEYBOARD
104 ACER DELHI LAPTOP
105 ASUS KOLKATA LAPTOP

CUSTID NAME PRICE QTY CID


100011 RAHUL 40500 10 101
100012 SAHIL 3000 20 103
100013 SATWIK 55000 3 104
100014 SARTHAK 45000 20 105

CUSTOMER
I. To display the company names whose price is less than 43000
II. To add one column totalprice with decimal (10,2) to the table customer
III. To increase the price of the customers whose name starts with ‘S’ by 200
IV. A. To display the Customer names in reverse alphabetical order
OR
B. To display the number of products available in each city.
35 A student created a table Inventory in MYSQL database, warehouse with following 4
structure:
Inv_No(Inventory Number )- integer
Inv_name(Name) – string
Inv_Entry(Date )
Inv_price – Decimal
Note the following to establish connectivity between Python and MySQL:
Username - root
Password - 12345
Host - localhost
Write the following Python function to perform the specified operation:

InsertRecord () : To accept the inventory details from user and insert a new row into the
table. The function should then retrieve and display the records.

SECTION E (5 MARK QUESTIONS)

36 Shweta had stored all her passwords in one binary file named ‘PASSWORDS.DAT’. The 5
passwords were stored in following format:
[app_name, username, password]
i. Write a function that accepts title as a parameter and displays the username
and password for that particular app.
ii. Write a function to read the data and display all the app names which start
with ‘A’
iii. Write a function to add a new app details to the binary file.
37 5
Shalimar Solutions is setting up a campus in Mumbai. The campus have four Blocks
Alpha, Beta, Gamma and Theta. Suggest the best possible solutions for their questions
(a) to (e) based on the information given below.
Blocks Distance(m)
Alpha to Beta 25
Alpha to Gamma 75
Alpha to Theta 45
Beta to Gamma 80
Beta to Theta 125

Block No. of
Computers
Alpha 120
Beta 45
Gamma 25
Theta 30
a) Suggest the most appropriate block to house the server. Justify your answer.
b) Which Hardware/Software can be installed prevent unauthorized access to server?
c) Suggest the best wired transmission medium and draw the cable layout
diagram to connect the four blocks.
d) The company doesn’t want to use any wired media for connecting the computers
within
the Alpha block. Which device can be used to provide wireless access, given that all the
machines in this block are wi-fi enabled.
b) A. Which network device is used to connect all the computers present in each block?
i. Repeater ii. Router iii. Hub/Switch iv. Bridge
OR
B. Is there a requirement of repeater in the given cable layout? Justify

You might also like