Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
491 views8 pages

QP-1 CS

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 8

अनक्र

ु म ांक/ROLL NO सेट/SET : 01

केंद्रीय विद्य लय सांगठन ,जयपरु सांभ ग


KENDRIYA VIDYALAYA SANGATHAN, JAIPUR REGION
PRACTICE PAPER-I
कक्ष / CLASS :XII
विषय /SUB : कांप्यूटर विज्ञ नां (83) /COMPUTER SCIENCE (83)
अधिकतम अिधि / Time Allowed :03 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 the case of MCQ, the text of the correct answer should also be written.
Q Question Marks
No
SECTION A
1 State True or False: 1
“In a Python loops can also have else clause”
2 What is the output of the following code?
Text = 'Happy hour12-3'
L= " "
for i in range(len(Text)):
if Text[i].isupper():
L=L+Text[i].lower()

elif Text[i].islower():
L=L+Text[i].upper()

elif Text[i].isdigit():
L=L+(Text[i]*2)
else:
L=L+'#'
print(L)
(A)hAPPY#HOUR1122#33
(B)Happy#hOUR12#3
(C)hAPPY#HOUR112233
(D)Happy Hour11 22 33 #
3 Consider the given expression: 1
17%5==2 and 4%2>0 or 15//2==7.5
Which of the following will be correct output if the given expression is evaluated?
(a)True (b) False (c)None (d)Null
4 Select the correct output of the code: 1
s = "Question paper 2022-23"
s= s.split('2')
print(s)
a. ['Question paper ', '0', '', '-', '3']
b. ('Question paper ', '0', '', '-', '3')
c. ['Question paper ', '0', '2', '', '-', '3']
d. ('Question paper ', '0', '2', '', '-', '3')
5 What will be the output of following code if 1
a = “abcde”
a [1:1 ] == a [1:2]
type (a[1:1]) == type (a[1:2])
6 Select the correct output of the code: 1
a = "foobar"
a = a.partition("o")
print(a)
(a) ["fo","","bar"]
(b) ["f","oo","bar"]
(c) ["f","o","bar"]
(d) ("f","o","obar")
7 State whether the following statement is True or False: 1
An exception may be raised even if the program is syntactically correct.
8 1
Identify the output of the following python code: 1
D={1:"one",2:"two", 3:"three"}
L=[]
for k,v in D.items():
if 'o' in v:
L.append(k)
print(L)

(a) [1,2] (b) [1,3] (c)[2,3] (d)[3,1]

9 Which of the following is not a tuple in python? 1

(a) (10,20) (b) (10,) (c) (10) (d) All are tuples.

10 1
Which of the following is the correct usage for tell() of a file
object,………………….?
1
a) It places the file pointer at the desired offset in a file.
b) It returns the byte position of the file pointer as an integer.
c) It returns the entire content of the file.
d) It tells the details about the file.
11 What will be the output of the following Python code snippet? 1
d1 = {"john":40, "peter":45}
d2 = {"john":466, "peter":45}
d1 > d2
a. True b. False
c. Error d. None
12 Consider the code given below: 1
b=5
def myfun(a):
# missing statement.
b=b*a
myfun(14)
print(b)
Which of the following statements should be given in the blank for #
Missing statement, if the output produced is 70?
a. global a b. global b=70
c. global b d. global a=70
13 Which of the following commands is not a DDL command? 1
1
(a) DROP (b) DELETE (c) CREATE (d) ALTER

14 Which of the following keywords will you use in the following query to 1
display the unique values of the column dept_name?
SELECT --------------------- dept_name FROM Company;
(a)All (b) key (c) Distinct (d) Name
15 What is the maximum width of numeric value in data type int of MySQL. 1
a. 10 digits b. 11 digits
c. 9 digits d. 12 digits
16 SUM(), AVG() and COUNT() are examples of functions. 1
1
a) single row functions
b) aggregate functions
c) math function
d) date function
17 is a standard mail protocol used to receive emails from a remote server 1
to a local email client.

(a) SMTP (b) POP (c) HTTP (d) FTP

18 Pawan wants to transfer files and photos from laptop to his mobile. He uses 1
Bluetooth Technology to connect two devices. Which type of network will be
formed in this case.
a. PAN b. LAN
c. MAN d. WAN
19 Fill in the blank: 1
In case of switching, message is send in stored and forward manner from
sender to receiver.

Q20 and 21 are ASSERTION AND REASONING 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): The default argument values in Python functions can be mutable 1
types like lists and dictionaries.
Reason (R): Mutable default arguments retain their state across function calls,
which can lead to unexpected behaviour.

21 Assertion (A): The HAVING clause in MySQL is used to filter records after the 1
GROUP BY operation.
Reason (R): The WHERE clause filters records before grouping, while HAVING
allows for conditions on aggregated data.

SECTION
B
22 Write difference between mutable and immutable property, Explain it with 2
its example.
23 Predict the output of the Python 2
code given below:
T = (9,18,27,36,45,54)
L=list(T)
L1 = [ ]
for i in L:
if i%6==0:
L1.append(i)
T1 = tuple(L1)
print(T1)
24 Write the Python statement for each of the following tasks using 2
BUILT-IN functions/methods only:
(i) To insert an element 400 at the fourth position, in the list L1.
(ii) To check whether a string named, message ends with a full stop/
period or not.
OR

A list named employeesalary stores salary of employees. Write the Python


command to import the required module and (using built-in function) to display
the most common salary value from the given list.
25 What possible outputs are expected to be displayed on the screen at the time of 2
execution of the program from the following code?
import random
temp=[10,20,30,40,50,60]
c=random.randint(0,4)
for i in range(0, c):
print(temp[i],”#”)
a) 10#20# b) 10#20#30#40#50#
c) 10#20#30# d) 50#60#
26 Explain the following with help of example. 2
1. Primary Key
2. Candidate key
27 Ms. Rajni has just created a table named “Customer” containing columns 2
Cname, Department and Salary.
After creating the table, she realized that she has forgotten to add a
primary key column in the table. Help her in writing an SQL command to
add a primary key column Custid of integer type to the table Customer.
Thereafter, write the command to insert the following record in the
table: Custid- 555
Cname- Nandini
Department: Management
Salary- 45600
OR
Manish is working in a database named CCA, in which he has created a table
named “DANCE” containing columns danceID, Dancename,
no_of_participants, and category.
After creating the table, he realized that the attribute, category has to be
deleted from the table and a new attribute TypeCCA of data type string has
to be added. This attribute TypeCCA cannot be left blank. Help Manish to
write commands to complete both the tasks.
28 (i) Expand the following terms: 1+1=2
XML, SMTP
(ii) Give the difference between XML and HTML.

OR
(i) Define the term baud with respect to networks.
(ii) How is http different from https?
SECTION C
29 Write a user – defined function countH() in Python that displays the number 3
of lines starting with ‘H’ in the file ‘Para.txt”. Example , if the file contains:
Whose woods these are I think I know.
His house is in the village though;
He will not see me stopping here
To watch his woods fill up with snow.
Output: The line count should be 2.
OR
Write a function countmy() in Python to read the text file “DATA.TXT” and
count the number of times “my” occurs in the file. For example , if the file
“DATA.TXT” contains –
“This is my website. I have displayed my preference in the CHOICE
section.” The countmy( ) function should display the output as:
“my occurs 2 times”
30 3
Aalam has created a list, L containing marks of 10 students. Write a
program, with separate user defined function to perform the following
operation:
3

PUSH()- Traverse the content of the List, L and push all the odd marks into
the stack,S.

POP()- Pop and display the content of the stack.

Example: If the content of the list is as follows:


L=[87, 98, 65, 21, 54, 78, 59, 64, 32, 49]
Then the output of the code should be: 49 59 21 65 87

31 3
Consider the table ACTIVITY given below:
ACODE ACTIVITYNA PARTICIP PRIZEMONEY SCHEDULED
ME ANTS TE
NUM
1001 Relay Name 16 10000 2004-01-23
1002 High Jump 10 12000 2003-12-12
1003 Shot Put 12 8000 2004-02-14
1005 Long Jump 12 9000 2004-01-01
1008 Discuss Throw 10 15000 2004-03-19
Based on the given table, write SQL queries for the following:
(i) Display the details of all activities in which prize money is more than
9000 (including 9000)
(ii) Increase the prize money by 5% of those activities whose schedule
date is after 1st of March 2023.
(iii) Delete the record of activity where participants are less than 12.
SECTION D

32 You have learnt how to use math module in Class XI. Write a code where you 4
use the wrong number of arguments for a method (say sqrt() or pow()). Use
the exception handling process to catch the ValueError exception.
33 Write a python program to create a csv file dvd.csv and write 10 records in it 4
Dvdid, dvd name, qty, price. Display those dvd details whose dvd price is
more than 25.
34 Consider the following tables and answer the questions a and b: 1*4=4
Table: Garment
GCode GNam e Rate Qty CCode

G101 Saree 1250 100 C03


G102 Lehang a 2000 100 C02
G103 Plazzo 750 105 C02
G104 Suit 2000 250 C01
G105 Patiala 1850 105 C01
Table: Cloth
CCode CName
C01 Polyester
C02 Cotton
C03 Silk
C04 Cotton- Polyester

Write SQL queries for the following:


i. Display unique quantities of garments.
ii. Display sum of quantities for each CCODE whose numbers of
records are more than 1.
iii. Display GNAME, CNAME, RATE whose quantity is more than
100.
iv. Display average rate of garment whose rate ranges from 1000
to 2000 (both values included)
35 Kishan wants to write a program in Python to insert the following record in the 4
table named Flight in MYSQL database KV:
● Flno (Flight number)-varchar
● Source (source)- varchar
● Destination (Destination)-varchar
● Fare (fare)-integer
Note the following to establish connectivity between Python and MySQL:
● User name-root
● Password – KVS@123
● Host-localhost
The values of fields Flno,Source,Destination and Fare has to be accepted
from the user. Help Kishan to write the program in Python.
OR
Suman has created a table named Game in MYSQL database Sports:
● GID (Game ID)-integer
● Gname( Game name)-varchar
● No_of_Participants (number of participants)- integer
Note the following to establish connectivity between Python and
MySQL:
● Username: root
● Password: KVS@123
● Host: localhost
Suman, now wants to display the records of students whose number of
participants are more than 10, Help Suman to write the program in Python.
SECTION-E
36 Write a program in Python that defines and calls the following functions: 5
Insert() – To accept details of clock from the user and stores it in a csv file
‘watch.csv’. Each record of clock contains following fields – ClockID,
ClockName, YearofManf, Price. Function takes details of all clocks and
stores them in file in one go.
Delete() – To accept a ClockID and removes the record with given ClockID
from the file ‘watch.csv’. If ClockID not found then it should show a relevant
message. Before removing the record it should print the record getting
removed.
37 Superior Education Society is an educational Organization. It is planning to 1*5=5
setup its Campus at Nagpur with its head office at Mumbai. The Nagpur
Campus has 4 main buildings – ADMIN, COMMERCE, ARTS and SCIENCE.
You as a network expert have to suggest the best network related solutions
for their problems raised in a to e, keeping in mind the distances between
the buildings and other given parameters:

Shortest distances between various buildings:


ADMIN to COMMERCE - 55 m
ADMIN to ARTS - 90 m
ADMIN to SCIENCE - 50 m
COMERCE to ARTS - 55 m
COMMERCE to SCIENCE - 50
ARTS to SCIENCE - 45 m
MUMBAI Head Office to NAGPUR Campus – 850 KM
Number of Computers installed at various buildings are as follows:
ADMIN – 110
COMMERCE – 75
ARTS – 40
SCIENCE – 12
MUMBAI Head Office – 20
a. Suggest the most appropriate location of the server inside the
Nagpur Campus to get the best connectivity for maximum number
of computers. Justify your answer.
b. Suggest and draw the cable layout to efficiently connect various
buildings within the Nagpur campus for connecting the computers.
c. Which of the following will you suggest to establish the online face-
to-face communication between the people in the ADMIN office of
Nagpur Campus and Mumbai Head office?
i. Cable TV
ii. E-mail
iii. Video Conferencing
iv. Text Chat
d. Suggest the placement of following devices with appropriate reasons:
i. Switch/Hub
ii. Repeater
e. Suggest the device/software to be installed in Nagpur Campus
to take care of data security and unauthorized access.
OR
Which network type is formed between Nagpur office to Mumbai
head office.

You might also like