0% found this document useful (0 votes)
116 views7 pages

CS Xii - PP-1

Uploaded by

rahulkrana6899
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
116 views7 pages

CS Xii - PP-1

Uploaded by

rahulkrana6899
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

APPENDIX E

PRACTICE PAPER 1
CLASS XII
COMPUTER SCIENCE (083)
Time Allowed: 3 hrs Maximum Marks: 70

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)
print() method without any argument shall display a blank line.
2. Identify the output of the following code snippet: (1)
string = " Learn Python Programming "
result = string.strip().upper().replace(" ", "_")
print(result)
(a) LEARN PYTHON PROGRAMMING (b) Learn_Python_Programming
(c) Learn_python_programming (d) LEARN_PYTHON_PROGRAMMING
3. Which of the following expressions evaluates to True? (1)
(a) 5 * 2 == 10 and not (7 <= 5 or 3 == 4) (b) 8 > 10 or (4 == 4 and 6 > 8)
(c) 12! = 12 or (3 * 2 < 5 and 4 == 4) (d) 15 < 10 and (2 < 3 or 8 == 8)
4. What will be the output of the given expression? (1)
text = "Hello World"
print(text.lower().replace("o", "0"))
(a) hello w0rld (b) Hello W0rld
(c) hell0 w0rld (d) Hello World
5. What will be the output of the following code snippet? (1)
text = "AdvancedProgramming"
result = text[-12:-5][::-1]
print(result)
(a) dProgra (b) mmargorPdecn
(c) argorPd (d) ncedProgramm
6. What will be the output of the following code? (1)
data = {'A': (5, 8), 'B': (3, 6), 'C': (7, 2)}
result = data['A'][1] + data['B'][0] - data['C'][1]
print(result)
(a) 9 (b) 8
(c) 10 (d) 7
7. If student_info is a dictionary as defined below, then which of the following statements will raise an
exception?(1)
student_info = {'id': 101, 'name': 'John', 'grade': 'A'}
(a) student_info['name'] = 'Jane' (b) student_info['grade'] = 'B'
(c) print(student_info.get('id')) (d) print(student_info['age'])
8. What does list.sort() method do in Python? (1)
(a) It returns a new sorted list and leaves the original list unchanged.
(b) It sorts the original list in ascending order and returns None.
(c) It sorts the original list in descending order and returns the sorted list.
(d) It raises an exception if the list contains mixed data types.
9. EMPLOYEES table contains 4 rows and 3 columns: EmployeeID, EmployeeName and Position, while PROJECTS
table contains 3 rows and 2 columns: ProjectID and ProjectName. What will be the cardinality and degree
of the resultant table after applying a Cartesian Product to both the tables? (1)
10. Write the missing statement to complete the following code: (1)
file = open("data.txt", "r")
data = file.read(200)
_________________ # Move the file pointer to the 50th byte in the file
new_data = file.read(100)
file.close()
11. State whether the following statement is True or False: (1)
The process of fixing errors in a program is called debugging.
12. What will be the output of the following code? (1)
x = 15
def modify():
    global x
   x = x + 5
   print("Inside function:", x)
modify()
print("Outside function:", x)
(a) Inside function: 20 (b) Inside function: 20
Outside function: 15 Outside function: 20
(c) Inside function: 15 (b) Inside function: 15
Outside function: 15 Outside function: 20
13. Which SQL command is used to delete the entire table from a database? (1)
14. What will be the output of the given query? (1)
SELECT COUNT(DISTINCT album_no) FROM Music WHERE artist_name IS NOT NULL;
(a) The total number of distinct album_no values in Music table, regardless of whether artist_name is NULL
or not.
(b) The total number of album_no values where artist_name is NOT NULL, including duplicates.
(c) The total number of distinct album_no values where artist_name is NOT NULL.
(d) The total number of rows in Music table where artist_name is NOT NULL.
15. Which of the following is NOT a valid SQL data type? (1)
(a) VARCHAR (b) TEXT
(c) BOOLEAN (d) STRING
16. If you want to find the average salary of the employees in a department, which function would you
use?(1)
(b) AVERAGE() (b) AVG()
(c) MEAN() (d) SUM()
17. Which protocol is used to send emails? (1)
(a) FTP (b) SMTP
(c) HTTP (d) ICMP

Appendices A.47
18. Which device is used to connect multiple networks and can translate protocols? (1)
(a) Bridge (b) Switch
(c) Router (d) Hub
19. Explain the concept of Bandwidth in computer networking. (1)
Q.20 and 21 are Assertion and Reasoning based questions. Mark the correct 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): Default arguments in functions must be placed after non-default arguments.
Reason (R): This ensures that all parameters can be supplied in the correct order. (1)
21. Assertion (A): GROUP BY clause is used to aggregate data in SQL queries.
Reason (R): HAVING clause filters records after aggregation function. (1)

Section B
22. Differentiate between Lists and Tuples in Python. Provide example. (2)
23. Describe any two built-in methods of dictionary. Provide syntax and examples. (2)
24. Answer the question using built-in functions. Given the following two lists in Python: (2)
fruits = ['apple', 'banana', 'cherry']
numbers = [1, 2, 3]
I. (a) Write a statement to insert the string ‘orange’ at the second position of the fruits list.
OR
(b) Write a statement to extend the numbers list by adding the elements [4, 5] to the list.
II. (a) Write a statement to remove ‘banana’ from the fruits list.
OR
(b) Write a statement to calculate the sum of all elements in the numbers list.
25. Identify the correct output(s) of the following code. Also write the minimum and the maximum possible
values of the variable start. (2)
import random
Animals = ["ELEPHANT","LION","TIGER","CAT","FOX","HORSE","DOG"]
last = random.randrange(2)+3
start = random.randrange(last)+1
for i in range(start,last):
     print(Animals[i],end="#")
(a) LION#TIGER#CAT# (b) ELEPHANT#
(c) FOX#DOG# (d) DOG#
26. The following code is intended to calculate the average of the given values. However, there are syntax and
logical errors in the code. Rewrite it after removing all errors. Underline all the corrections made. (2)
def calculate_average(nums):
total = 0
   for i in nums
      total += i
   average = total / len(nums)
   return "average"
values = [10, 20, 30]
avg = calculate_average(values)
print("The average is: " + avg)

A.48 Computer Science with Python–XII


27.I. (a) What constraint should be applied on a table column to ensure that all entries are different but the
column still accepts NULL values? (2)
OR
(b) What constraint should be applied to establish a relationship between two tables, ensuring that the
values in a specific column of one table correspond to existing values in the column of another
table?
II. (a) Write the SQL command to add a NOT NULL constraint to the column NAME in a table called
VENDORS.
OR
(b) Write the SQL command to add a DEFAULT value of ‘Pending’ to the STATUS column in a table
called FEES.
28. (a) Write any two advantages of fibre optic cable. (2)
OR
(b) What does VoIP stand for? What is its use?

Section C
29. (a) Write a Python function called find_longest_word(filename) that reads a text file and returns the longest
word found in the file. If there are multiple longest words, return one of them. (3)
OR
(b) Write a Python function named reverse_lines(filename) that reads a text file and writes a new file where
the order of the lines is reversed.
30. (a) You have a Stack named CustomerStack that contains records of customers. Each customer record is
represented as a list containing customer_id, customer_name and contact_number.
Write the following user-defined functions in Python to perform the specified operations on the Stack
CustomerStack:(3)
(i) push_customer(CustomerStack, new_customer): This function takes the Stack CustomerStack and
a new customer record new_customer as arguments and pushes the new customer record on to
the Stack.
(ii) pop_customer(CustomerStack): This function pops the topmost customer record from the Stack
and returns it. If the Stack is already empty, the function should display ‘Underflow’.
(iii) peek(CustomerStack): This function displays the topmost element of the Stack without deleting it.
If the Stack is empty, the function should display ‘None’.
OR
(b) Write the definition of a user-defined function Push_div5(N) which accepts a list of integers in a
parameter ‘N’ into a Stack named DivisibleBy5.
Write function Pop_div5() that pops the topmost number from the Stack and returns it. If the Stack is
already empty, the function should display ‘Empty’.
Write function Display_div5() to display all elements of the Stack without deleting them. If the Stack is
empty, the function should display ‘None’.
31. Predict the output of the following code: (3)
(a) student_marks = {'Alisha': 95,'Bhavesh': 80,'Charvi': 68,'Diva': 92}
for student in student_marks:
  student_marks[student] -= 2
print("Updated scores:", student_marks)
top_marks = max(student_marks.values())
print("Highest score:", top_marks)
top_student = max(student_marks, key=student_marks.get())
print("Top student:", top_student)
OR

Appendices A.49
(a) values = [10, 7, 5, 8, 3]
squarenumber_list = []
for num in values:
   squarenumber_list.append(num ** 2)
print("List of Original numbers:", values)
print("List of Squared numbers:", squarenumber_list)
print("Sum of squared numbers:", sum(squarenumber_list))

Section D
32. Consider the given table GIFTS:(4)
Gift_ID Gift_Name Quantity Marks
G1901 Pen Stand 20 4000
G1809 SUP Game 10 8000
G1902 Soft Toys 5 5600
G1790 Watch 15 9500

Note: The table contains more records than shown here.
(a) Write the following queries:
(i) To display the total quantity of each gift, excluding gifts with total quantity less than 10.
(ii) To display GIFTS table sorted by total price in ascending order.
(iii) To display the distinct gift names from GIFTS table.
(iv) Display the average price of those gifts whose names contain the letter ‘t’.
OR
(b) Write the output:
(i) Select Gift_Name, sum(Quantity) as 'total_quantity' from GIFTS group by
Gift_Name;
(ii) Select * from GIFTS where Gift_Name like ‘S%’;
(iii) Select Gift_ID, Gift_Name, Quantity, Price from GIFTS where price > 1000;
(iv) Select min(Price) from GIFTS;
33. A csv file ‘Success.csv’ contains the data of a survey. Each record of the file contains the following data: (4)
• Name of the City
• Number of people in City
• Sample Size (Number of people who participated in the survey in that city)
• Success (Number of people who accepted that they were Successful)
For example, a sample record of the file may be:
['Delhi', 33807000, 5500, 2560]
Write the following Python functions to perform the specified operations on this file:
(i) Read all the data from the file in the form of a list and display all those records for which the number of
people is more than 30000000.
(ii) Count the number of records in the file.
34. Rajesh works as a Database Administrator in an IT company. He needs to access some information from
EMPLOYEES and PROJECTS tables for a survey analysis. Help him extract the following information by writing
the desired SQL queries as mentioned below. (4)
Table: EMPLOYEES
EMP_ID EMP_FIRSTNAME EMP_LASTNAME DATE_OF_JOINING SALARY
E4001 Alina Gupta 2010-02-10 25000
E4002 Sumit Pathak 2012-06-09 28000
E4003 Sakshi Sharma 2003-05-16 12000
E4004 Lavanya Grover 2021-10-05 45000
E4006 Tarun Arora 2020-08-14 35000

A.50 Computer Science with Python–XII


Table: PROJECTS
PROJECT_ID EMP_ID PROJECT_NAME DURATION (In Months)
P1110 E4001 Learning Management System 6
P1111 E4006 University Management System 5
P1112 E4001 Banking Management System 12
P1113 E4003 Billing System 4
P1114 E4002 Inventory Management System 3
P1115 E4001 Attendance Marking System 7
(i)
To display complete details (from both the tables) of those Employees whose salary is more than 20000.
(ii)
To display the details of projects whose duration is in the range of 3 to 12 months (both values included).
(iii)
To decrease the duration of all projects that contain the letter ‘i’ in their names by 2 months.
(iv)
(a) To display names (FirstName and LastName) of employees whose date of joining is before
‘2010-01-20’.
OR
(b) To display the degree and cardinality of both the tables (EMPLOYEES and PROJECTS).
35. A table named FLORIST in FLOWERS database has the following structure: (4)
Field Type
Flower_Name Varchar (20)
Flower_Color Varchar (15)
Price Decimal(5,2)
Quantity Int(10)
Write the following Python function to perform the specified operation:
Show() to input details of flowers and store them in the table FLORIST. The function should then retrieve and
display all records from FLORIST table where the Price is greater than 150.
Assume the following for Python-Database connectivity:
Host: localhost
User: root
Password: Flora

Section E
36. Vinita is a librarian working in a private school. She needs to manage the records of various books. For this,
she wants the following information of each book to be stored: (5)
• Book_ID – Integer
• Book_Name – String
• Purchase_date – Date
• Price – Float
• Subject – String
As a programmer of the school (IT Department), you have been assigned to do this job for Vinita.
(a) Write a function to input the data of books and append it in a binary file.
(b) Write a function to update the data of books whose price is more than 350 and change their ID to ‘B101’.
(c) Write a function to read the data from the binary file and display the data of all those books which are of
‘English’.
37. Heels Private Limited is a footwear company. It is planning to set up its India campus in Hyderabad with
its head office in Noida. The Hyderabad campus will have five blocks—ADMIN, SALES, MATERIAL, TARGET
AUDIENCE and PRODUCT CATEGORIES. As a network expert, you need to suggest the best network-related
solutions to resolve the issues mentioned in points (a) to (e), keeping in mind the distances between various
blocks and other given parameters. (5)

Appendices A.51
HYDERABAD NOIDA
ADMIN
TARGET
AUDIENCE
HEAD
SALES
PRODUCT OFFICE
CATEGORIES
MATERIAL

Block-to-block distances (in metres):
From To Distance
ADMIN SALES 50
ADMIN TARGET AUDIENCE 65
ADMIN MATERIAL 44
ADMIN PRODUCT CATEGORIES 56
SALES MATERIAL 75
SALES PRODUCT CATEGORIES 90
MATERIAL PRODUCT CATEGORIES 25
MATERIAL TARGET AUDIENCE 68

Distance between Noida head office and Hyderabad campus = 1550 km


Number of computers in each block is as follows:
ADMIN 50
SALES 15
MATERIAL 25
TARGET AUDIENCE 08
PRODUCT CATEGORIES 20
NOIDA HEAD OFFICE 36

(a) Suggest the most appropriate location of the server inside the Hyderabad campus. Justify your choice.
(b) Which hardware device will you suggest to connect all the computers within each building?
(c) Draw the cable layout to efficiently connect various building within the Hyderabad campus. Which cable
would you suggest for the most efficient data transfer over the network?
(d) Is there any requirement of a repeater in the given cable layout? Give reasons for your answer.
(e) (i) What would be your recommendation for enabling live visual communication between the Admin
Office at the Hyderabad campus and the Noida head office from the following options:
I. Videoconferencing
II. Instant Messaging
III. Email
IV. Telephony
OR
(ii) Which type of network (PAN, LAN, MAN or WAN) will be set up among the computers connected in the
Hyderabad campus?

A.52 Computer Science with Python–XII

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy