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

AMERICAN MONTESSORI PUBLIC SCHOOL

Pre- Board Examination-I (2020-2021)


Class- XII
Subject- Computer Science
Time Allowed: 3 Hours Maximum Marks: 70
Set-A
General Instructions:
1. This question paper contains two parts A and B. Each part is compulsory.
2. Both Part A and Part N have choices.
3. Part-A has 2 sections:
a. Section-1 is short answer questions, to be answered in one word or one line.
b. Section-II has two case studies questions. Each case study has 4 case based sub-parts.
An examinee is to attempt any 4 out of the 5 subparts.
4. Part-B is descriptive paper.
5. Part-B has 3 sections:
a. Section-I is short answer questions of 2 marks each in which two questions have
internal options.
b. Section-II is long answer questions of 3 marks each in which two questions have
internal options.
c. Section-III is very long answer questions of 5 marks each in which one question has
internal option.
6. All programming questions are to answered using Python Language only.

Marks
Q.No PART -A
Allocated

SECTION-I
Select the most appropriate option out of the options for each
question. Attempt any 15 questions from question no 1 to 21.

Which value type does input() return?


1 (a) Boolean (b) String (c) Int (d)Float 1
What will be the value of the expression?
14 + 13 % 15
2 (a) 14 (b) 27 (c) 12 (d) 0 1
Following set of commands is executed in shell, what will be the output?
>>>str = "corona virus"
>>>str [4 : 8]
(a) ona (b) na v (c) coro (d) ona v
3 1
4 What is the use of load function? 1
A tuple is declared as
T1 = (5,15,20,35) What will be the output of
5 print(sum(T1)) 1
A list is given as Age=[10, 20,30,40,50,60]
6 What will be displayed as Age[:2] + Age[2:] 1
7 In SQL, what is the use of distinct keyword? 1
Identify the invalid variable names from the following:
8 Roll No, 10marks, _sum, name 1
9 Name the protocol which is helpful in transferring the files. 1
10 Expand the term ISP. 1
What will be the value of the expression?
37 // 5
11 (a) 7.4 (b) 7 (c) 7.0 (d) 7.40 1
12 What do you mean by a primary key? 1
Identify the valid declaration of test:
test=['Python' ,10, 'Good', 25.45]
13 (a) Tuple (b) Dictionary (c) List (d) String 1
14 In SQL, Which command is used to see the list of databases? 1
Write a statement to declare a dictionary whose keys are 'Apple', 'Mango', 'Banana' and
15 values are 100, 250, 60 1

Siya want to connect her office with the another office of the same building. Suggest her a
16 suitable way to connect (in terms of transmission media) 1
17 The device that can operate in place of a hub is a _____ 1

Which of the following is the fastest media of data transfer?


18 (a) Co-axial Cable (b) Untwisted Wire (c) Telephone Lines (d) Fibre Optic 1
19 INSERT INTO command is a DML command. (True/False) 1
Rearrange the following terms in increasing order of data transfer rates.
20 gbps,Gbps, Kbps, kbps, bps 1
Which clause is used with "aggregate functions"?
21 (a) GROUP BY (b) SELECT (c) WHERE (d) Both a and b 1

SECTION-II
Both the case study based questions are compulsory. Attempt any 4
sub parts from each question. Each question carry 1 mark.
A company, Sunrise Ltd. Is considering to manage the records of their employees using SQL
to store the data. As a database administrator, Harish has decided that:
Name of the database: Employee
Name of the table : Empl
The attributes of Empl are as follows:
EmpId - Numeric
Empname - character of size 20
22 Salary - Numeric
Date_of_Joining - Date

EmpId Empname Salary Date_of_Joining


1001 Mr. Khanna 50000 23-10-2018
1002 Mr. Roy 35000 22-04-2017
1004 Ms. Sehgal 25000 23-08-2016
1008 Mr. Pahwa 30000 15-10-2019
1006 Ms. Sharma 20000 14-12-2019
1005 Mr. Bhalla 25000 12-09-2020

(a) Identify the attribute best suitable to be declared as a primary key. 1


(b) Write the degree and cardinality of the table Empl. 1
(c) Harish want to delete all the records of the table Empl. Structure of the table
should not be removed. Write the query for the same. 1
(d) Write a query to increase the salary of all the employees by 5000. 1
(e) Harish wants to see the structure of the table ‘Empl’. Help him to do the same.
1

Radhika is writing a program to create a CSV file “books.csv” which will contain the book
name and author name. She wants to display the details of all the books.

(a) Name the module she should import in the program.


23
(b) In which mode, she should open the file to read all the data. 1
(c) Name the in-built function which is used to read the data from csv file. 1
(d) Write a function to close the csv file. 1
(e) If Radhika wants to add a new record in the csv file, write the statement to help her
in opening the file. 1
1
PART-B

Section-I
24 Evaluate the following expressions: 2
(a) 47 // 5 + 10 **2 – 25+12
(b) 34 > 56 or 90 > 60 and not 21 > 10

25 Differentiate between hacker and cracker. 2


OR
Differentiate between hub and switch.

26 Expand the following terms: 2


a. HTTP b. ISP c. ARPANET d. TCP/IP

27 Differentiate between local and global variable with suitable example. 2


OR
Differentiate between mutable and immutable data types with suitable example.

28 Rewrite the following code in Python after removing all syntax error(s). underline each 2
correction done in the code.
Num=50
while Num >= 10:
if NUM =30:
BREAK
Elif Num >30:
print(Num)
else:
print(Num //10)
29 What are the possible output(s) of the following code? Also specify the maximum and 2
minimum values that can be assigned to variable PICKER.
import random
PICK = random.randint(0,3)
CITY= [“DELHI”, “MUMBAI”, “CHENNAI”,”KOLKATA”]
for x in CITY:
for y in range(1, PICK):
print (x, end = “ “)
print()
(i) DELHIDELHI (ii) DELHI
MUMBAIMUMBAI MUMBAI
CHENNAICHENNAI CHENNAI
KOLKATA KOLKATA KOLKATA

(iii) DELHI (iv) DELHI


DELHIMUMBAI MUMBAIMUMBAI
DELHIMUMBAICHENNAI KOLKATAKOLKATAKOLKATA
30 Differentiate between Primary Key and a Candidate Key with suitable example. 2

31 What is the use of dump() and load() functions with suitable example? 2

32 What is use of ‘LIKE’ keyword in SQL? Explain with suitable example. 2


33. Find and write the output of the following Python code: 2
def fun(s):
k=len(s)
m=""
for i in range(0,k):
if(s[i].isupper()):
m=m+s[i].lower()
elif(s[i].isalpha()):
m=m+s[i].upper()
else:
m=m+'##'
print(m)

fun('Charles@Babbage')

SECTION-II

34 Write a function Swap(num, n) in Python, which accepts a list num of numbers and n is the 3
number of elements. The function will interchange every alternate value. E.g
If the list num contain: [11, 21, 31, 41, 51, 61]
Output, [21, 11, 41, 31, 61, 51]

35 Write a function word4() in Python that displays 4 letter words present in a text file 3
‘myfile.txt’.
If the ‘myfile.txt’ contents are as:
We are here to learn python. Python has so many features which make it more comfortable
interface.
Output:
here
many
make
more
OR
Write a function count() in Python, which should count number of ‘This’ in a given text file
‘Sample.txt’.

36 Write the outputs of the SQL queries (i) to (iii) based on the following table ‘CABHUB’: 3
VCODE VNAME MAKE COLOR CAPACITY CHARGES
100 INNOVA TOYOTA WHITE 7 15
102 SX4 SUZUKI BLUE 4 14
104 C CLASS MERCEDES RED 4 35
105 A-STAR SUZUKI WHITE 3 14
108 INDIGO TATA SILVER 3 12
(a) To display the names of all the white colored vehicles.
(b) To display name of vehicle, make and capacity of vehicles in ascending order
of their seating capacity.
(c) To display the highest charges at which a vehicle can be hired from CABHUB.

37 Write a function in Python PUSH() to insert an element in the stack. After inserting the 3
element display the stack.
OR
Write a function in Python POP() to remove the element from the stack and also display the
deleted value.
SECTION-III
38 Sanskar University of Himachal Pradesh is setting up a secured network for its campus at 5
Himachal Pradesh for operating their day-to-day office & web based activities. They are
planning to have network connectivity between four buildings. Answer the question (i) to
(v) after going through the building positions in the campus & other details which are given
below:
Number of computers:-
Building No. of Computers
Main 150
Admin 75
Finance 50
Academic 60

As a network expert, you are required to give best possible solutions for the given queries
of the university administration: -
(a) Suggest cable layout for the connections between the various buildings,
(b) Suggest the most suitable building to house the server of the network of the university,
(c) Suggest the placement of following devices with justification:
1. Switch/Hub 2. Repeater
(d) Suggest the technology out of the following for setting-up very fast Internet connectivity
among buildings of the university
1. Optical Fiber 2. Coaxial cable 3. Ethernet Cable
(e) The University is planning to connect its admission office in Haryana, which is more than
1000 KM from University. Which type of Network out of LAN, MAN or WAN will be formed?
Justify your answer.

39 Consider the following tables STORE and SUPPLIERS and answer the following 5
parts of the questions:

Table: Store

ITEMNO ITEM SCODE QTY RATE LASTBUY


2005 Sharpener Classic 23 60 8 31-6-2009
2003 Ball Pen 0.25 22 50 25 1/2/2010
2002 Gel pen premium 21 150 12 24-02-2010
2006 Gel Pen Classic 21 250 20 11/3/2009
2001 Eraser Small 22 220 6 19-1-2009
2004 Eraser Big 22 110 8 2/12/2009
2009 Ball Pen 0.5 21 180 18 3/11/2009
Table: Suppliers

SCODE SNAME
21 Premium Stationers
23 Soft Plastics
22 Tetra Supply
a. To display details of all the items in the Store table in ascending order of
LastBuy.
b. To display itemno ItemName of those items from Store Table whose rate is
more than 15 rupees.
c. To display the details of those items whose Suppliers code(Scode) is 22 or
Quantity in Store(Qty) is more than 110 from the table Store.
d. To display minimum rate of Items for each Supplier individually as per Scode
from the table Store.
e. To increase the Rate of all the items by Rs. 10
40 (a) Create a binary file “employee” that stores the records of employees and 5
display them one by one.
(b) Display the records of all those employees who are getting salaries between
30000 and 50000.

OR

Write a python program to insert/append a new record in a binary file –


“student.dat”. The record can have Rollno, Name and Fees.

You might also like