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

COMPUTER SCIENCE QP - SET 2

This document is a pre-board examination paper for Class XII Computer Science, consisting of five sections with a total of 70 marks. It includes various types of questions such as multiple choice, programming tasks, and SQL queries, all of which are to be answered using Python. The exam is scheduled for December 20, 2024, and has specific instructions regarding the format and requirements for each section.

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)
12 views

COMPUTER SCIENCE QP - SET 2

This document is a pre-board examination paper for Class XII Computer Science, consisting of five sections with a total of 70 marks. It includes various types of questions such as multiple choice, programming tasks, and SQL queries, all of which are to be answered using Python. The exam is scheduled for December 20, 2024, and has specific instructions regarding the format and requirements for each section.

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/ 5

HOSUR SAHODAYA SCHOOLS COMPLEX

PRE-BOARD EXAMINATION (2024-25)


SUBJECT: COMPUTER SCIENCE (083)
SET 2
Class: XII Marks: 70
Date: 20.12.2024 Time: 3 hrs

General Instructions:
 This question paper contains five sections: A, B, C, D, and E.

 All questions are compulsory.

 Section A consists of 18 questions carrying 1 mark each. text of correct answer should also be written.

 Section B consists of 7 questions carrying 2 marks each.

 Section C consists of 5 questions carrying 3 marks each.

 Section D consists of 3 questions carrying 4 marks each.

 Section E consists of 2 questions carrying 5 marks each.

 All programming questions are to be answered using Python.


 Internal choice has been given in selected questions. attempt only one of the choices.

Section A (18 × 1 = 18 Marks)


1.What is the output of print(2**3 // 3 + 2)?
a. 2 b. 3 c. 4 d. 6

2. Define the term primary key in the context of a database.


a. A unique identifier for each record in a table b. A column that allows duplicate values
c. A foreign key in another table d. A column used to calculate aggregates

3. Name any two types of data structures available in Python.


a. Dictionary and Tuple b. SQL and JSON
c. Table and Record d. XML and HTML

4.Write one advantage of a relational database management system (RDBMS).


a. Lack of data security b. Data redundancy is minimized
c. Supports unstructured data only d. No schema enforcement

5. State the use of the GROUP BY clause in SQL.


a. To group tables into a database b. To group rows based on a common column value
c. To define relationships between tables d. To sort rows in ascending order

Page 1 of 5
6.What is the difference between list and tuple in Python?
a. Lists are immutable, and tuples are mutable b. Tuples are immutable, and lists are mutable
c. Both are immutable d. Both are mutable

7.Write a Python statement to open a file named data.txt in read mode.


a. open('data.txt', 'write') b. open('data.txt', 'rb')
c. open('data.txt', 'r') d. open('data.txt', 'a')

8.Define bandwidth in the context of computer networks.


a. The physical size of a network cable b. The range of frequencies used by a network
c. The amount of data transmitted per unit time d. The latency of a network connection

9.Identify the odd one out: FTP, SMTP, HTTP, USB.


a. FTP b. SMTP c. HTTP d. USB

10.Write the output of the following: python code


>>>a = [1, 2, 3]
>>>b = a
>>>b.append(4)
>>>print(a)
a. [1, 2, 3] b. [1, 2, 3, 4]
c. [4, 2, 3] d. [1, 2, 3, 4, 4]

11.Expand the term IP in computer networks.


a. Internet Protocol b. International Packet
c. Internal Protocol d. Integrated Processing

12.Which protocol is used to send and receive e-mail over a network?


a. HTTPS b. PPP c. SMTP d. FTP

13.State True or False:


While handling exception name of the exception has to be compulsory added to with except block.

14.Which SQL function will show cardinality of table.


a. SUM () b. COUNT(*) c. AVG() d. LENGTH()

15.____ are set of rules that need to be followed to establish data communication over network.
a. Application b. InterNetwork c. Presentation d.Protocols

16. Identify the invalid code?


a. print(“””Hello World “””) b. def func():
c. for i in rang(): d. if x>5:

Page 2 of 5
Question 17 and 18 are assertion based questions select the correct choice as
a. Both Assertion (A) and Reasoning (R) are true, and (R) is the correct explanation of (A).
b. Both Assertion (A) and Reasoning (R) are true, but (R) is not the correct explanation of (A).
c. Assertion (A) is true, but Reasoning (R) is false.
d. Assertion (A) is false, but Reasoning (R) is true.

17. Assertion (A): In SQL, the NOW() function is used to retrieve the current date and time.
Reasoning (R): The NOW() function returns the system's current date and time in the format YYYY-MM-DD
HH:MM:SS.

18. Assertion (A): CSV files are used to store tabular data in plain text format.
Reasoning (R): Each line in a CSV file represents a record, with values separated by a comma, and it is a
commonly used format for data exchange.

Section B (7 × 2 = 14 Marks)
19. Differentiate between guided and unguided transmission media with examples.
20. Write a Python function is_prime(n) to check whether a given number is prime or not.
21. Explain the differences between HAVING and WHERE clauses in SQL with examples.
22. Write a Python program to reverse a string using stack data structure.
23. What is DNS? How is it important in computer networks?
24. Explain the significance of HTTP, HTTPS in web communication.
OR
List one advantage and disadvantage of Mesh topology.
25. Write a command to create a table Students with the following structure:
- RollNo (Integer, Primary Key)
- Name (String)
- Marks (Float)
Section C (5 × 3 = 15 Marks)
26. Write a Python program to count the number of vowels in a given string.

27. Consider the following table Sales:


| ID | Product | Price | Quantity |
|------|---------|-------|----------|
| 101 | Pen | 10 | 100 |
| 102 | Pencil | 5 | 200 |
| 103 | Eraser | 3 | 150 |
Write SQL queries for the following:
a) Display all products with a price greater than 5.
b) Update the price of Pen to 12.
c) Delete the record where Quantity is less than 150.

28. Write a Python program to write all even number between 1to100 in num.txt.
OR
Write python program to push even number from a given list VALUES to the stack EvenNumbers.

Page 3 of 5
29. Explain Circuit switching and packet switching.

30. Differentiate between attribute, cardinality and domain in relational model.

Section D (3 × 4 = 12 Marks)
31. Predict the following code output.
d = {"apple": 15, "banana": 7, "cherry": 9}
str1 = ""
for key in d:
str1 = str1 + str(d[key]) + "@" + “\n”
str2 = str1[:-1]
print(str2)
OR
Predict the output of the following code:
line=[4,9,12,6,20]
for I in line:
for j in range(1,I%5):
print(j,’#’,end=” ”)
print()

32. Write SQL queries for the following:


BookID | Title | Author | Price
-------|----------------------------------------------|---------------------------|-----------
1 | The Adventures of Tom Sawyer | Mark Twain | 299.99
2 | Pride and Prejudice | Jane Austen | 199.50
3 | Programming Basics with Python | John Doe | 499.00
4 | The Great Gatsby | F. Scott Fitzgerald | 349.75
5 | To Kill a Mockingbird | Harper Lee | 299.90
a) Delete all the details of BookID 2.
b) Change Title column name to BookName.
c) Retrieve all books authored by 'John'.
d) Increase the price of all books by 10%.
e) Which column can be selected as primary key, give reason.

33. A university campus has three blocks: Administrative Block, Academic Block, and Hostel Block.
The distances between these blocks are as follows:
• Administrative Block to Academic Block: 120 meters
• Administrative Block to Hostel Block: 250 meters
• Academic Block to Hostel Block: 300 meters
Each block has the following number of computers:
• Administrative Block: 25 computers
• Academic Block: 50 computers
• Hostel Block: 40 computers
The university wants to set up a network to connect all three blocks and ensure efficient communication.

Page 4 of 5
Answer the following:
1. Suggest the most suitable cable type to connect the blocks, considering the distances.
2. Identify a network device required to connect all computers within each block.
3. Which type of network (LAN, MAN, or WAN) will be formed? Justify your answer.
4. Suggest a suitable topology for interconnecting the blocks and justify your choice.

Section E (2 × 5 = 10 Marks)
34. Write a Python program to perform the following tasks:
a) Read a file named data.txt.
b) Count the number of words in the file.
c) Write the word count into another file named count.txt.
OR
Write a Python program to perform the following operations using the MySQL connector:
a)Connect to a MySQL database named SchoolDB password=”mysql”.
b)Create a table named Student with the following structure:
• RollNo (Integer, Primary Key)
• Name (Varchar(50))
• Marks (Float)
c)Insert the following three records into the table:
• (101, 'Ankit', 85.5)
• (102, 'Riya', 92.0)
• (103, 'Soham', 76.0)
d)Retrieve and display all records from the Student table.
35. A company wants to analyze the sales performance of its employees. Write a Python program that uses a
binary file to store employee names and their sales amounts. Perform the following:
a) Add new employee sales data.
b) Update existing sales data.
c) Display the sales data.
OR

A csv file "CountriesHIndex.csv" contains the data of a survey. Each record of the file contains the
following data: Name of a country, Population of the country, Sample Size (Number of persons who
participated in the survey in that country),Happy (Number of persons who accepted that they were
Happy) For example, a sample record of the file may be: [‘Finland’, 5673000, 5000, 3426] Write
the following Python functions to perform the specified operations on this file:
(a) Read all the data from the file in the form of a list and display all those records for which the
population is more than 5000000.
(b) Count the number of records in the file.

***

Page 5 of 5

You might also like