0% found this document useful (0 votes)
23 views

Sample Paper(Computer Science)

This document is a sample question paper for Class XII Computer Science (083) for the academic year 2024-25. It consists of 37 questions divided into five sections, covering various topics such as Python programming, SQL, and networking concepts. The paper includes multiple-choice questions, programming tasks, and theoretical questions, with a total duration of 3 hours and a maximum score of 70 marks.
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)
23 views

Sample Paper(Computer Science)

This document is a sample question paper for Class XII Computer Science (083) for the academic year 2024-25. It consists of 37 questions divided into five sections, covering various topics such as Python programming, SQL, and networking concepts. The paper includes multiple-choice questions, programming tasks, and theoretical questions, with a total duration of 3 hours and a maximum score of 70 marks.
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/ 8

SAMPLE PAPER

(2024-25)
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)


The arguments of range() function in Python must be integers.
2. Identify the output of the following code snippet: (1)
text = "Hello World from Python"
modified_text = text.title().strip().replace("o", "@").replace(" ", "-")
print(modified_text)
(a) Hell@-W@rld-Fr@m-Pyth@n (b) Hell@-W@rld-from-Pyth@n
(c) Hello-World-from-Python (d) Hell@-World-from-Python
3. Which of the following expressions evaluates to True? (1)
(a) True and not (False or True) (b) False or (True and False)
(c) True or (False and True) (d) False and (True or False)
4. What will be the output of the given expression? (1)
text = "Hello, welcome to the world of Python!"
print(text.find("world"))
(a) 13 (b) 18
(c) 22 (d) –1
5. What will be the output of the following code snippet? (1)
course = "AdvancedMachineLearning"
result = course[0:9] + course[10:18]
print(result)
(a) AdvancedMchineLea (b) AdvancedMachineLea
(c) AdvancedMacchineLea (d) AdvancedMachineLearn
6. What will be the output of the following code? (1)
t1 = (1, 2, 3)
t2 = (4, 5)
result = t1 * 2 + t2
print(result)
(a) (1, 2, 3, 1, 2, 3) + (4, 5) (b) (1, 2, 3, 4, 5)
(c) (2, 4, 6, 8, 10) (d) (1, 2, 3, 1, 2, 3, 4, 5)
7. If car_info is a dictionary as defined below, then which of the following statements will raise an exception? (1)
car_info = {'make': 'Toyota', 'model': 'Corolla', 'year': 2020}
(a) car_info['model'] = 'Camry' (b) car_info['year'] = 2021
(c) print(car_info.get('make')) (d) print(car_info['color'])
8. Which of the following statements accurately describes the behaviour of the update() method when used with
dictionaries in Python? (1)
(a) It creates a new dictionary by merging the original dictionary with another dictionary or iterable and returns this new
dictionary.
(b) It replaces the values of the keys that already exist in the dictionary with the values from another dictionary or
iterable and adds new key-value pairs if they do not exist in the original dictionary.
(c) It only adds new key-value pairs from another dictionary or iterable to the original dictionary without modifying any
existing key-value pairs.
(d) It removes key-value pairs from the original dictionary that are present in another dictionary or iterable.
9. If a table has three candidate keys and two alternate keys, then how many primary keys will this table have? (1)
10. Write the missing statement to complete the following code: (1)
file = open("records.txt", "r")
content = file.read()
_________________ # Move the file pointer to the beginning of the file
firstline = file.readline()
file.close()
11. State whether the following statement is True or False: (1)
IOError is raised in Python when an index is not found in a sequence, i.e., it is out of range or out of bounds.
12. What will be the output of the following code? (1)
z = 30
def cal():
z = 60
print(z, end="#")
cal()
z = z + 10
print(z, end="@")
(a) 60#70@ (b) 60#30@
(c) 60#40@ (d) 60@40#
13. Which SQL command is used to add a primary key constraint to an existing table? (1)
14. What will be the output of the following query? (1)
SELECT AVG(salary) FROM Employees WHERE department = 'HR';
(a) The average salary of all employees in the Employees table.
(b) The average salary of employees whose department is ‘HR’, including those with NULL values for salary.
(c) The average salary of employees whose department is ‘HR’, excluding NULL values for salary.
(d) The total salary of all employees in the Employees table whose department is ‘HR’.
15. In a table in MySQL database, an attribute X of datatype varchar(15) has the value ‘Computer’. The attribute Y of
datatype char(15) has the value ‘Science’. How many characters are occupied by attribute X and attribute Y? (1)
(a) 15, 7 (b) 8, 15
(c) 8, 7 (d) 7, 8
16. What does COUNT() function return when used as COUNT(*) with SQL SELECT statement? (1)
(a) The number of distinct rows (b) The sum of all values
(c) The number of non-NULL values
(d) The total number of rows in the table, including NULL values.
17. Which type of network topology has a central hub or switch? (1)
(a) Mesh Topology (b) Bus Topology
(c) Star Topology (d) Ring Topology
18. Which device can selectively forward data based on MAC address, thereby reducing unnecessary traffic? (1)
(a) Bridge (b) Switch
(c) Router (d) Hub
19. Why is a switch called an intelligent hub? (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): A function in Python can be called before it is defined in the code.
Reason (R): Python uses a top-down approach for code execution. (1)
21. Assertion (A): A foreign key establishes a relationship between two tables.
Reason (R): A foreign key must contain unique values in the parent table. (1)

Section B

22. Why are lists called mutable data type? Explain with examples. (2)
23. What is implicit conversion in Python? (2)
24. Answer the following using built-in functions only. (2)
If T1= (3,5,7,9) and T2 = (1,2,4,6), then
I. (a) Write a statement to convert T1 to a list.
OR
(b) Write a statement to find the maximum value from tuple T2.
II. (a) Write a statement to find the sum of all elements in T1.
OR
(b) Write a statement to find the length of T2.
25. Identify the correct output(s) of the following code. Also write the minimum and the maximum possible values
of the variable val. (2)
import random
s =[100,75,10,125]
val =random.randint(0,3)
for j in range(val):
print(s[j],"$$")

(a) 100$$ (b) 100$$


75$$ 99$$
10$$
(c) 150$$ (d) 125$$
100$$ 10$$
26. The following code is intended to check whether a number is positive or not; if negative, then make it a
positive number. However, there are syntax and logical errors in the code. Rewrite it after removing all
errors. Underline all the corrections made. (2)
DEF check_num():
num = input("Enter a number:")
if (abs(num)= num):
print"You entered a positive number"
else:
num=*-1
print"Number made positive:"num
check_num()
27. I. (a) What constraint should be used to ensure that a column contains unique values but must not
accept NULL entries? (2)
OR
(b) What constraint can be applied to a table column to ensure that all entries meet a specific condition
such as allowing only positive numbers?
II. (a) Write the SQL command to create a unique constraint on the Marks column in a table named Student.
OR
(b) Write the SQL command to make the column Product_ID the primary key of an already existing table,
named PRODUCT.
28. (a) List one advantage and one disadvantage of bus topology. (2)
OR
(b) What does WAN stands for? Describe.
Section C
29. (a) Write a Python function called Replace_ Word(filename, old_word, new_word) that takes three
parameters: filename (string), old_word (string) and new_word (string). The function should replace
all occurrences of old_word with new_word in the specified file. (3)
OR
(b) Write a Python function called Unique_Words(filename) that takes a single parameter, filename (string).
The function should read the content of the specified file and return a set of unique words.
30. (a) Consider a dictionary containing names and fees as key-value pairs of 5 doctors. Write a program with
separate user-defined functions to perform the following operations: (3)
(i) Push the keys (name of the doctors) of the dictionary into a Stack where the corresponding value
(fees) is greater than 1000.
(ii) Pop and display the contents of the Stack.
The dictionary should be as follows:
doc={"Reena":500, "Amrita": 1000, "Shama":900, "Vishal":1500, "Vyom":2000}
Then the output will be:
Vishal, Vyom
OR
(b) Write functions in Python, do_push(Num) and do_pop(Num), to add a new number and delete a
number from a list of numbers, considering them to act as push and pop operations of the
Stack data structure.
31. Predict the output of the following code: (3)
(a) products = {
"Laptop": 1000,
"Smartphone": 600,
"Tablet": 300,
"Headphones": 150
}
discounted_products = {}
for product, price in products.items():
discounted_price = price * 0.9 # Apply a 10% discount
discounted_products[product] = discounted_price
print(discounted_products)
OR
(b) matrix = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
]
result = []
for i in range(len(matrix)):
row_sum = 0
for j in range(len(matrix[i])):
row_sum += matrix[i][j]
result.append(row_sum)
print(result)
Section D
32. Consider the given table STUDENT: (4)
Table: STUDENT
Note: The table contains more records than shown here.
(a) Write the following queries:
(i) To display the records in alphabetical order as per the name of the student.
(ii) To display the average marks of Delhi students.
(iii) To display the details of students whose names end with the letter ‘a’.
(iv) To display the total number of students studying in class XI or XII.
OR
(b) Write the output:
(i) Select * from STUDENT where gender = 'F' and marks>350;
(ii) Select RollNo, DOB, City from STUDENT where Marks between 200 and 300;
(iii) Select Min(Marks ) from STUDENT;
(iv) Select Name, Marks from STUDENT where city IN ('Agra', 'Dubai');
33. Write user-defined functions to perform read and write operations on to a ‘teacher.csv’ file having fields
TeacherID, Name, Subject and Experience (in years). (4)
34. Dhriti works in Prilknot Pvt. Ltd. She needs to access some information from SALESMAN and CUSTOMER tables.
Help her extract the following information by writing the desired SQL queries as mentioned below. (4)
Table: SALESMAN

Table: CUSTOMER

(a) To display the details (from both the tables) of the salesmen whose commission is less than 0.15.
(b) To display the details of customers whose grade is in the range of 100 to 400.
(c) To increase the grade by 250 of all the customers who belong to New York.
(d) (i) To display the names and id of customers who belong to Moscow or London.
OR
(ii) To display the cartesian product of these two tables.
35. A table, named VEHICLE in MOTORSDB database, has the following structure: (4)
Write the following Python function to perform the specified operation:
Show_data() to display and read only those records in which Quantity more than 100.
Note the following to establish connectivity between Python and MySQL:
Host: localhost
Username: root
Password: motors
Section E
36. Shreya is a manager working in Le Hotels Group of J&G industry. She needs to manage the records of various
hotels. For this, she wants the following information of each hotel to be stored: (5)
Hotel_ID – Integer
Hotel_Name – String
Location – String
No_of _Rooms – Integer
As a programmer of the company, you have been assigned to do this job for Shreya.
(a) Write a function to input the data for a record and add to a binary file.
(b) Write a function in Python which accepts Location as a parameter and counts and returns the number of
hotels by the given location stored in a binary file.
37. Canvo International Inc. is planning to connect its Bengaluru Office Set-up with its Head Office in Delhi. The
Bengaluru Office of Canvo International Inc. is spread across an area of approximately 1 square kilometre,
consisting of 3 blocks: Human Resources, Administration and Academics. As a network expert, you have to
suggest solutions to the following five queries, i.e., (a) to (e), raised by them, keeping in mind the distances
between various blocks and the number of computers in each block. (5)

Shortest distances between various blocks:


Number of computers installed in various blocks are as follows:

(a) Suggest the most suitable block in the Bengaluru Office Set-up to host the server. Give a suitable reason.
(b) Suggest a cable layout among the various blocks within the Bengaluru Office Set-up for connecting the
blocks.
(c) Suggest a suitable networking device to be installed in each block, essentially required for connecting
computers inside the blocks with fast and efficient connectivity.
(d) Suggest the most suitable media to provide secure, fast and reliable data connectivity between the Delhi
Head Office and the Bengaluru Office Set-up.
(e) (i) What would be your recommendation for enabling live visual communication between the Bengaluru
Office and the Delhi 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
Bengaluru Office?

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