[go: up one dir, main page]

0% found this document useful (0 votes)
478 views10 pages

CS Xii PB1 QP 2024-25 (Set-1)

This document is a question paper for the Pre Board-1 Examination for Class XII in Computer Science for the session 2024-25, issued by Kendriya Vidyalaya Sangathan Patna Region. It consists of 37 compulsory questions divided into five sections, covering various topics in Python programming and SQL, with a total of 70 marks. The paper includes multiple-choice questions, programming tasks, and SQL queries, requiring students to demonstrate their knowledge and skills in computer science.

Uploaded by

lpremalatha3
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)
478 views10 pages

CS Xii PB1 QP 2024-25 (Set-1)

This document is a question paper for the Pre Board-1 Examination for Class XII in Computer Science for the session 2024-25, issued by Kendriya Vidyalaya Sangathan Patna Region. It consists of 37 compulsory questions divided into five sections, covering various topics in Python programming and SQL, with a total of 70 marks. The paper includes multiple-choice questions, programming tasks, and SQL queries, requiring students to demonstrate their knowledge and skills in computer science.

Uploaded by

lpremalatha3
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/ 10

SET-1

KENDRIYA VIDYALAYA SANGATHAN PATNA REGION


PRE BOARD-1 EXAMINATION
CLASS: XII SESSION: 2024-25
COMPUTER SCIENCE (083)
(Question Paper)

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 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.

Section-A (21 x 1 = 21 Marks)


1. Write the type of tokens from the following:
(i) if (ii) roll_no (1)
2. If the following code is executed, what will be the output of the following (1)
code?
name="ComputerSciencewithPython"
print(name[3:10])
3. Consider the given expression : (1)
7<4 or 6>3 and not 10==10 or 17>4
Which of the following will be the correct output if the given expression is
evaluated ?
(a) True
(b) False
(c) None
(d) NULL
(A)
4. Select the correct output of the code :
S="Amrit Mahotsav @ 75" (1)
A=S.split(" ",2)
print(A)
(a) ('Amrit', 'Mahotsav', '@', '75')
(b) ['Amrit', 'Mahotsav', '@ 75']
Page: 1/10
(c) ('Amrit', 'Mahotsav', '@ 75')
(d) ['Amrit', 'Mahotsav', '@', '75']

5. What will be the output of the following code snippet?


str= "COMPUTER PROGRAM"
print(str[-3:2:-2]) (1)

6. Nitin has decleared a Tuple as follows:-


T=(11,22,33)
Nitin now want to modify T as (11,22,33,44). Which of following statement,
Nitin will write to complete the task?
(A) T=T+44 (1)
(B) T=T+(44)
(C) T=T+(44,)
(D) Since T is immutable, therefore T cannot be modified.

7. Given the following code:-


my_dict = {'apple': 10, 'banana': 20, 'orange': 30}
print(20 in my_dict, ‘apple’ in my_dict, sep=’#’)

Which statement is correct output of above code? (1)


(A)True#False
(B) False#True
(C)True#True
(D) False#False

8. Consider L is a List. What does the L+=’xy’ command do in Python?


(A) Add ‘xy’ at the end of L.
(B) Add ‘x’,’y’ at the end of L (1)
(C) Add ‘xy’ at the start of L
(D) Will give error

9. In SQL, which command will be used to add a new record in a table?


(A) UPDATE
(B) ADD
(C) INSERT (1)
(D) ALTER TABLE
(A)

Write the missing statement to complete the following code: (1)


10.
file = open("example.txt", "r")
data = _____ #Read the first 10 character of file
print(data)
file.close()

Page: 2/10
Write the name of the built-in function/method of the math module which (1)
11.
when executed upon 5.8 as parameter, would return the nearest smaller
integer 5.
12. Write the output of the following Python code : 1
(1)
for i in range(2,7,2):
print(i * '$')
13. Which SQL command can delete all records from a existing table?
(1)

14. What will be the output of the query? (1)


SELECT * FROM client WHERE client_name LIKE '%Singh%';
(A) Details of all clients whose name start with ' Singh '
(B) Details of all clients whose name end with ' Singh '
(C) Details of all clients whose name contains ' Singh ' anywhere in name
(D) Name of all clients whose names contains ' Singh ' anywhere in name

15. Which is the following is unpacked datatype used in SQL for float number?
(A) float
(B) double
(1)
(C) decimal
(D) None of the above

16. Which command can be used to change the degree of a table? (1)

17. Computers connected by a network across different cities is an example of (1)


___________ .

18. Ethernet card is also known as : (1)


(a) LIC (b) MIC
(c) NIC (d) OIC

A ____________ is a networking device that connects computers in a (1)


19.
network by using packet switching to receive, and forward data to
the destination.

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

Page: 3/10
20. Assertion (A): To use a function from a particular module, we need to (1)
import the module.
Reasoning (R): import statement can be written anywhere in the program, before
using a function from that module.

21. Assertion (A):- SQL SELECT's GROUP BY clause is used to divide the (1)
result in groups.

Reasoning (R):- The GROUP BY clause combines all those records that
have identical values in a particular field or in group by fields.

Section-B ( 7 x 2=14 Marks)


22. How is a mutable object different from an immutable object in Python? (2)
Identify one mutable object and one immutable object from the following:
(1,2), [1,2], {1:1,2:2}, ‘123’

23. Differentiate between actual parameter(s) and a formal parameter(s) with a


suitable example for each. (2)
OR
Explain the use of global key word used in a function with the help of a
suitable example.
(2)
24. If L1=[1,2,3,2,1,2,4,2, . . . ], and L2=[10,20,30, . . .], then
(I)
A) Write a statement to count the occurrences of 1 in L1.
OR
B) Write a statement to sort the elements of list L1 in descending order.

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

25. What possible output(s) is/are expected to be displayed on the screen at the (2)
time of execution of the program from the following code ? Also specify the
maximum and minimum value that can be assigned to the variable R when K
is assigned value as 2.
import random
Signal = [ 'Stop', 'Wait', 'Go' ]
for K in range(2, 0, 1):
R = randrange(K)
print (Signal[R], end = ' # ')
(a) Stop # Wait # Go #
(b) Wait # Stop #
(c) Go # Wait #
(d) Go # Stop #
Page: 4/10
26. Rao has written a code to input a number and check whether it is prime or (2)
not. His code is having syntax and logical errors. Rewrite the correct code
and underline the corrections made.

def prime():
n=int(input("Enter number to check :: ")
for i in range (2, n//2):
if n%i=0:
print("Number is not prime \n")
break
else:
print("Number is prime \n’)
(2)
27. Write SQL command to create the table company:

The structure of company table is as follows: -


Field Data Type Constaint
ID Char(7) Primary Key
CompanyName Varchar(30)
EstablishDate Date
Turnover Int
OR
Write SQL command to add column Sales with datatype Int and constraints
not null in company column

(2)
28. A) List one advantage and one disadvantage of Bus topology.
OR
B) Expand the term POP3. What is the use of POP3?

Section-C ( 3 x 3 = 9 Marks)

29.A) Write a Python function that displays all the words containing @gmail.com from (3)
a text file "Emails.txt".
OR
B)Write a Python function that finds and displays all the words longer than 4
characters from a text file "Words.txt".

Page: 5/10
30. A list contains following record of a customer: [Customer_name, Phone_number, (3)
City]
Write the following user defined functions to perform given operations on the stack
named ‘status’:
(i) Push_element() - To Push an object containing name and Phone
number of customers who live in Goa to the stack
(i) Pop_element() - To Pop the objects from the stack and display them.
Also, display “Stack Empty” when there are no elements in the stack.
For example:
If the lists of customer details are:

[[“Gurdas”, “99999999999”,”Goa”]
[“Julee”, “8888888888”,”Mumbai”]
[“Murugan”,”77777777777”,”Cochin”] [“Ashmit”,
“1010101010”,”Goa”]]

The stack should contain [“Ashmit”,”1010101010”]


[“Gurdas”,”9999999999”]

The output should be: [“Ashmit”,”1010101010”]


[“Gurdas”,”9999999999”]
Stack Empty
OR

Write a function in Python, Push(SItem) where , SItem is a dictionary containing the


details of stationary items– {Sname:price}.
The function should push the names of those items in the stack who have price
greater than 75. Also display the count of elements pushed into the stack.
For example:
If the dictionary contains the following data:
Ditem={"Pen":106,"Pencil":59,"Notebook":80,"Eraser":25}

The stack should contain: Notebook


Pen

The output should be:


The count of elements in the stack is 2
31. Predict the output of the Python code given below: (3)

def Diff(N1,N2):
if N1>N2:
return N1-N2
else:
return N2-N1

NUM= [10,23,14,54,32]
for CNT in range (4,0,-1):
A=NUM[CNT]
B=NUM[CNT-1]
print(Diff(A,B),'#', end=' ')

OR
Page: 6/10
Predict the output of the Python code given below:

tuple1 = (11, 22, 33, 44, 55 ,66)


list1 =list(tuple1)
new_list = []
for i in list1:
if i%2==0:
new_list.append(i)
new_tuple = tuple(new_list)
print(new_tuple)

SECTION D (4 X 4 = 16 Marks)

(4)
32. Given a Table Student
Table : STUDENT

Write SQL queries for (i) to (iv), which are based on the table: STUDENT :-
(i)To display the records from table student in alphabetical order as per the
name of the student.
(ii)To display Class, Dob and City whose marks is between 450 and 551.
(iii)To display Name, Class and total number of students who have
secured more than 450 marks, class wise
(iv)To increase marks of all students by 20 whose class is “XII”

OR
(i) SELECT COUNT(*), City FROM STUDENT GROUP BY CITY
HAVING COUNT(*)>1;
(ii) SELECT MAX(DOB),MIN(DOB) FROM STUDENT;
(iii) SELECT NAME,GENDER FROM STUDENT WHERE CITY=”Delhi”;
(iv) SELECT COUNT(*), Class FROM STUDENT GROUP BY Class
HAVING gender=’F’;

Page: 7/10
33. A csv file "Happiness.csv" contains the data of a survey. Each record of the (4)
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:
[‘Signiland’, 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. Write the outputs of the SQL queries (i) to (iv) based on the relations Teacher and (4)
Posting given below:

Table : Teacher
T_ID Name Age Department Date_of_join Salary Gender
1 Jugal 34 Computer Sc 10/01/2017 12000 M
2 Sharmila 31 History 24/03/2008 20000 F
3 Sandeep 32 Mathematics 12/12/2016 30000 M
4 Sangeeta 35 History 01/07/2015 40000 F
5 Rakesh 42 Mathematics 05/09/2007 25000 M
6 Shyam 50 History 27/06/2008 30000 M
7 Shiv Om 44 Computer Sc 25/02/2017 21000 M
8 Shalakha 33 Mathematics 31/07/2018 20000 F

Table : Posting
P_ID Department Place
1 History Agra
2 Mathematics Raipur
3 Computer Science Delhi

(i)SELECT Department, count(*) FROM Teacher GROUP BY Department;


(ii)SELECT Max(Date_of_Join),Min(Date_of_Join) FROM Teacher;
(iii)SELECT Teacher.name,Teacher.Department, Posting.Place FROM Teacher,
Posting WHERE Teacher.Department = Posting.Department AND
Posting.Place=”Delhi”;
(iv) SELECT name, age, salary FROM Teacher, Posting WHERE
Teacher.Department = Posting.Department AND Posting. Department LIKE
”%e%”;

Page: 8/10
35. Kabir wants to write a program in Python to insert the following record in the (4)
table named Student i n MYSQL database, SCHOOL:
 rno(Roll number )- integer
 name(Name) - string
 DOB (Date of birth) – Date
 Fee – float
Note the following to establish connectivity between Python and MySQL:
 Username - root
 Password - tiger
 Host - localhost
The values of fields rno, name, DOBand fee has to be accepted from the
user. Help Kabir to write the program in Python

SECTION E (2 X 5 = 10 Marks)
36. A binary file “Book.dat” has structure [BookNo, Book_Name, Author, (5)
Price].
(I) Write a user defined function CreateFile() to input data for a record
and
add to Book.dat .
(II) Write a function CountRec(Author) in Python which accepts the
Author name as parameter and count and return number of books
by the given
Author are stored in the binary file “Book.dat”
37. Software Development Company has head office in Mumbai and now want to (5)
set up its new center at Raipur for its office and web-based activities. It has
4 blocks of buildings named Block A, Block B, Block C, Block D.
(i) Number of Computers

: Block A 25

Block B 50

Block C 125

Block D 10

(ii)
(iii) Shortest distances between various Blocks in meters
Block A to Block B 60 m
Block B to Block C 40 m
Block C to Block A 30 m
Block D to Block C 50 m
(iv)

Page: 9/10
(v) (i) Suggest the most suitable place (i.e. block) to house the
server of this company with a suitable reason.
(vi) (ii)Suggest the type of network to connect all the blocks with suitable
reason .
(iii)The company is planning to link all the blocks through a secure and
high speed wired medium. Suggest a cable layout to connect all the
blocks.
(iv)Suggest the most suitable wired medium for efficiently connecting
each computer installed in every block out of the following network
cables:
Coaxial Cable
Ethernet Cable
Single Pair Telephone Cable.
(v) Suggest a protocol that shall be needed to provide Video
Conferencing solution between Mumbai office and Raipur Office.

Page: 10/10

You might also like