0% found this document useful (0 votes)
291 views

Computer Science Sample Paper

Uploaded by

cosida
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
291 views

Computer Science Sample Paper

Uploaded by

cosida
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

myCBSEguide

Class 12 - Computer Science

Sample Paper - 01 (2022-23)

Maximum Marks: 70

Time Allowed: : 3 hours

General Instructions:

1. This question paper contains five sections, from Section A to E.


2. All questions are compulsory.
3. Section A has 18 questions carrying 01 mark each.
4. Section B has 07 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 03 Long Answer type questions carrying 05 marks each.
7. Section E has 02 questions carrying 04 marks each. One internal choice is given in Q35 against part c only.
8. All programming questions are to be answered using Python Language only.

Section A
1. State true or false:

Variables can be assigned only once.


a) True
b) False
2. Select the correct SQL query to find the temperature in the increasing order of all cities.
a) SELECT city, temperature FROM weather ORDER BY city;
b) SELECT city, temperature FROM weather;
c) SELECT city, temperature FROM weather ORDER BY temperature;
d) SELECT city FROM weather ORDER BY temperature;
3. Which of the following is not a legal method for fetching records from database from within Python?
a) fetchtwo( )
b) fetchall( )
c) fetchone( )
d) fetchmany( )
4. Which of the following functions will not result in an error when no arguments are passed to it?
a) float()
b) min()
c) all()
d) divmod()
5. The checksum of 1111 and 1111 is ________.
a) 0000
b) 1111
c) 1110
d) 0111
6. Which function is used to write a list of strings in a file?
a) writefullline( )
b) writeline( )

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited.


1 / 16
myCBSEguide
c) writestatement( )
d) writelines( )
To practice more questions & prepare well for exams, download myCBSEguide App. It provides complete study
material for CBSE, NCERT, JEE (main), NEET-UG and NDA exams. Teachers can use Examin8 App to create similar
papers with their own name and logo.
7. l1 = [1,2,3,4,5]

l1.append([5,6,[7,8,[9,10])

What will be the final length of l1?


a) 10
b) 5
c) 8
d) Error
8. The data types CHAR(n) and VARCHAR(n) are used to create ________ and ________ types of string/text fields in a
database.
a) Equal, variable
b) Fixed, variable
c) Fixed, equal
d) Variable, equal
9. Information stored on a storage device with a specific name is called a ________.
a) array
b) file
c) file pointer
d) tuple
10. Following set of commands are executed in shell, what will be the output?

>>> str = "hello"

>>> str[:2]
a) he
b) llo
c) ello
d) hel
11. Which of the following is not an inherent application of stack?
a) Implementation of recursion
b) Evaluation of postfix expression
c) Job scheduling
d) Reversing a string
12. It is a way to convey a Python object into a character stream:
a) Unpickling
b) Pickling
c) dump() method
d) load() method
13. What is the full form of CSMA/CA?
a) Collision Sense Multiple Access/Collision Act
b) Carrier Sense Multiple Access/Collision Avoidance
c) Carrier Sense Multiple Access/Collision Act
d) Collision Sense Multiple Access/Collision Avoidance
14. A copy of the dictionary where only the copy of the keys is created for the new dictionary, is called ________ copy.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited.


2 / 16
myCBSEguide
a) shallow copy
b) key copy
c) deep copy
d) partial copy
15. Which of the following is a client-side scripting language?
a) Perl
b) PHP
c) VB Script
d) Ruby
16. In which of the topology, network components are connected to the same cable?
a) Mesh
b) Ring
c) Star
d) Bus
17. Assertion (A): Pd.Series([4, 6, 9], range(1, 5)) will lead to value error.

Reason (R): The length of data and index must be same on series.


a) Both A and R are true and R is the correct explanation of A.
b) Both A and R are true but R is not the correct explanation of A.
c) A is true but R is false.
d) A is false but R is true.
18. Assertion (A): By using "a" access mode, it appends the content to the file if the file already exists with the specified
name.

Reason (R): By using "w" access mode, It overwrites the existing file.
a) Both A and R are true and R is the correct explanation of A.
b) Both A and R are true but R is not the correct explanation of A.
c) A is true but R is false.
d) A is false but R is true.
Section B
19. What is collision in a network? How does it impact the performance of a network?
20. What will be the output?

dic = {'One':1,'Two':2,'Three':3} 

print(list(dic.values()))

OR

Write a Python program to remove the characters of odd index values in a string.
21. Consider the following table order-details of database sales
ORDNUMB PARTNUMB NUMBORD QUOTPRIC

12494 CB03 4 175.00

12495 CX11 2 57.95


12498 AZ52 2 22.95

12500 BT04 1 402.99


Write Python code to increase NUMBORD by 5 if QUOTPRIC is less than 100 or NUMBORD is greater than 3.
22. Answer:
i. Which function do you use for connecting to a data from within Python?

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited.


3 / 16
myCBSEguide
ii. Can one DB-API be used for all database types?
23. What are the possible outcome(s) executed from the following code ? Also specify the maximum and

minimum values that can be assigned to variable PICKER.

import random

PICKER = random.randint(0, 3)

COLOR = ["BLUE”, "PINK", "GREEN", "RED"]:

for I in COLOR :

    for i in range(1, PICKER):

        print(I, end = "")

    print()
(i) (ii) (iii) (iv)
BLUE BLUE PINK BLUEBLUE

PINK BLUEPINK PINKGREEN PINKPINK

GREEN BLUEPINKGREEN GREENRED GREENGREEN


RED BLUEPINKGREENRED   REDRED
24. Write a Python program to concatenate following dictionaries to create a new one.

d1 = {'A': 10, 'B' : 20}

d2 = {'C': 30, 'D' : 40}

d3 = {'E': 50, 'F' : 60}

OR

Predict the output

str = "Python Program"

i. str [3 : 5]
ii. str [- 10]
iii. str [5 : ]
iv. str [- 28]
25. Given a text file car.txt following information of cars carNo, carname, containing mileage. Write a Python function to
display details of all those cars whose mileage is from 100 to 150.

OR

Write code to print just the last line of a text file "data.txt".
Section C
26. Answer:
i. What is the length of the tuple shown below?

t = (((('a', 1), 'b', 'c'), 'd', 2), 'e', 3)


ii. Find the errors. State reasons.
i. t = (1, "a", 9.2)

t[0] = 6
ii. t = [1, "a", 9.2]

t[0] = 6
iii. t = [1, "a", 9.2]

t[4] = 6

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited.


4 / 16
myCBSEguide
iv. t = ’hello'

t[0] = "H"
27. Give the output of the following SQL statements, which are based on the table APPLICANTS.
TABLE: APPLICANTS

No. NAME FEE GENDER C_ID JOINYEAR


1012 Amandeep 30000 M A01 2012

1102 Avisha 25000 F A02 2009

1103 Ekant 30000 M A02 2011


1049 Arun 30000 M A03 2009

1025 Amber 40000 M A02 2011

1106 Ela 40000 F A05 2010


1017 Nikita 35000 F A03 2012

1108 Arluna 30000 F A03 2012

2109 Shakti 35000 M A04 2011


1101 Kirat 25000 M A01 2012
i. SELECT NAME, JOINYEAR FROM APPLICANTS

WHERE GENDER = 'F' AND C_ID='A02';


ii. SELECT MIN (JOINYEAR) FROM APPLICANTS

WHERE GENDER = 'M';


iii. SELECT AVG(FEE) FROM APPLICANTS WHERE

C_ID = 'A01' OR C_ID = 'A05';

OR

i. A table, ITEM has been created in a database with the following fields

ITEMCODE, ITEMNAME, QTY, PRICE

Give the SQL command to add a new field, DISCOUNT (of type Integer) to the ITEM table.
ii. Categorize following commands into DDL and DML commands?

INSERT INTO, DROP TABLE, ALTER TABLE, UPDATE...SET


28. Write a function which takes two string arguments and returns the string comparison result of the two passed strings.
29. Write a method in python to read lines from a text file INDIA.TXT, to find and display the occurrence of the word
"India".

INDIA.TXT

"India is the fastest-growing economy. India is looking for more investments around the globe. The whole world is
looking at India as a great market. Most of the Indians can foresee the heights that India is capable of reaching."

The output should be 4

30. What is the difference between a local variable and a global variable? Also, give a suitable Python code to illustrate both.

OR

What is the significance of having functions in a program?


Section D

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited.


5 / 16
myCBSEguide
31. A line of text is read from the input terminal into a stack. Write a program to output the string in the reverse order, each
character appearing twice.

(ie.g., the string a b c d e should be changed to ee dd cc bb aa)


32. Answer (i) & (ii) OR (iii) & (iv)
i. Consider a binary file Employee.dat containing details such as empno:ename:salary (separator ':'). Write a Python
function to display details of those employees who are earning between 20000 and 40000. (Both values inclusive)
ii. Consider the file poemBTH.txt given below.

God made the Earth;

Man made confining countries

And their fancy-frozen boundaries.

But with unfound boundLess Love

I behold the border Land of my India

Expanding into the World.

What output will be produced by following code fragment?

obj1 = open("poemBTH.txt", "r")

s1 = obj1.readline()

s2.readline(10)

s3 = obj1.read(15)

print(s3)

print(obj1.readline())

obj1.close()
iii. Your recipe uses some ingredients. Write a program to store the list of ingredients in a binary file.
iv. Write code to open file contacts.txt with shown information and print it in the following form:

Name : <name>

Phone : <phone number>


33. Consider the following table GARMENT. Write SQL commands for the following statements.

Table: GARMENT

GCODE Description Price FCODE READY DATE

10023 PENCIL SKIRT 1150 F03 19-DEC-08 j


10001 FORMAL SHIRT 1250 F01 12-JAN-08
10012 INFORMAL SHIRT 1550 F02 06-JUN-08

10024 BABY TOP 750 F03 07-APR-07


10090 TULIP SKIRT 850 F02 31-MAR-07
10019 EVENING GOWN 850 F03. 06JUN-08

10009 INFORMAL PANT 1500 F02 20OCT-08


10017 FORMAL PANT 1350 F01 09-MAR-08
10020 FROCK 850 F04 09-SEP-07

10089 SLACKS 750 F03 31OCT-08


i. To display GCODE and DESCRIPTION of each GARMENT in descending order of GCODE.
ii. To display the details of all the GARMENTS, which have READY DATE in between 08-DEC-07 and 16-JUN-08
(inclusive of both the dates).

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited.


6 / 16
myCBSEguide
iii. To display the average PRICE of all the GARMENTS, which are made up of FABRIC with FCODE as F03.
iv. To display FABRIC wise highest and lowest price of GARMENTS from GARMENT table. (Display FCODE of each
GARMENT along with highest and lowest price)

OR

Write SQL commands for the queries (i) to (iv) and output for (v) to (viii) based on the tables 'Watches' and Sale given
below.

Watches

Watchid WatchName Price Type Qty_Store


W001 High Time 10000 Unisex 100

W002 Life Time 15000 Ladies 150


W003 Wave 20000 Gents 200
W004 High Fashion 7000 Unisex 250

W005 Golden Time 25000 Gents 100

Sale

Watchid Qty_Sold Quarter


W001 10 1

W003 5 1
W002 20 2
W003 10 2

W001 15 3
W002 20 3
W005 10 3

W003 15 4
i. TO DISPLAY ALL THE DETAILS OF THOSE WATCHES WHOSE NAME ENDS WITH TIME.
ii. TO DISPLAY WATCH'S NAME AND PRICE OF THOSE WATCHES WHICH HAVE PRICE RANGE IN
BETWEEN 5000-15000.
iii. TO DISPLAY TOTAL QUANTITY IN-STORE OF UNISEX TYPE WATCHES.
iv. TO DISPLAY WATCH NAME AND THEIR QUANTITY SOLD IN the FIRST QUARTER.
v. SELECT MAX (PRICE), MIN(QTY_STORE) FROM WATCHES;
vi. SELECT QUARTER, SUM(QTY_SOLD) FROM SALE GROUP BY QUARTER;
vii. SELECT WATCHNAME, PRICE, TYPE FROM WATCHES W, SALE S WHERE W. WATCHID!= S.WATCHID;
viii. SELECT WATCHNAME, QTYSTORE, SUM (QTYSOLD), QTY_STORE - SUM (QTY_SOLD) "STOCK" FROM
WATCHES W, SALE S WHERE W. WATCHID = S.WATCHID GROUP BY S.WATCHID;
Section E
34. Read the text carefully and answer the questions:

Granuda Consultants are setting up a secured network for their office campus at Faridabad for their day to day office and
web-based activities. They are planning to have connectivity between 3 buildings and the head office situated in

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited.


7 / 16
myCBSEguide
Kolkata. 

Distances between various buildings:


Building "RAVI" to Building "JAMUNA" 120 m

Building "RAVI" to Building "GANGA" 50 m


Building "GANGA" to Building "JAMUNA" 65 m
Faridabad Campus to Head Office 1460 KM
Number of Computers 
Building "RAVI" 25
Building "JAMUNA" 150
Building "GANGA" 51

Head Office 10
i. Suggest the most suitable place (i.e.r block) to house the server of this organization. Also, give a reason to
justify your suggested location.
ii. What type of network will be formed if all buildings are connected?
iii. Suggest the placement of the following devices with justification:
i. Switch
ii. Repeater

OR

The organization is planning to provide a high-speed link with its head office situated in the KOLKATA using a
wired connection. Name the cabels will be most suitable for this job?
To practice more questions & prepare well for exams, download myCBSEguide App. It provides complete study
material for CBSE, NCERT, JEE (main), NEET-UG and NDA exams. Teachers can use Examin8 App to create similar
papers with their own name and logo.
35. Read the text carefully and answer the questions:

Consider the following tables ACTIVITY and COACH:

Table: ACTIVITY

ACode ActivityName Stadium ParticipantsNum PrizeMoney ScheduleDate

1001 Relay 100 {tex}\times{/tex} 4 Star Annex 16 10000 23-Jan-2004


1002 High Jump Star Annex 10 12000 12-Dec-2003
1003 Shot Put Super Power 12 8000 14-Feb-2004

1005 Long Jump Star Annex 12 9000 01-Jan-2004


1008 Discuss Throw Super Power 10 15000 19-Mar-2004

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited.


8 / 16
myCBSEguide
Table: COACH

PCode Name ACode


1 Ahmad Hussain 1001

2 Ravinder 1008
3 Janila 1001
4 Naaz 1003
i. Write SQL commands for the following statements:
i. To display the names of all activities with their Acodes in descending order.
ii. To display sum of PrizeMoney for the Activities played in each of the Stadium separately.
ii. Write SQL commands for the following statements:
i. To display the coach's name and Acodes in ascending order of Acode from the table Coach.
ii. To display the content of the Activity table whose schedule date earlier than 01-01-2004 in ascending order
of Participants Num.
iii. Give the output of the following SQL queries:
i. SELECT COUNT (DISTINCT Participants Num) FROM ACTIVITY;
ii. SELECT MAX (Schedule Date), Min (Schedule Date) FROM ACTIVITY;

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited.


9 / 16
myCBSEguide

Class 12 - Computer Science

Sample Paper - 01 (2022-23)

Solution

Section A
1. (b) False

Explanation: False
2. (c) SELECT city, temperature FROM weather ORDER BY temperature;

Explanation: The ORDER BY keyword sorts the records in ascending order by default.
3. (a) fetchtwo( )

Explanation: There is no fetchtwo( ) method .


4. (a) float()

Explanation: The built-in functions min(), max (), divmod(), ord(), any(), all() etc. throw an error when no arguments
are passed to them. However there are some built-in functions like float(), complex() etc. which do not throw an error.
5. (a) 0000

Explanation: 0000,  1’s complement arithmetic to get the sum.


6. (d) writelines( )

Explanation: writelines(sequence) writes a sequence of strings to the file.


7. (b) 5

Explanation: A list is getting added in list l1 which will be counted as one item for the list.

To practice more questions & prepare well for exams, download myCBSEguide App. It provides complete study
material for CBSE, NCERT, JEE (main), NEET-UG and NDA exams. Teachers can use Examin8 App to create similar
papers with their own name and logo.
8. (b) Fixed, variable

Explanation: Char has a specific length which has to be filled by either letters or spaces whereas Varchar changes its
length accordingly .
9. (b) file

Explanation: File is a named entity stored in storage drive that contains stream of data.
10. (a) he

Explanation: str[:2] prints only the values at index 0 and 1 (as 2 is exclusive) of string and hence the answer is “he”.
11. (c) Job scheduling

Explanation: Job scheduling


12. (b) Pickling

Explanation: Pickling
13. (b) Carrier Sense Multiple Access/Collision Avoidance

Explanation: Carrier-sense multiple access with collision avoidance (CSMA/CA) in computer networking, is a network
multiple access method in which carrier sensing is used.
14. (a) shallow copy

Explanation: shallow copy


15. (c) VB Script

Explanation: VB Script and Java Script are examples of client-side scripting languages. Rest all are server-side scripting
languages.
16. (d) Bus

Explanation: Bus

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited.


10 / 16
myCBSEguide
17. (c) A is true but R is false.

Explanation: Series is a one-dimensional labeled array capable of holding any data type (integers, strings, floating-point
numbers, Python objects, etc.). The axis labels are collectively referred to as the index. if data is an array, an index must
be the same length as the data.
18. (b) Both A and R are true but R is not the correct explanation of A.

Explanation: In append mode, python creates a new file with the specified name if no such file exists. It appends the
content to the file if the file already exists with the specified name. In write mode, python creates a new file with the
specified name if no such file exists. It overwrites the existing file.
Section B
19. In a computer network, collision is a specific condition that occurs when two or more nodes on a network transmit data
at the same time. For example, if two computers on an Ethernet network send data at the same moment, the data will
"collide" and not finish transmitting. In case of a collision, the data gets garbled and cannot be read. Also, it may hamper
the overall performance of the network as collisions often lead to more retransmissions which clog the network and
deteriorate the overall performance of the network.
20. [1, 2, 3]

OR

str1 = input("Enter the string:")

final = ""
for i in range (len (str1)):

    if (i% 2==0):

        final = final + str1[i]

print("Modified string is :", final)

21. import MySQLdb

db = MySQLdb.correct('localhost', 'sales','Admin', 'salar345')

cursor = db.cursor()

sql = """UPDATE order-details set

NUMBORD = NUMBORD+5 where QUOTPRIC

<'%d' OR NUMBORD> '%d'"""

check_value = (100, 3)

try:

db.execute, (sql, check_value)

db.commit ()

except:

db.rollback()

db.close()
22. Answer:
i. The connect( ) function can be used to connect with a database from within Python.
ii. No, You need to download separate DB-API for each database you need to access. It defines a standard interface for
Python database access modules.
23. Option (i) and (iv) are possible.
(i) If Value of PICKER is 2 (iv) If Value of PICKER is 3

BLUE BLUEBLUE
PINK PINKPINK

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited.


11 / 16
myCBSEguide
GREEN GREENGREEN

RED REDRED
PICKER can have a maximum value of 3 and a minimum value of 0.

24. d1 = {'A' : 10, 'B' : 20}

d2 = {'C' : 30, 'D' : 40}

d3 = {'E' : 50, 'F' : 60}

d4 = {}

for i in (d1, d2, d3):

    d4.update(i)

print(d4)

OR

i. ho
ii. ‘o’
iii. n Program
iv. IndexError
25. def display_car():

     car_file = open('car.txt','r')

     cars = file.readlines()

     car_file.close()

     for car in cars:

         temp = car.split() #split the values in a line

         mileage = (int)(temp[2])

         if mileage >100 and mileage <= 150:

             print(car)

display_car()

OR

file_obj = open("data.txt", "r")

lines = file_obj.readlines()

lastline = len(lines) - 1

print ("Last line :", lines[lastline]])


Section C
26. Answer:
i. The length of this tuple is 3 because there are just three elements in the given tuple. Because a careful look at the
given tuple yields that tuple t is made up of:

t1 = "a", 1

t2 = t1, "b", "c"

t3 = t2, "d", 2

t = (t3, "e", 3)
ii. i. Item assignment not possible for tuples as tuples are immutable types.
ii. No error.
iii. Error, Item being assigned to an invalid index (index out of range).
iv. Item assignment not possible for strings as strings are immutable types.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited.


12 / 16
myCBSEguide

27. i. NAME JOINYEAR

Avisha 2009

ii. MIN(JOINYEAR)
2009

iii. AVG(FEE)

31666.666

OR

i. ALTER TABLE ITEM ADD Discount INT;


ii. DDL means ‘Data Definition Language’. It is used to create and modify the structure of database objects in SQL. So,
DDL commands are DROP TABLE, ALTER TABLE.

DML is ‘Data Manipulation Language’ which is used to manipulate data itself.

So, DML commands are INSERT INTO, UPDATE...SET.


28. def stringCompare(str1, str2):

     if str1.length() != str2.length() :

          return False

     else:

        for i in range (str1.length()):

            if str1[i] != str2[i]:

               return False

           else:

               return True

first_string = raw_input("Enter First string:")

second_string = raw_input("Enter Second string:")

if stringCompare(first_string, second_string):

     print ("Given Strings are same.")

else:

     print ("Given Strings are different.")


29. def display1():

    count = 0

    file = open('INDIA.TXT', 'r')

    for LINE in file:

        Words = LINE.split()

        for W in Words:

            if W == " India":

                count = count+1

        print(count)

    file.close()
30. The differences between a local variable and a global variable are as given below :
Local Variable Global Variable

1. It is a variable which is declared within a function or within a 1. It is a variable which is declared outside all the
block functions
2. It is accessible only within a function/block in which it is 2. It is accessible throughout the program

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited.


13 / 16
myCBSEguide
declared

3. Local variables are created when the function has started 3. Global variable is created as execution starts
execution and are lost when the function terminates. and is lost when the program ends.
For example, in the following code, x, xCubed are global variables and n and cn are local variables.

def cube(n):

      cn = n * n * n

      return cn

x = 10

xCubed = cube(x)

print(x, "cubed is", xCubed)

OR

Creating functions in programs is very useful. It offers the following advantages:


i. The program is easier to understand. The main block of the program becomes compact as the code of functions is not
part of it, this is easier to read and understand.
ii. Redundant code is in one place, so making changes is easier. Instead of writing code again when we need to use it
more than once, we can write the code in the form of a function and call it more than once. If we later need to change
the code, we change it in one place only. Thus it saves our time also.
iii. Reusable functions can be put in a library in modules. We can store the reusable functions in the form of modules.
These modules can be imported and used when needed in other programs.
iv. You use functions in programming to bundle a set of instructions that you want to use repeatedly because of their
complexity, are better self-contained in a sub-program and called when needed. That means that a function is a piece
of code written to carry out a specified task.
Section D
31. MAX_SIZE = 1000

stack = [0 for i in range(MAX_SIZE)]

top = 0

def isEmpty ( ):

        global top

        return top == 0

def push(x):

       global stack,top

       if top >= MAX_SIZE:

             return

       stack[top]= x

       top += 1

def pop( ):

       global stack,top

       if isEmpty( ):

             return

       else:

              top -= 1

              return stack[top]

string = input( ).split()

for i in string:

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited.


14 / 16
myCBSEguide
      push(i)

while not isEmpty( ):

       x = pop( )

       print (x + x, end = ' ')

               
32. Answer (i) & (ii) OR (iii) & (iv)

i. def Readfile():

    i=open("Employee.dat", "rb+")

    x=i.readline()

    while(x):

        l=x.split(':')

        if (20000>=float(1[2])<=40000):

            print(x)

        x=i.readline()

ii. The above code raises an error as there has been no file object defined/created by the name s2, which is directly used
in line 3. Therefore, the code will not give any output.
iii. import pickle

ingredients = ['cucumber’, 'pumpkin', 'carrot', 'peas']

with open('recipe.dat', 'wb') as fout:

    pickle.dump(ingredients, fout)
iv. file_obj = open("contacts.txt", "r")

line = file.read( )

info = line.split(',')

print ("Name :",info[0], "\n Phone:", info[1])

file_obj.close( )
33. i. SELECT GCODE, Description FROM GARMENT ORDER BY GCODE DESC ;
ii. SELECT * FROM GARMENT WHERE READY DATE BETWEEN '08-DEC-07' AND '16-JUN-08' ;
iii. SELECT AVG(Price) FROM GARMENT WHERE FCODE = 'F03' ;
iv. SELECT FCODE, MAX(Price), MIN(Price) FROM GARMENT GROUP BY FCODE ;

OR

i. SELECT * FROM WATCHES WHERE WATCHNAME LIKE '%TIME';


ii. SELECT WATCHNAME, PRICE FROM WATCH WHERE PRICE BETWEEN 5000 AND 15000;
iii. SELECT SUM (QTY STORE) FROM WATCHES WHERE TYPE LIKE 'Unisex';
iv. SELECT WATCHNAME, QTY SOLD FROM WATCHES W, SALE S WHERE W.WATCHID = S.WATCHID AND
QUARTER = 1;

v. max (price) min(qty_store)

25000 100

vi. quarter sum(qty_sold)


1 15

2 30

3 45

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited.


15 / 16
myCBSEguide
4 15

vii. watchname price type

HighFashion 7000 Unisex

viii. watchname qty_store qty_sold Stock


HighTime 100 25 75

Wave 200 30 170

LifeTime 150 40 110


Golden time 100 10 90
To practice more questions & prepare well for exams, download myCBSEguide App. It provides complete study
material for CBSE, NCERT, JEE (main), NEET-UG and NDA exams. Teachers can use Examin8 App to create similar
papers with their own name and logo.
Section E
34. i. The most suitable place to house the server is in building JAMUNA because it has the maximum number of
computers.
ii. WAN
iii. i. A switch would be needed in all the building, to interconnect the group of cables from the different
computers in each building.
ii. Repeaters may be skipped as per above layout, (because the distance is less than 100 m) however if building
RAVI and building JAMUNA are directly connected, we can place a repeater there as the distance between
these two buildings is more than 100 m.

OR

Optical Fibre
35. i. i. SELECT Acodes, ActivityName FROM ACTIVITY ORDER BY ACode DESC;
ii. SELECT SUM(PrizeMoney) FROM ACTIVITY GROUP BY Stadium;
ii. i. SELECT Name, Acode FROM COACH ORDER BY Acode;
ii. SELECT * FROM ACTIVITY WHERE SchduleDate < '01-Jan-2004' ORDER BY ParticipantsNum;
iii. i. 3
ii. 12-Dec-2003 19-Mar-2004

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited.


16 / 16

You might also like