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

CS QP

YUP

Uploaded by

naitikop33
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)
122 views12 pages

CS QP

YUP

Uploaded by

naitikop33
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

PRE-BOARD 1 - EXAMINATION - 2024-25

CLASS XII
COMPUTER SCIENCE (Code: 083)

Time allowed: 3 Hours Maximum Marks: 70


General Instructions:
● This question paper contains 37 questions.
● All questions are compulsory. However, internal choices have been provided in
somequestions. 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:


“A variable name can start with an underscore character.” (1)

2. Identify the output of the following code snippet:


text = "HELLOWORLD"
text=text.replace('HE','@')
print(text)
(A) @LLOWORLD (1)
(B) @LLOWORLD@
(C) HE@
(D) HE@LLOWORLD

3. Which of the following expressions evaluates to True?


(A) not(False) and False
(B) not(True) or False (1)
(C) not(False and True)
(D) not(True) and not(False)

4. What is the output of the expression?


country='National'
print(country.split("a"))
(A) ['N', 'tion', 'l'] (1)
(B) ('N', 'tion', 'l')
(C) ['Na', 'tiona', 'l']
(D) Error

Page: 1/11
5. What will be the output of the following code snippet?
message= "Good Morning" (1)
print(message[2::2])

6. What will be the output of the following code?


tuple1 = (1, 2, 3)
tuple2 = tuple1
tuple1 += (4,)
print(tuple1 == tuple2) (1)
(A) True
(B) False
(C) tuple1
(D) Error

7. If dict is a dictionary as defined below, then which of the following


statements will raise an exception?
dict = {'name': ‘kiran’, 'age': 20, 'sal': 30000}
(A) print(dict['name', 'age']) (1)
(B) dict.get('name')
(C) dict['age']=21
(D) print(str(dict))

8. Which of the following will delete key-value pair for key = “Name” from a dictionary
D1?
(A) delete D1("Name")
(1)
(B) del D1["Name"]
(C) del.D1["Name"]
(D) D1.del["Name"]
9. If a table which has two Primary key and five candidate keys. How
many alternate keys will this table have?
(A) 1
(B) 2 (1)
(C) 3
(D) 4

10. Write the missing statement to complete the following code:


file = open("story.txt", "r")
data = file.read(100)
#Move the file pointer to the (1)
beginning of the file
next_data = file.read(50)
file.close()

11. State whether the following statement is True or False:


The finally block in Python is executed only if no exception occurs
in the try block. (1)

Page: 2/11
12. What will be the output of the following code?
g = 20
def add():
global g
g = g + 5
print(g,end='#')
add() (1)
g=45
print(g,end='%')

(A) 25#45%
(B) 5#20%
(C) 25#25%
(D) 50%20#
13. Which SQL command can remove a column from an existing relation? (1)

14. What will be the output of the query?


SELECT * FROM student WHERE name LIKE'%Singh%';
(A) Details of all students whose names start with 'Singh'
(B) Details of all students whose names end with ' Singh ' (1)
(C) Details of all students whose name contains ' Singh '
(D) Details of all students whose names is ' Singh'

15. In which datatype the value stored is padded with spaces to fit the specified
length.
(A) DATE
(B) VARCHAR (1)
(C) FLOAT
(D) CHAR

16. Which of the following is not an aggregate function?


(A) total()
(B) count() (1)
(C) avg()
(D) max()

17. Which protocol is used in videoconferencing?


(A) HTTP
(B) FTP
(C) VoIP
(D) HTTPS (1)

18. Which network device is used to convert analog signal to digital signal
and vice versa?
(A) Modem
(B) Gateway (1)
(C) Switch
(D) Repeater
Page: 3/11
19. In case of _____________ switching, before a communication starts, a
dedicated path is identified between the sender and the receiver (1)

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 (A): Positional arguments in Python functions must be passed in


the exact order in which they are defined in the function
signature. (1)
Reasoning (R): This is because Python functions automatically assign
default values to positional arguments.

21. Assertion (A): DROP command in SQL is DDL command.

(1)
Reasoning (R): DROP and DELETE are used to delete rows and
columns, therefore, these can be used interchangeably.
Q No Section-B ( 7 x 2=14 Marks) Marks

22. How is a list object different from tuple object in Python?


(2)
Identify list object and tuple object from the following:
(1,2), [1,2], {1:1,2:2}, ‘123’

23. Give two examples of each of the following:


(2)

(I) Identity operators (II) Membership operators

24. If L1=[10,20,30] and L2=[100,200,300], then


(Answer using builtin functions only)
(I)
A) Write a statement to concatenate list L1 and L2. (2)
OR
B) Write a statement to reverse the order of the list L1.

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

Page: 4/11
25. Identify the correct output(s) of the following code. Also write the minimum
and the maximum possible values of the variable b.
import random
a="Chandigarh"
b=random.randint(1,6) (2)
for i in range(0,b):
print(a[i],end='#')
(A) C# (B) C#h#a#n#

(C) C#h#a# (D) C#h#a#n#d#i#g#a#

The code given below accepts a number as an argument and returns the
26. reverse number. Observe the following code carefully and rewrite it after
removing all syntax and logical errors. Underline all the corrections made..

(2)

27. (I)
A) What constraint should be applied on a table column to
ensure that the values in a column satisfy a specific condition.
OR
B) What constraint should be applied on a table column that is a
combination of NOT NULL and UNIQUE. (2)

(II)
A) Write an SQL command to remove the Primary Key constraint
from a table, named STUDENT. S_ID is the primary key of the
table.
OR
Write an SQL command to make the column S_ID the PrimaryKey of an
already existing table, named STUDENT.

Page: 5/11
28. A) List one advantage and one disadvantage of ring topology.
OR (2)
B) Expand the term HTTPS. What is the use of HTTPS?

Q No. Section-C ( 3 x 3 = 9 Marks) Marks

29. A) Write a Python function that displays all the words containing @gmail
from a text file "Story.txt".
(3)
OR
B) Write a Python function that finds and displays all the words having 5
characters from a text file "Story.txt".

30. A) You have a stack named Books that contains records of books. Each
book record is represented as a list containing book_title,
author_name, and publication_year.
Write the following user-defined functions in Python to perform the
specified operations on the stack Books:
(I) push_book(Books, new_book): This function takes the stack
BooksStack and a new book record new_book as arguments and
pushes the new book record onto the stack.
(II) pop_book(Books): This function pops the topmost book record from
(3)
the stack and returns it. If the stack is already empty, the function
should display "Underflow".
(III) peep(Books): This function displays the topmost element of the
stack without deleting it. If the stack is empty, the function should
display 'None'.

OR
(B) A list, NList contains following record as list elements:
[City, Country, distance from Delhi]
Each of these records are nested together to form a nested list.
Write the following user defined functions in Python to perform the
specified operations on the stack named travel.

(i) Push_element(NList): It takes the nested list as an argument and


pushes a list object containing name of the city and country, which
are not in India and distance is less than 3500 km from Delhi.

(ii) Pop_element(): It pops the objects from the stack and displays

Page: 6/11
them. Also, the function should display “Stack Empty” when there
are no elements in the stack.

For example: If the nested list contains the following data:

NList=[["New York", "U.S.A.", 11734],


["Naypyidaw", "Myanmar", 3219],
["Dubai", "UAE", 2194],
["London", "England", 6693],
["Gangtok", "India", 1580],
["Columbo", "Sri Lanka", 3405]]

The stack should contain:


['Naypyidaw', 'Myanmar'],
['Dubai', 'UAE'],
['Columbo', 'Sri Lanka']

The output should be:


['Columbo', 'Sri Lanka']
['Dubai', 'UAE']
['Naypyidaw', 'Myanmar']
Stack Empty

(3)
31 Predict the output of the following code:

OR
Predict the output of the following code:
line=[14,18,12,16]
for I in line:
for j in range(1,I%5):
print(j,"@",end="")
print()

Page: 7/11
Q No. Section-D ( 4 x 4 = 16 Marks) Marks

32.

(4)

Write SQL queries for the following:


(i) Display total UPrice from the table PRODUCT for each BID.
(ii) Display the structure of the table PRODUCT.
(iii) Display the average rating of all products.
(iv) Display the name, price, and rating of products in descending order of
rating.

OR

Write the outputs of the SQL queries (i) to (iv) based on the relation
BOOK given below:

TABLE : BOOK
BNO BNAME TYPE
F101 THE PRIEST FICTION
L102 GERMAN EASY LITERATURE
C101 TARZAN IN THE LOST WORLD COMIC
F102 UNTOLD STORY FICTION
C102 WAR HEROES COMIC

a. SELECT COUNT(DISTINCT TYPE) FROM BOOK;


b. SELECT TYPE,COUNT(*) FROM BOOK GROUP BY
TYPE ;
c. SELECT BNAME FROM BOOK WHERE TYPE NOT
IN ("FICTION", "COMIC");
d. SELECT * FROM BOOK WHERE BNAME LIKE
“%LOST%”.

Page: 8/11
33. A csv file "country.csv" contains the data of a survey. Each record of thefile
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)
● working (Number of persons who are working)
(4)
For example, a sample record of the file may be:
[‘Ireland’, 5673000, 5000, 3426]
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 a list and display all
those records for which the population is more than 5000000.
(II) Count the number of records in the file.

34. Shekhar has been entrusted with the management of Law University
Database. He needs to access some information from FACULTY and
COURSES tables for a survey analysis. Help him extract the following
information by writing the desired SQL queries as mentioned below.

Table: FACULTY
F_ID FName LName Hire_Date Salary
102 Amit Mishra 12-10-1998 12000
(4)
103 Nitin Vyas 24-12-1994 8000
104 Rakshit Soni 18-5-2001 14000
105 Rashmi Malhotra 11-9-2004 11000
106 Sulekha Srivastava 5-6-2006 10000

Table: COURSES
C_ID F_ID CName Fees
C21 102 Grid Computing 40000
C22 106 System Design 16000
C23 104 Computer 8000
Security
C24 106 Human Biology 15000
C25 102 Computer 20000
Network
C26 105 Visual Basic 6000

Page: 9/11
35. A table, named EDUCATION, in SUPPLY database, has the following
structure
Field Type
itemNo int(11)
itemName varchar(15)
price float
qty int(11)

Write the following Python function to perform the specified operation: (4)
AddAndDisplay(): To input details of an item and store it in the table
EDUCATION. The function should then retrieve and display all records
from the EDUCATION table where the Price is greater than 150.

Assume the following for Python-Database connectivity:


Host: localhost, User: root, Password: Pencil

Q.No. SECTION E (2 X 5 = 10 Marks) Marks

36. Raman is an HR working in a recruitment agency. He needs to managethe


records of various candidates. For this, he wants the following information
of each candidate to be stored:
- Candidate_ID – integer
- Candidate_Name – string
- Designation – string
- Experience – float (5)

You, as a programmer of the company, have been assigned to do this job


for Surya.

(I) Write a function to input the data of a candidate and append it in a


binary file.

Page: 10/11
(II) Write a function to update the data of candidates whose experience
is more than 10 years and change their designation to "Senior
Manager".
(III) Write a function to read the data from the binary file and display the
data of all those candidates who are not "Senior Manager".

37. STAR Enterprises is an event planning organization. It is planningto set up


its India campus in Mumbai with its head office in Delhi. The Mumbai
campus will have four blocks/buildings - ADMIN, FOOD, MEDIA,
DECORATORS. 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.

Block to Block distances (in Mtrs.)


From To Distance
ADMIN FOOD 42 m (5)
ADMIN MEDIA 96 m
ADMIN DECORATORS 48 m
FOOD MEDIA 58 m
FOOD DECORATORS 46 m
MEDIA DECORATORS 42 m
Distance of Delhi Head Office from Mumbai Campus = 1500 km
Number of computers in each of the blocks/Center is as follows:

ADMIN 30
FOOD 18
MEDIA 25
DECORATORS 20
DELHI HEAD
OFFICE 18

Page: 11/11
(I) Suggest the most appropriate location of the server inside the
MUMBAI campus. Justify your choice.
(II) Where hub/switch should be placed? Justify your answer.
(III) Draw the cable layout to efficiently connect various buildings
within the MUMBAI campus. 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?
Why/ Why not?
(V) A) What would be your recommendation for enabling live visual
communication between the Admin Office at the Mumbai campus
and the DELHI Head Office 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 MUMBAI campus?

Page: 12/11

You might also like