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

computer science class 12

This document is a pre-board practice examination paper for Class XII in Computer Science, consisting of 37 questions divided into five sections with varying marks. Each section tests different aspects of computer science, including programming in Python and database management. The paper includes multiple-choice questions, coding tasks, and theoretical questions, all aimed at assessing the students' knowledge and skills in the subject.

Uploaded by

Kavitha Siva
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)
11 views

computer science class 12

This document is a pre-board practice examination paper for Class XII in Computer Science, consisting of 37 questions divided into five sections with varying marks. Each section tests different aspects of computer science, including programming in Python and database management. The paper includes multiple-choice questions, coding tasks, and theoretical questions, all aimed at assessing the students' knowledge and skills in the subject.

Uploaded by

Kavitha Siva
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/ 10

DATE: ___________ PRE-BOARD PRACTICE - 1 EXAMINATION CLASS-XII

TIME: 3 HRS SUBJECT : COMPUTER SCIENCE (083) M.M-70

Rollno………….. Full name ……………………………………………….Section…………….


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.N SECTION – A (21x1=21 Marks) Mar ks


O.
1. Given the following string object:- 1

s="CBSE Exams2024-25"
What will be the result of the following statement?
s.split('E',1)
(i) ['CBS', 'Exams2024-25']
(ii) ['CBS ', ' Exams2024-25']
(iii) ['CBS', ' Exams2024-25']
(iv) [' CBS ', 'Exams2024-25']
2. Which among the following is not a DML command ? 1
(a) SELECT (b) UPDATE (c) DELETE (d) CREATE
3. In which datatype the value stored is padded with spaces to fit the 1
specified length?
(a) DATE (b) VARCHAR (c) FLOAT (d) CHAR
4. What will be the output of the following code:- 1
mystring="Millenium Milestones"
new_string=mystring.replace("le","$")
print(new_string)

(i) 'Mil$nium Mi$stones'


(ii) 'Mi$nium Mi$stones'
(iii) 'Mile$nium Mi$stones'
(iv) 'Mil$nium Mil$stones'
5. Your school has four branches spread across the city. A computer 1
network created by connecting the computers of all the school branches,
is a

1 | Pag
e
(A)LAN (B)WAN (C)MAN (D)PAN
6. To open a file C:\hologram.txt for reading, we should write the code:- 1
f=open("C:\hologram.txt","r") f=open("C:\\
hologram.txt","r") f=open(file="C:\hologram.txt","r")
f=open(file="C:\\hologram.txt","r")

7. Given the following code, find its output:- 1

tuple1 = tuple("apple")
tuple1 += (4,)
print(tuple1)

(i) ('a', 'p', 'p', 'l', 'e', 4)


(ii) (4,'a', 'p', 'p', 'l', 'e')
(iii) Error
(iv) ( )
8. If stu_stream is a dictionary as defined below, then which of the 1
following statements will raise an exception?

stu_stream={"Ravish":"pcm","Rena":"pcb","Sumit":"com",
"Jeevan":"hum"}

(i) stu_stream.get('Veena')
(ii) stu_stream.setdefault("Vani","pcm")
(iii) print(stu_stream["Ravi"])
(iv) print(str(stu_stream))
9. Which of the following keywords are not specific to exception handling? 1
(a) try (b) except (c) else (d) finally
10. What is the output of the program code given below? 1
x=50
def func(x):
x=2
func(x)
print('x is now',x)

(i)x is now 50 (ii)x is now 2 (iii)x is now 100 (iv) Error


11. What is the output of the following code? 1

a, b=8/4/2, 8/(4/2)
print(a, b)

A. Syntax error
B. 1.0,4.0
C. 4.0,4.0
D. 4,4
12. The term is used to refer to a record in a table. 1
(a) Attribute (b) Tuple (c) Field (d) Instance
13. Which of the following functions header is correct? 1
a) def study(a=2, b=5, c) :
b) def study(a=2, b, c=5) :

2 | Page
c) def study(a, b=2, c=5):
d) none of the above
14. Following code will produce True as output:
x=10>5>1 and -3<-2<-1
print(x)
A. True B. False
15. A school maintains the following table to store student records:- 1

student_data(admno,rollno,sname,marks)

The database admin wants to remove the field rollno from this table.
Which command will be used for this purpose?

(a) change (b) alter (c) update (d) modify


16. What will be the output of the query? 1

SELECT * FROM EMPLOYEE WHERE emp_name LIKE 'A%';

(A) Details of all employees whose names start with 'A'


(B) Details of all employees whose names end with 'A'
(C) Names of all employees whose names start with 'A'
(D) Names of all employees whose names end with 'A'
17. If a table which has one Primary key and two alternate keys. How many 1
Candidate keys will this table have?
(a) 1 (b) 2 (c) 3 (d) 4
18. What is the output of the following?
d={0:'a',1:'b',2:'c'}
for i in d:
print(i)
(i) 0 (ii) a (iii) 0 (iv) 2
1 b a a
2 c 1 2
b b
2 2
c c
19. Transmission media are usually categorized as 1
a) Fixed and Unfixed
b) Guided and Unguided
c) Determinate and Indeterminate
d) Metallic and Nonmetallic
Q20 and Q21 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 but R is False
(D) A is False but R is True
20. Assertion: Python is case-sensitive. 1
Reason: Python does not use indentation for blocks and nested blocks.
21. Assertion: Microwaves are used for cellular phone, satellite and wireless 1

3 | Page
LAN communications.
Reason: Microwaves are unidirectional and they support one-to-one
unicast communication.
Q.N Section-B ( 7 x 2=14 Marks) Mar
o. ks
22. (a) Give one difference between lists and tuples. 1+1
(b) Suppose a list is given as :-
emp_records=[
['E1','Shalini',5000,'Sales'],
['E2','Drishyam',5500,'Purchase'],
['E3','Rohini',7000,'Purchase'],
['E4','Kalaam',6000,'Finance'],
['E5','Seema',8000,'HR']
]
Write Python code to print salary of employee whose employee code is 'E4'.
(Use list index only)
23. a) List one advantage and disadvantage of Mesh topology. 1+1
b) Expand the terms : SMTP, POP3
24. Find errors, underline them and rewrite the same after correcting the 2
following code:
d1=dict[]
i=1
n=input("Enter number of entries:")
while i<=n:
a=input("Enter name:")
b=input("Enter age:")
dl(a)=b
i = i+1
l = dl.key[]
for i in l:
print(i,'\t', 'dl [i]')
25. There are two lists 1+1

car=['Toyota','Honda','Ford','Chevrolet','BMW','Mercedes-
Benz']

phone=['Apple','Samsung','Google','OnePlus','Oppo','Vivo'
,'Sony','Nokia','Huawei']

(Answer using built-in functions only)


I A) Write a statement sort all the elements of list ‘car’ in the descending
order.The original list ‘car’ should not be changed.
OR
B) Write a statement to insert a new phone brand 'Xiaomi' at the 5th
position of the list ‘phone’.

II A) Write a statement to remove 'Audi' from list car.


OR
B) Write a statement to add the elements of a list
more_cars=['Audi','Hyundai','Nissan','Volkswagen'] to the

4 | Page
end of list car.
26. Which of the following will return the result as a floating point number 2
2.0?
first = 1.0
second = "1"
third = "1.1"

1. first + float(second)
2. float(second) + float(third)
3. first + int(third)
4. first + int(float(third))
5. int(first) + int(float(third))
6. 2.0 * second
27. ‘Krazy4Fitness’ is a showroom which sells gyming equipment as 1+1
shown below:-
Table: FITNESS
PCODE PNAME PRICE Manufacturer
PI Treadmill 21000 Coscore
P2 Bike 20000 Aone
P3 Cross Trainer 14000 Reliable
P4 Multi Gym 34000 Coscore
P5 Massage Chair 5500 Regrosene
P6 Belly Vibrator Belt 6500 Ambawya

They need the help of a database expert to manage the database for them.
Help them with the following tasks:-
(i) Write the SQL command to set Pcode as primary key.
Or
Write the SQL command such that Pname field does not accept
NULL values.
(ii) Write the SQL command to add another field named
‘manfc_date’ (manufacture date).
Or
Write the SQL command to change the datatype of Pname field
from char to varchar. (assume any size)
28. Consider the following code: 2

import random
AR [20, 30, 40, 50, 60, 70]
Lower = random.randint(1, 3)
Upper= random.randint(2, 4)

for K in range (Lower, Upper+1):


print(AR[K], end="#")

What possible output(s) are expected to be displayed on the screen at the


time of execution of the program from the following code? Also, specify the
Minimum and Maximum values that can be assigned to each of the
variables Lower and Upper.
(a) 10#40#70# (b) 30#40#50#

5 | Page
(c) 50#60#70# (d) 40#50#70#
Q.N Section-C ( 3 x 3=9 Marks) Mar
o. ks
29. Predict the output of the following code:- 3
d = {"spade": 15, "club": 7, "heart": 9}
str1 = ""
for key in d:
str1 = str1 + str(key) + "$" + "\n"
str2 = str1[:-1]
print(str2)
OR
Carefully go through the code given below and predict the output if input
given is 'abcd' :-

inputStr = input(" Give me a string:")


bigInt = 0
littleInt = 0
otherInt = 0
for ele in inputStr:
if ele >= 'a' and ele <= 'm': # Line 1
littleInt = littleInt + 1
elif ele > 'm' and ele <='z':
bigInt=bigInt + 1
else:
otherInt=otherInt + 1
print(bigInt) # Line 2
print(littleInt) # Line 3
print(otherInt) # Line 4
print (inputStr.isdigit()) # Line 5
30. Write a Python function that displays all 4 lettered words from a text file 3
"going_places.txt".

Ex- If the file “going_places.txt” contains the following lines,

Sophie watched her back stooped over the sink


and wondered at the incongruity of the delicate
bow which fastened her apron strings.
The delicate-seeming bow and the crooked back.

Then the output should be :-

back over sink back

OR

Write a Python function that counts the no.of :-


 uppercase alphabets
 lowercase alphabets
 digits
 spaces

6 | Page
from a text file named "Words.txt".
31. You have a stack named MovieStack that contains records of various 3
movies. Each movie record is represented as a list containing movie_title,
director_name, and release_year.
Example of one element :- [‘Avatar’, ‘James Cameron’, 2009]

Write the following user-defined functions in Python to perform the


specified operations on the stack MovieStack:
I push_movie(new_movie): This function takes a new movie record
new_movie as argument and pushes the new movie record onto the stack.
II pop_movie(): This function pops the topmost movie record from the
stack and returns it. If the stack is already empty, the function should
display "Underflow".
III Display_movies(): This function displays all the movie records in
such an order such that the topmost record in the stack is displayed first.
If the stack is empty, then display the message ‘No more movies’.
OR

Write a function in Python, Push(Vehicle) where, Vehicle is a dictionary


containing details of vehicles {Car_Name: Maker}. The function should
push the name of car manufactured by “TATA” (including all the possible
cases like Tata, TaTa, etc.) to the stack.

For example:
If the dictionary contains the following data:
Vehicle={"Santro":"Hyundai", "Nexon": "TATA", "Safari":
"Tata"}

The stack should contain


Safari
Nexon
Q.N Section-D ( 4 x 4=16 Marks) Mar
o. ks
32. Consider the table COMPUTER and SALES as given below :- 4
Table: COMPUTER
PROD_ID PROD_NAME PRICE COMPANY TYPE
P001 MOUSE 200 LOGITECH INPUT
P002 LASER PRINTER 4000 CANON OUTPUT
P003 KEYBOARD 500 LOGITECH INPUT
P004 JOYSTICK 1000 IBALL INPUT
P005 SPEAKER 1200 CREATIVE OUTPUT
P006 DESKJET PRINTER 4300 CANON OUTPUT

Table: SALES
PROD_ID QTY_SOLD QUARTER
P002 4 1
P003 2 2
P001 3 2
P004 2 1

7 | Page
A) Write the SQL queries for the following:-
(i) Display the computer product records in the descending order
of price.
(ii) Display the no.of input and output devices.
(iii) Display the product name, price and quantity of all products
which are made by ‘LOGITECH’.
(iv) Increase the price of all those products by 5% which are made
by ‘CANON’.

OR
B) Write the outputs of the following SQL queries:-

(i) SELECT MIN (PRICE), MAX (PRICE) FROM COMPUTER;


(ii) SELECT COMPANY, COUNT(*) FROM COMPUTER GROUP BY
COMPANY HAVING COUNT (COMPANY) > 1;
(iii) SELECT PROD_NAME, QTY_SOLD FROM COMPUTER C, SALES
S WHERE C. PROD_ID=S.PROD_ID AND TYPE = 'INPUT';
(iv) SELECT PROD_NAME, COMPANY, QUARTER FROM COMPUTER
C, SALES S WHERE C.PROD_ID=S. PROD_ID;
33. A CSV file named ‘Winner_details.csv’ contains the following information:- 4
 Winner name
 Event name
 Points scored
 Position secured
For example, a sample record of the file may be:-
['Medusa George','Hackathon',45,3]

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 list and display
average points scored by all winners who have secured 3rd
position.
(ii) Insert a new record into the file.
34. Rashmi creates a table FURNITURE with a set of records to maintain the 1+1
records of furniture purchased by her. She has entered the 6 records in the +2
table. Help her to find the answers of following questions:-
Table: FURNITURE
FID NAME DATE OF
PURCHASE COST DISCOUNT
B001 Double Bed 03-Jan-2018 10
45000
T010 Dining Table 10-Mar-2020 5
51000
B004 Single Bed 19-Jul-2021 22000 0
C003 Long Back Chair 6 30-Dec-2016 12000 3
T006 Console Table 17-Nov-2019 12
15000
B006 Bunk Bed 01-Jan-2021 28000 14

8 | Page
1. Identify the Primay Key from the given table with justification of
your answer.
2. If three more records are added and 2 more columns are added, find
the degree and cardinality of the table.
3. (i) Write SQL command to insert one more data/record to the table
(ii) Increase the price of furniture by 1000, where discount is given more
than 10.

OR (Option for part 3 only )

3. Write the statements to:


(a) Delete the record of furniture whose price is less than 20000.
(b) Add a column WOOD varchar with 20 characters.
35. Write a function using Python that reads the records from the table Travel 4
and displays only those records who have travellers who are visiting
'Jaipur':

Tcode - String
Traveller_name - String
Source – String
Destination - String

Note the following to establish connectivity between Python and MySQL:


• Username is scott
• Password is tiger
• The table exists in a MySQL database named Tours.
• The details (Tcode,Traveller_name,Source,Destination) are the
attributes of the table.
Q.N Section-E ( 2 x 5=10 Marks) Mar
o. ks
36. Mr. Darvy is a store manager working in a convenience store. She needs 5
to manage the records of inventory. For this, she wants the following
information of each product to be stored:
 ProductID - integer
 ProductName - string
 Quantity - integer
 Price – float
 Brand - string

You, as a programmer assigned to develop POS software for this store,


have been asked to do this job for Mr. Darvy.
(I) Write a function to input the data of a product and append it in a
binary file named ‘INVENTORY.DAT’.
(II) Write a function to update the data of those products whose Brand is
‘Nestle’ and reduce their price by 5%.
(III) Write a function to read the data from the binary file and display
the data of all those products which are produced by ‘Nirvana’ (brand).
37. Aryan Infotech Solutions has set up its new center at Kamla Nagar for its 5

9 | Page
office and web based activities. The company compound has 4 buildings as
shown in the diagram below:

Distance between various buildings.


Jupiter Building to Orbit Building 50 Mtrs
Orbit Building to Oracle Building 85 Mtrs.
Oracle Building to Sunrise Building 25 Mtrs.
Sunrise Building to Jupiter Building 170 Mtrs.
Jupiter Building to Oracle Building 125 Mtrs.
Orbit Building to Sunrise Building 45 Mtrs.

Number of Computers in each of the buildings is follows:


Jupiter Building 30
Orbit Building 150
Oracle Building 15
Sunrise Building 35

i) Suggest a cable layout of connections between the buildings.


ii) Suggest the most suitable place (i.e. building) to house the server of this
organisation with a suitable reason.
iii) Suggest the placement of the following devices with justification:
a. Internet Connecting Device/Modem
b. Switch
iv) The organisation is planning to link its sales counter situated in
various parts of the same city. Which type of network out of LAN, MAN or
WAN will be formed? Justify your answer.
v) Is there a requirement of a repeater in the given cable layout? Why/
Why not?

----------------xxxxxxxxxxxxxxxx---------------

10 | P a g
e

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