0% found this document useful (0 votes)
20 views12 pages

Computer Science QP - Set 1

The document is a pre-board examination paper for Computer Science (083) for Grade XII, scheduled for December 20, 2024, with a maximum score of 70 marks. It consists of 37 questions divided into five sections, covering various topics including Python programming, SQL commands, and network protocols. Each section has specific marking schemes and instructions for answering the questions.

Uploaded by

sethamangala
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)
20 views12 pages

Computer Science QP - Set 1

The document is a pre-board examination paper for Computer Science (083) for Grade XII, scheduled for December 20, 2024, with a maximum score of 70 marks. It consists of 37 questions divided into five sections, covering various topics including Python programming, SQL commands, and network protocols. Each section has specific marking schemes and instructions for answering the questions.

Uploaded by

sethamangala
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/ 12

HOSUR SAHODAYA SCHOOLS COMPLEX

PRE-BOARD EXAMINATION (2024-25)


SUBJECT: COMPUTER SCIENCE (083)
PRE-BOARD EXAMINATION
SET 1 (2024-25)
GRADE XII
Date : 20.12.2024 Max. Marks : 70 Marks
Subject : COMPUTER SCIENCE (083) Time allowed : 3 Hours

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.

Q. NO SECTION – A (21 x 1= 21 Marks) Marks


1. State True or False: 1
It is mandatory to have an except block after every try block.
2. Deduce the output of the following code snippet: 1
text = "Hello, Python World!"
output = text.split(",")
print(output)
3. Which of the following expression will evaluate to True? 1
a) (4 < 2) and (10 > 8)
b) (4 > 2) or (10 < 8)
c) not (3 == 3)
d) (6 > 6) and (5 <= 5)
4. Identify the output of the following code? 1

Page 1 of 12
s = "Python"
print(s + " is fun!")
a) Python is fun!
b) Pythonisfun!
c) Python + is fun!
d) is fun!Python
5. Deduce the output of the following code snippet. 1
my_list = [5, 10, 15, 20]
print(my_list[::2])
6. What will be the output of the following code? 1
t = (1, 2, 3)
t += (4, 5)
print(t)
a) (1, 2, 3)
b) (1, 2, 3, 4, 5)
c) Error
d) (4, 5)
7. If you want to check if the key 'x' exists in the dictionary my_dict, which code snippet 1
would be appropriate?
a) 'x' in my_dict
b) my_dict.has_key('x')
c) my_dict['x']
d) my_dict.contains('x')
8. You are working on a project where you need to rank a list of students based on their scores 1
in a recent exam. The scores are stored in a list, and you want to display the scores from
highest to lowest. Which of the following methods would you use to sort the scores list in
descending order?
a) scores.sort(reverse=True)
b) scores.sort(ascending=False)
c) scores.sort_desc()
d) scores.sort(reverse=False)
9. Consider the statement provided below 1
my_tuple = (1, 2, 3)
Which of the following will cause an error?
a) my_tuple += (4,)

Page 2 of 12
b) my_tuple[1:3]
c) my_tuple.pop()
d) my_tuple.index(2)
10. Complete the following code to read the entire content of a file named notes.txt: 1
with open('notes.txt', 'r') as file:
content = file._________()
file.close()
11. State True or False. 1
The else block in exception handling will execute only if there is an exception in the try
block.
12. Deduce the output of the following code. 1
num = 100
def change_value():
global num
num += 50
return num
print(change_value())
print(num*2,end=”*”)
a) 150 and 150
b) 150 and 300
c) 150 and 300 *
d) 150* and 300 *
13. In a relational database, you have a table named employees that currently consists of three 1
columns: id, name, and salary. If the company decides to add a new column for department,
write the SQL command would you use to modify the existing table structure?
14. Suppose you have a table employee and you need to increase the salary of all employees 1
by 10% who have been with the company for more than 5 years. Which command would
achieve this?
a) UPDATE employees SET salary = salary * 1.1 WHERE years_with_company > 5;
b) MODIFY employees SET salary = salary * 1.1 WHERE years_with_company > 5;
c) CHANGE employees SET salary = salary + (salary * 0.1) WHERE
years_with_company > 5;
d) SELECT * FROM employees WHERE years_with_company > 5;
15. Consider a scenario where you need to find the total number of orders placed by each 1
customer. Which SQL command would accomplish this?

Page 3 of 12
a) SELECT customer_id, COUNT(*) FROM orders GROUP BY customer_id;
b) SELECT COUNT(customer_id) FROM orders;
c) SELECT customer_id, SUM(order_amount) FROM orders;
d) SELECT * FROM orders;
16. How would you find the minimum order_date from the orders table where the total amount 1
exceeds Rs.100?
a) SELECT MIN(order_date) FROM orders WHERE total_amount > 100;
b) SELECT MIN(order_date) FROM orders;
c) SELECT COUNT(order_date) FROM orders WHERE total_amount > 100;
d) SELECT FIRST(order_date) FROM orders WHERE total_amount > 100;
17. Imagine you are troubleshooting a network issue where users are unable to access websites 1
by their domain names, but they can access them via IP addresses. Which protocol, given
below is responsible for converting hostnames into IP addresses?
a) DHCP
b) DNS
c) FTP
d) HTTP
18. If a student wants to create a network that allows multiple computers to share a single 1
Internet connection and resources like printers, which device should they use?
a) Hub
b) Router
c) Switch
d) Repeater
19. Name one application that typically uses circuit switching. 1
Q 20 and Q 21 are Assertion (A) and Reason (R) 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 and R is not the correct explanation for A.
c) A is True and R is False.
d) A is False and R is True.
e) Both A and R are False.
f) Both A and R are True.
20. Assertion (A): A function can modify a global variable if it is not declared as global within 1
the function.

Page 4 of 12
Reasoning (R): The function creates a local variable with the same name, which does not
affect the global variable.
21. Assertion (A): The WHERE clause cannot be used with aggregate functions directly. 1
Reasoning (R): If you want to filter based on the results of an aggregate function, you
must use the HAVING clause.

Q. NO SECTION – B (7 x 2= 14 Marks) Marks


22. Consider the following code fragments: 2
Code A
list1=[52,12]
list1+=”Happy”
print(list1)
Code B
list1=[52,12]
list1+=[”Happy”]
print(list1)
i) Deduce the output of Code A and Code B.
ii) Analyse the difference between both the codes.
23. Evaluate the following python expressions. 2
i) 8 * 4 // 3 ** 2 + 5 – 6
ii) 15 == 15 and 4 < 3 or not 10 != 10
24. Consider the list 2
list1 = [1, 2, [3, 4], 5]
answer the following questions based on the built in methods.
A) i) write a python statement to insert [7,8] in second position.
ii) write a python statement to repeat the list three times and display the values.
(OR)
B) i) write a python statement to insert the value 58.
ii) write a python statement to delete the element at 3 position.
25. Deduce the correct output of the following code, if value of b=4. Find the minimum and 2
maximum value of ‘b’ in a program.
import random
a = "HelloWorld"
for i in range(0, b, 2):

Page 5 of 12
print(a[i], end='!')
a) H!l!
b) H!e!
c) H!e!l!
d) H!e!l!o!
26. The code below is supposed to count how many numbers in a list are divisible by 3. 2
However, there are syntax and logical errors in the code. Rewrite it after fixing all errors
and underline the corrections made.
def count_divisible_by_3(numbers):
count = 0
for num in numbers
if num % 3 = 0:
count =+ 1
return count

nums = [3, 4, 9, 12, 15]


print count_divisible_by_3(nums)
27. A) I) You are given a ‘products’ table with the following structure and data: 2

If 3 new products are added to this table with the same structure, what will be the new
degree and cardinality?
(OR)
II) Consider the following ‘employees’ table:
CREATE TABLE employees (
emp_id INT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50)
);
What will happen if you try to insert the following records into the employees table?
INSERT INTO employees (emp_id, first_name, last_name) VALUES (1,
'John', 'Doe');

Page 6 of 12
INSERT INTO employees (emp_id, first_name, last_name) VALUES (1,
'Jane', 'Smith');
B) I) The ‘ORDERS’ table has a column CUSTOMER_ID that refers to the
CUSTOMER_ID in the CUSTOMERS table. Write an SQL command to add a Foreign
Key constraint on CUSTOMER_ID in the ORDERS table.
(OR)
II) The INVOICES table has a primary key constraint named PK_INVOICE. Write an
SQL command to rename this primary key constraint to PK_INVOICE_ID.
28. I) Illustrate the layout for connecting five computers in a bus and star topology of networks. 2
(OR)
II) Expand the following terms:
a) POP
b) SMTP
c) VoIP
d) LAN

Q. NO SECTION – C (3 x 3= 09 Marks) Marks


29. Create a Python program that reads a file named words.txt, where each line contains a 3
single word. Check each word and print only those that are palindromes (i.e., words that
read the same forwards and backwards).
If words.txt contains:
madam
hello
racecar
python
level
The output will be:
madam
racecar
level
(OR)
You are given a text file Words.txt that contains a list of words, one per line. Your task is
to write a Python function that efficiently reads the file and counts how many words in the
file end with the letter "e".

Page 7 of 12
30. Develop a Python function that uses a stack to check if a given string has balanced 3
parentheses. The string may contain the characters (, ), {, }, [, and ]. The function should
return True if the parentheses are balanced and False otherwise.
Example:
• Input: "{[()]}" → Output: True
• Input: "({[}])" → Output: False
(OR)
Design a Python function that pushes elements to a stack and keeps track of the maximum
element in the stack at all times. The function should support the following operations:
• Push an element onto the stack.
• Pop an element from the stack.
• Get Max: Return the maximum element from the stack.
31. Deduce the output of the following code. 3
fruits = {"orange": 12, "kiwi": 5, "grape": 8}
result = ""
for key in fruits:
fruits[key] += 2
result += key + ": " + str(fruits[key]) + "\n"
result = result.strip()
print(result)
(OR)
Predict the output of the following code.
table = [2, 3, 4]
for t in table:
for k in range(1, 4):
print(t * k, end=" ")
print()

Page 8 of 12
Q. NO SECTION – D (4 x 4= 16 Marks) Marks
32. Consider the table ORDERS as given below. 4

Note that, the table may contain more records than shown here.
A) Write MySql queries for the following:
i. To calculate the total Quantity for each Product.
ii. To display the total Price for each Product. Exclude products where the total price
is less than 10000.
iii. To display the orders table sorted by total price in descending order.
iv. To increase the price of all Smartphone orders by 15%.
(OR)
B) Write MySql queries for the following:
i. To delete the order with Order_Id 103 from the table.
ii. To display the names of products with a total Quantity less than 2.
iii. To display the distinct customer names from the Orders table.
iv. To count the number of orders placed by each customer.
33. A company collects customer feedback in a CSV file named feedback.csv with columns: 4
Customer ID, Name, Date, Feedback, and Rating.
Task: The company wants to:
• Calculate the average rating.
• Identify customers who left negative feedback (rating less than 3).
Develop a Python program to calculate the average rating from the feedback.csv file.
Create a function to identify customers who left negative feedback (rating less than 3).
34. Mr. Raghu is an entrepreneur. He needs to access some information form the relation 4
“Customers” and “Orders”. Help Mr. Raghu to extract information by providing the
MySql queries.
Relation: Customers

Page 9 of 12
Relation: Orders

i. Write a query to fetch the names and emails of all customers who have placed at
least one order.
ii. Write a query to fetch the name and city of all customers who are either living in
Chennai or Bangalore.
iii. Write a query to display the total amount in descending order along with the
customer id.
iv. Write a query to display all the details of the customers whose name has atleast one
character ‘h’.
(OR)
Write a query to display all the details of the orders where the total amount should
not exceed 150.
Kindly note that the internal choice is available only for the iv subdivision.
35. Consider the table “student” with the columns Id (Integer), Name (Varchar(30)), and 4
Grade (Varchar(2)) in MySql database “School”. Write a Python program that accepts a
student's name as input and searches for that student in the students table. If found, display
the details; otherwise, print an appropriate message.
Assume the following for Python- Database connectivity:
• Host : localhost
• User: root
• Password: tiger

Page 10 of 12
Q. NO SECTION – E (2 x 5= 10 Marks) Marks
36. A company maintains its employee payroll system using binary files. Each employee’s 5
record includes Employee ID, Name, Department, and Salary. The company wants to
generate salary reports and update salary records using Python. You as a programmer
implement the following task.
i. The company has decided to reorganize its departments. Write a Python function
that updates the department of an employee based on their Employee ID. The
function should prompt the user for the Employee ID and the new department,
update the employee record in the binary file, and display the updated employee
details.
Note:
Assume the binary file “Employee.dat” contains the data in it.
37. Avenue construction has set up its new centre at Chennai, Tamil Nadu for its office and 5
web-based activities. It has 4 blocks of buildings, Block A, Block B, Block C and Block
D. The topographical representation has given below.

You, as a network expert, need to suggest the best network-related solutions for them to
resolve the issues/problems mentioned in points (i) to (v), keeping in mind the distances
between various blocks/buildings and other given parameters.
No of computers available at each block:

Page 11 of 12
Distance between the blocks

i. Suggest and draw the cable layout to efficiently connect various blocks of buildings
within the Chennai centre for connecting the digital devices.
ii. Suggest the placement of the following device with justification
a. Repeater
b. Hub/Switch
iii. Which kind of network (PAN/LAN/WAN) will be formed if the Chennai office is
connected to its head office in Delhi?
iv. Which fast and very effective wireless transmission medium should preferably be
used to connect the head office at Delhi with the centre at Chennai?
v. What would be your recommendation for enabling live visual communication
between the Office at the Chennai campus and the DELHI Head Office from the
following options:
a. Video Conferencing
b. Email
c. Telephony
d. Instant Messaging
(OR)
The company is planned to monitor the in and out activities of the network for the
safety reason. Recommend the type of network device need to be installed to carry
out the above task.

Page 12 of 12

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