CS XII - PP-2
CS XII - PP-2
CLASS XII
COMPUTER SCIENCE (083)
General Instructions:
• This question paper contains 37 questions.
• All questions are compulsory. However, internal choices have been provided in some questions. Attempt
only one of the choices in such 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.
Section A
1. State whether the following statement is True or False: (1)
If no argument is passed, float() returns 0 as output.
2. Identify the output of the following code snippet. (1)
Str2 = " computerProgramming ".strip().capitalize().replace("o", "0").
replace("e", "3")
(a) Computerprogramming
(b) C0mput3rpr0gramming
(c) C0mputErPr0gramming
(d) C0mput3rpr0gramming
3. Which of the following expressions evaluates to False? (1)
(a) bool([])
(b) 5 != 5
(c) len("abc") == 3
(d) True and (False or True)
4. What will be the output of the given expression? (1)
nums = (5, 10, 15); nums * 2
(a) (5, 10, 15, 5, 10, 15) (b) Error
(c) (5, 10, 15, 2) (d) (10, 20, 30)
5. Identify the output of the following code. (1)
s = "Innovation"
print(s[-2:-9:-3])
(a) vno (b) oan
(c) vnt (d) nao
Section B
22. What is the difference between a list and a tuple in Python? Write the syntax to define a list and a tuple. (2)
23. Write two ways to create a duplicate list. (2)
24. Answer the following using built-in functions only.
If Dict1 = {'aa': 1, 'bb': 2, 'cc': 3, 'dd': 4, ...} and Dict2 = {'x1':
10, 'y1': 20, 'z1': 30, ...}, then (2)
(I) (A) Write a statement to get the value associated with the key ‘bb’ in Dict1.
OR
(B) Write a statement to add a new key-value pair 'dd':5 to the dictionary Dict1.
(II) (A) Write a statement to update Dict1 with all key-value pairs from Dict2.
OR
(B) Write a statement to remove the key ‘aa’ from Dict1.
25. From the given options, identify the correct output(s) of the following code. Write the minimum and
maximum possible values of the variable c. (2)
import random
text = "CodingSkills"
c = random.randint(3, 6)
for i in range(len(text)-1, c-1, -2):
print(text[i], end='|')
(a) c| (b) s|l|
(c) s|l|k| (d) s|l|k|c|
27. (I) (A) Which constraint should be applied to a table column to ensure that a specified default value is
automatically assigned if no value is provided during insertion? (2)
OR
(B) Which constraint should be used on a table column to ensure that only values from a specific range
are allowed in the column?
(II) (A) Write an SQL command to remove UNIQUE constraint from the column Username in a table named
USERS.
OR
(B) Write an SQL command to add NOT NULL constraint to an existing column Email in the table USERS.
28. (A) List any four objectives of FTP. (2)
OR
(B) List one advantage and one disadvantage of Infrared Transmission.
Section C
29. (A) Write a Python function that reads a text file "DocList.txt" and displays the total number of sentences
in the file (consider each line as a sentence). (3)
OR
(B) Write a Python function that reads ‘Novel.txt’ and displays the last 5 words from the file.
30. You have a Stack named TaskStack that contains records of tasks. Each task record is represented as a list
containing task_id, task_name and priority. (3)
Write the following user-defined functions in Python to perform the specified operations on the Stack
TaskStack:
(I) push_task(TaskStack, new_task): This function takes the Stack ‘TaskStack’ and a new task record
‘new_task’ as arguments and pushes the new task record onto the Stack.
(II) pop_task(TaskStack): This function pops the topmost task record from the Stack and returns it. If
the stack is already empty, the function should display ‘Underflow’.
(III) peep(TaskStack): This function displays the topmost element of the Stack without deleting it. If the
Stack is empty, the function should display ‘None’.
OR
Section D
32. Consider the table MOVIES and answer the following questions. (4)
Table: ORDERS
Field Type
customerID int(11)
CustomerName varchar(50)
City varchar(30)
totalPurchases float
membership varchar(10)
Section E
36. An insurance company needs to store details of its policyholders with the following fields: (5)
• Policy_ID – integer
• Policyholder_Name – string
• Policy_Type – string
• Premium – float
Write Python functions for the following:
1. To input policyholder details and append them to a binary file.
2. To change Policy_Type to ‘Premium’ for all policyholders whose premium is above 5000.
3. To read the binary file and display the details of policyholders whose Policy_Type is ‘Standard’.
37. A logistics company, FastRoute, is establishing a new branch in Hyderabad. The branch has four operational
zones: SHIPPING, WAREHOUSE, OFFICE and IT_SUPPORT while the HEAD OFFICE is in Bengaluru.
Building-to-building distance in the Hyderabad campus is as follows: (5)
HYDERABAD BENGALURU
SHIPPING WAREHOUSE
OFFICE IT SUPPORT
Building-to-building distance:
From To Distance
SHIPPING WAREHOUSE 60 m
SHIPPING OFFICE 80 m
SHIPPING IT_SUPPORT 50 m
WAREHOUSE OFFICE 70 m
WAREHOUSE IT_SUPPORT 40 m
OFFICE IT_SUPPORT 30 m
Distance between Bengaluru head office and Hyderabad campus: 500 km
SHIPPING 15
WAREHOUSE 20
OFFICE 30
IT_SUPPORT 25
BENGALURU HEAD OFFICE 10
(I) Where would you place the server in the Hyderabad campus and why?
(II) Which networking hardware is ideal for connecting computers within each zone?
(III) Draw the cable layout for optimal connectivity between buildings in Hyderabad and recommend the
best type of cable for stable data flow.
(IV) Is a repeater necessary in the given cable layout? Provide a reason for your answer.
(V) (A) Which of the following is the best option for fast data sharing between the Hyderabad branch and
Bengaluru head office?
(a) Videoconferencing
(b) File Transfer Protocol (FTP)
(c) Telephony
(d) Email
OR
(B) Which type of network (PAN, LAN, MAN or WAN) would be implemented within the Hyderabad
campus?