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

DAV PUBLIC SCHOOL SAHIBABAD

Micro PreBoard Examination 2020-2021


Class Xl Set-B
Computer Science(083)
Max Marks:50 Time: 2Hr

General Instructions:
1. This question paper contains five sections, Section A to
2. All questions are compulsory.
E
3. Section A have 17 questions carrying 01 mark each.
4. Section B has 06 Very Short Answer type questions carrying 02 marks each.
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 01 Long Answer type questions carrying 05 marks each.
7. Section E has 01 questions carrying 04 marks each.
8. All programming questions are to be answered using Python Language only.

Section A

Q.No Question Mark

State True or False 1


Python is a dynamically typed language

2 Which ofthe following is an invalid identfier in Python? 1


a) My string_1 b) 1st_string c)hello d)

3 Given the following dictionaries


dict_course f'B.Tech": "4yr", "MBA": "2yr}
dict_enrol=BCA":3yr, "BBA":"3yr}
Which statement will merge the contents of dict_course at the end of dict_enrol
dictionaries?
a. dict_course. update(dict_enrol)
b. dict_enrol.update(dict_course)
c. dict_enrol.merge(dict_coursel)
d. dict_course.merge(dict_enrol)

Consider the given expression


(not True and False or True) and None
Which of the following will be correct output if the given expression is evaluated?
(a) True (b) False ( None (d) NULL
Select the correct output of the code.
a"Year 2022 at All the best"
aa.partition(2')
b al0] +", + a[1]+". "+a[3] "

print (b)
(a) Year.0. at All the best
(b) Year 0. at Al the best
(c) Year. 2.022 at All the best
(d) Year. 022. at all the best
paeve

all the contents of 1


o the following mode in the file opening statement will truncate
the file?
(a) a+ (b) r+ (c) w+ (d) None of the above

Fill in the blanks:


command is used
nwiwavaeaieiicsniaiatketmo to add a new column to the table.

Which of the following commands will delete the record from the MYSQL table?

(a) DELETE TABLE


(b) DROP TABLE

(c) REMOVE TABLE


(d) DELETE RECORD

9 Which of the following statement(s) would give an error after executing the following 1
code?
S= (2, "HELLO", 4, 56.7) #Statement 1
print (S) #Statement 2
S[2]="Thank you" # Statement 3
S[1][0] = '@ # Statement 4
S-S+"Thank you" #Statement 5
(a) Statement 3 (b) Statement 4 (c) Statement 1 (d) Statement 3 and 4

10 The correct syntax of seek() is 1


(a) file object.seek(offset [, reference_point])
(6) seek(offset [, reference_point])
(c) seek(offset, file_object)
(d) seek.file_object(offset)
Fill in the blank 1
11
is a non-key attribute, whose values are derived from the primary key of some
other table.
Candidate Key (d) Alternate Key
(a) Primary Key (b) Foreign Key (c)
1
12 Fill in the blank:
with constraint, will add a
The CREATE TABLE statement when combined
restriction of not repeating the data in the column.
NOT NULL
DESCRIBE (b) UNIQUE (C) DISTINCT (d)
(a)

2
13 What will the following expression be 1
evaluated to in Pythoní
print (3--10*2+99/11)

(a) 80 (b) 81 (c) -81 (d) 81.0


14
12 are ASSERTION AND
aand REAsONING based questions. Mark the correct
choice as
(a) Both A and R are true and R is the correct
explanation for A
() Both A and R are true and R is not the corract explanation tof A
(c) A is True but R is False
(d) A is false but R is True
15 1
Assertion (A): CSV (Comma Separated Values) is a file format tor aatd
storage which looks like a text file.

Reason (R): The information is organized with one record on each line
and each field is
separated by comma.
16 ASsertion (A):-If the arguments in function call statement match the number and order Of 1
arguments as defined in the function definition, such arguments are called positional
arguments.

Reasoning (R):- During a function call, the argument list first contains
default argument{s) followed by positional argument(s).

one or more countries or


17 | The network that connects many organizations spread over
continents is known as:

(a) www (b) LAN (c) PAN (d) WAN

Section B

Shristi has written a Python program to add all the numbers ofthe list. Her code is having 2
18 errors. Rewrite the correct code and underline the corrections made.

define add (value):


anount 0
for a in value
amount =t a

returns amount

print (add ( (2, 4, 5, 7, 01))

19 Vrite two points of difference between XML and HTML. 2


declaration:
string
20 (a) Given is a Pythorn Science with ython
mySubject = "Computer

the output of
() Writeprint mySubject[-27:-10:2)

the code given below:


(b) Write the output of
a-[10,20,30,40,50,60,70]

> aj0:2}=[100,1000]
>a[0:2=[10000]
>>> pintfa)
2
below:
Predict the output ofthe Python
code given
21
def remainf (N1, N2) :
if N1>N2:
return N18N2

else:
return N28N1

NUM= (10,23,14,54, 32]


for CNT in range (4,0, -1):
A-NUM [CNT]
B-NUM[CNT-11
'$', end=' ')
print (remain (A, B),
2
following:
22 (a) Write the full forms of theSMTP (i) PPP
)
of HTTP?
(b) What is the use
2
Relational Database Management System.
23 Explain the use of Primary Key in a
answer.
Give example to support your
Section-C
1+2
tables:
24 Consider the following
Table:Employee
EMP ID EMP_NAME DEPT NAME
SUMIT HR
1
JOEL IT
BISWA MARKETING
3
4 VAIBHAV IT
SAGAR SALES
5
Table:Manager
DEPT NAME MANAGER NAME
IT ROHAN
SALES RAHUL
HR TANMAYY
FINANCE ASHISH
MARKETING SAMAY

What will be the output of the following statement?


SELECT* FROM Employee NATURAL JOIN Manager;

Write the output of the queries (i) to (iv) based on the table, STOCK
given below:

Table: STOCK
L ItemNo Item Dcode Qty UnitPricee StockDate

5005 Ball Pen 0.5 102 100


******** *
16 2010-03-31
Ball Pen 0.25 102 150 20 2010-01-01
5003
5002 Gel Pen Premium 101 125 14 2010-02-14
200 2009-01-01
5006 Gel Pen Classic101
5001 Eraser Small 102 210 2009-03-19
5004 Eraser Big 102 60 10 2009-12-12
160 8 2009-01-23
5009 Sharpener Classic 103
(i) SELECT DISTINCT Dcode Stock;
FROM
FROM Stock GROUP BY
(ii) SELECT Dcode, COUNT("), MIN(unit_price)
Dcode HAVING COUNT(Dcode)>1; NO
SELECT Item FROM Stock WHERE qty>100 ORDER BY CNAMEt
(iii) WHERE Unitprice BETWEEN 10
(iv) SELECT AVG(unitprice) FROM Stock
AND 17;
the 3
write a user-doflned functlon Count H TO
in Python that displays
25
flle "Poom.txt"
of lines not starting wlth H' and 'T' in tho
number
Example, if the filo contalns:
Here we go round the mulberry bush,
The mulberry bush
The mulberry bush.
Here we go round the mulberry bush
On a cold and frosty morning.
The line count should be 1

bookk 3
to implement a Stack for book details (book
name:
26 Write a program
price) where book name is a key and book price is value.
Write a function in Python, the of
containing details
Push(book_details) where book_details is a dictionary
should push the names of those
books-{book_name book price). The function
books in the stack which have price greater than 500.

Also count of books pushed into the stack.


display the data:
For example: If the dictionary contains the following
books=("Python":560,"Java":450,"MySQL":330,"Web Development":725}
The stack should contain Python and Web Development.
in the stack is 2.
The output should be: The count of books
3
27 Consider the following tables:
000 SObo
Table: MOBILEMASTER

MPrice M_Mf_Date
MCompany M_Name
MId 2013-02-12
Samsung8 Galaxy A500
MBO01 2250 2011-04-15
Nokla |N1100
MBO03 4500 2016-10-17
Unite3
MBO04 Micromax 2017-11-20
XperlaM 7500
MBOO5 Sony 8500 2010-08-21
SelfieEx
MBO06 Oppo
Table: MOBILESTOCK

S_ld M_Id M_Qty M_Supplier


450 New Vision
MBO04
S002 MBO03 250 Praveen Gallery
300 Classic Mobile Store
MB001
5003 A-one Mobiles
S004 MBO06 150
S005 MBOO3 150 The Mobile
SO06 MB006 50 Mobile Centre

6
eniiiiscienviensesaimiiaea
) SELECT M
MOBILESTOCKConpany, MName,
MS, WHERE MMMMPrice,M Qty FROM MOBILEMASTER MM,
ID- MS.M_ID
(4) SELECT MAX{M_Price) FFROM
n) SELECT M_Supplier, MOBILEMASTER WHERE M_Name LlKE "S9%
M_ Qty FROM MOBILESTOCK WHERE
v) SELECTM_Company FROM M_d="MBO03",
MOBILEMASTER WHERE M_Price
AND 5000 BETWEEN 300
etrn

Section D

28a)The code given below


Ticket ld - integer inserts the following record in the table Fun_City 3+2

Name-string
Ticket Price - integer
No Of_Tickets - integer
Total_Amount - integer
Note the following to establish connectivity between Python and MySQL:

Username is root Password is


Ticket
The table exists in a MySQL database named Amusement.

The details (Ticket_ld, Name, Ticket_Price, No_of_Tickets) are to be

accepted by the user. Write the following missing statements to complete


the code:
Statement 1- To form the cursor object
Statement 2- Write a command to execute the query
Statement 3 -
Write a command to save data permanently in the database.

mysql.connector as mysql
1mport
def sql_data ():
con=mysql.connect (host="localhost", user="root"

database="Amusement" )
password="Ticket ",
#Statement l
mycursor=
Ticket Number :: "))
(input("Enter
Ticket No=int
Name-input ("Enter Nane:")
("Enter Ticket Price :: "}
Ticket Price= input
No of tickets ")
No Of Tickets=int (
input ("Enter
No of Tickets
Total Amount Ticket Price

Query="Insert
into Fun City
0)".format (Ticket_No, Name
Values ((}, ' { } ' , 0 ,
No Of Tickets,
Total_Amount)
T1cket_Price,
#statement 2

I#Statement 3

print ("Data Added success fully"

(b)Write the output of the code qiven below


Val 100

def display (N)


global Val

Val 1 0 0 0 0

if N82=#0:
Val = Val ** N

else:
Val = Val * N

print (Val, end="$")

display (2)
print(Val)

Section-E

4
that defines and calls the following user defined
29 Write a Program in Python
functions: CSV file 'furdata.csv.
To accept and add data of an furniture to a
(i) append() elements as furid, furname and furprice
to
-

record consists of a list with field


Each
name and furniture price respectively.
store furniture id, furniture is more than
the records of the furniture whose price
(ii)search()- To display
10000

You might also like