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

xii pre board set 1

cs

Uploaded by

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

xii pre board set 1

cs

Uploaded by

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

WILSONIA SCHOLARS’ HOME

Pre-Board Question Paper ( 2024- 25)


CLASS : XII MM : 70
SUBJECT : COMPUTER SCIENCE(083) Time: 3hours

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 MCQs, text of the correct answer should also be written.

.
Section A

1. State True or False:


The "pass" statement in Python skips execution of a block of code.

2.Identify the output of the following code:

string = "HELLOCS"
string = string.lower().replace('o', 'x')
print(string)
(A) Helxlcs (B) HELXLCS (C) helxocs (D) None of the
above

3. What is the output of this expression?

print(3 * "CS" + "4")


(A)CSCSCS4 (B) CSCSCS 4 (C) Error (D) None of the above

4.Given a list nums = [10, 20, 30, 40], what will nums[-3:] return?
(A) [10, 20, 30] (B) [20, 30, 40] (C) [30, 40] (D) None of the above
5. What will be the output of the following code snippet?
tuple1 = (1, 3, 5)
tuple2 = (7,)

1
tuple3 = tuple1 + tuple2
print(len(tuple3))
(A)3 (B) 4 (C) Error (D) None of the above
6.Which of these is not a valid Python keyword?
(A) with (B) async (C) module (D) del

7. Which of the following statements opens a file in append mode in Python?


(A) file = open("example.txt", "w")
(B) file = open("example.txt", "r")
(C) file = open("example.txt", "a")
(D) file = open("example.txt", "x")
8. What is the function of the HAVING clause in SQL?
(A) Filters groups of data based on aggregate functions
(B) Filters individual rows based on conditions
(C) Creates new columns in the result set
(D) Joins two tables in a query
9. If a column is set to NOT NULL, what does this imply?
(A) The column must have unique values (B) The column
cannot have duplicate values
(C) The column must have a value and cannot be left empty (D) The column
must be indexed
10.What does SMTP stand for?
(A) Simple Mail Transfer Protocol (B) Secure Mail Transmission
Protocol
(C) Server Mail Transfer Process (D) Simple Mail Transport
Protocol
11.Expand the term IP in networking.
(A) Internet Process (B) Internet Protocol
(C) Internal Process (D) Internal Protocol
12.Which of these data structures supports Last-In-First-Out (LIFO) operations?
(A) Queue (B) Stack
(C) List (D) Dictionary
13.Fill in the blank: In Python, the method _________ is used to add an element to the
end of a list.
(A) .add() (B) .append()
(C) .insert() (D) .extend()
14.What will be the output of this SQL query?
SELECT UPPER('welcome');
(A) WELCOME (B) Welcome
(C) Error (D) None of the above
15.Which device connects different networks and translates data between them?
(A) Modem(B) Router
(C) Switch(D) Repeater
16. Which protocol is used for sending email over the Internet?
(A) HTTP (B) FTP
(C) SMTP(D) POP3
2
17. Assertion (A): Tuples in Python are mutable.
Reason (R): Tuples allow adding and removing elements dynamically.
(A) Both A and R are true, and R explains A
(B) Both A and R are true, but R does not explain A
(C) A is true, but R is false
(D) A is false, but R is true
18.Assertion (A): SQL commands are case-sensitive.
Reason (R): Reserved keywords in SQL must always be written in uppercase.
(A) Both A and R are true, and R explains A
(B) Both A and R are true, but R does not explain A
(C) A is true, but R is false
(D) A is false, but R is true
19.Which SQL command is used to add a new column to an existing table?
(A) ADD COLUMN (B) ALTER TABLE
(C) CREATE COLUMN (D) INSERT COLUMN
20.What will be the output of the following Python code?
a = [1, 2, 3, 4]
b=a
b.append(5)
print(a)
(A) [1, 2, 3, 4]
(B) [1, 2, 3, 4, 5]
(C) Error
(D) [5]
21.What is the purpose of the break statement in Python?
(A) Skip the rest of the code in the current iteration and continue with the next
iteration
(B) Terminate the loop or switch statement immediately
(C) Stop the execution of the entire program
(D) Pause the program until user input is received

Section B

22.Explain the difference between a primary key and a foreign key in SQL.
23.Write a Python code snippet to count the number of vowels in the string "COMPUTER".
24.How are dictionaries different from lists in Python?
25.Write a Python function to reverse a list in-place.
26. What will be the output of this code?
import random
num = random.randint(2, 5)
print("Number:", num)
27. Write a SQL query to fetch all records from a table.
28. If
L1 = [1, 2, 3, 2, 1, 2, 4, 2, ...],
3
L2 = [10, 20, 30, ...]
(I)
A) Write a statement to count the occurrences of 4 in L1.
OR
B) Write a statement to sort the elements of list L1 in ascending order.

(II)
A) Write a statement to insert all the elements of L2 at the end of L1.
OR
B) Write a statement to reverse the elements of list L2.

Section C

29.. Write a Python function to read a file "data.txt" and display all lines that contain the
word "Python".
30.Write a Python function push_even(numbers) to push even numbers from a given list
into a stack and display the stack.
31.Predict the output of the following Python code:

def modify_list(lst):
for i in range(len(lst)):
lst[i] = lst[i] ** 2
numbers = [1, 2, 3]
modify_list(numbers)
print(numbers)
Section D (4 x 4 = 16 Marks)

32.Consider the following SQL table ORDERS:

O_Id C_Name Product Quantity Price


101 Jitendra Laptop 2 50000
102 Aditi Smartphone 3 15000
103 Sneha Tablet 1 20000

Perform the following operations:


a. Write a query to display the total price (Price * Quantity) for each order.
b. Write a query to display all orders where the product is either "Laptop" or "Tablet".
c. Write a query to display distinct customer names.
d. Write a query to update the price of "Smartphone" to 18000.

33.A CSV file named "survey.csv" contains the following fields:


Name, Age, Country, Happy (Yes/No).

4
Write Python functions to:
a. Count the total number of happy people in the file.
b. Display all records where the age is greater than 30.

34.A table, named EMPLOYEES, in the COMPANYDB database, has the following
structure:

Field Type
empID int(11)
empName varchar(30)
salary float
department varchar(20)

Write the following Python function to perform the specified operation:

AddAndDisplay():

 To input details of an employee and store them in the EMPLOYEES table.


 The function should then retrieve and display all records from the EMPLOYEES
table where the salary is greater than 50000.

Assume the following for Python-Database connectivity:

 Host: localhost
 User: root
 Password: password
 Database: COMPANYDB

35.Samantha has been entrusted with the management of a School Database. She needs to
access some information from the STUDENTS and ENROLLMENTS tables for an
analysis. Help her extract the following information by writing the desired SQL queries as
mentioned below.

Table: STUDENTS

S_ID SName Age Gender Admission_Date Grade


201 John 18 Male 15-08-2022 A
202 Emma 19 Female 10-09-2021 B
203 Mike 17 Male 01-01-2023 C
204 Sophia 18 Female 21-05-2022 B
205 Liam 20 Male 14-11-2020 A

Table: ENROLLMENTS

E_ID S_ID C_ID Enrollment_Date Status


301 201 101 15-08-2022 Active
5
E_ID S_ID C_ID Enrollment_Date Status
302 202 102 10-09-2021 Active
303 203 103 01-01-2023 Inactive
304 204 101 21-05-2022 Active
305 205 104 14-11-2020 Active

SQL Queries:

(I) To display the complete details (from both the tables) of those students whose
grade is 'A'.
(II) To display the details of courses (from the ENROLLMENTS table) where the
enrollment status is 'Active'.

(III) To update the status of all students who are enrolled in a course with C_ID = 101
to 'Inactive'.

(IV)
(A) To display the names (SName) of students who are enrolled in course C_ID = 101.
OR
(B) To display the Cartesian product of the STUDENTS and ENROLLMENTS tables.

Section E (2 x 5 = 10 Marks)

36.Alex is a project manager at a software development company. He needs to manage


the records of various software engineers. For this, he wants the following information of
each engineer to be stored:

 Engineer_ID – integer
 Engineer_Name – string
 Programming_Language – string
 Years_of_Experience – float

You, as a software developer at the company, have been assigned to implement the required
functionality for Alex.

(I) Write a function to input the data of an engineer and append it to a binary file.
(II) Write a function to update the data of engineers whose experience is more than 5 years
and change their programming language to "Python".
(III) Write a function to read the data from the binary file and display the data of all those
engineers who are not using "Python" as their programming language.

6
37. The company is expanding its infrastructure across two cities: London and New York.
Both cities have software development teams that need to be connected efficiently. You, as a
network expert, are tasked with providing network-related solutions for them.

 The London Office has 4 departments: Admin, Development, Design, Testing.


 The New York Office has 3 departments: Admin, Development, Sales.

Here are some parameters you need to keep in mind:

Block to Block distances (in meters):

From To Distance
Admin Development 50 m
Admin Design 30 m
Development Design 60 m
Testing Admin 70 m
New York Office London Office 5000 km

Number of computers in each department is as follows:

Department No. of Computers


Admin 15
Development 50
Design 30
Testing 25
Sales 20
(I) Suggest the most appropriate location of the server inside the London office. Justify your
choice.
(II) Which hardware device will you suggest to connect all the computers within each
department in both offices?
(III) Draw the cable layout to efficiently connect various departments within the London
office. Which cable would you suggest for the most efficient data transfer over the network?
(IV) Is there a requirement of a repeater in the given cable layout for London? Why/Why
not?
(V)
A) What would be your recommendation for enabling live visual communication between
the London and New York offices from the following options:
a) Video Conferencing
b) Email
c) Telephony
d) Instant Messaging
OR
B) What type of network (PAN, LAN, MAN, or WAN) will be set up among the computers
connected in the London office?

7
8

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