0% found this document useful (0 votes)
272 views6 pages

CBSE Sample Papers For Class 12 Computer Science Set 7

Uploaded by

Amala Ashok
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)
272 views6 pages

CBSE Sample Papers For Class 12 Computer Science Set 7

Uploaded by

Amala Ashok
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/ 6

CBSE Sample Papers for Class 12 Computer Science Set 7

Time: 3 hrs Max.Marks: 70


Instructions
1. Please check this question paper contains 35 questions.
2. The paper is divided into 5 Sections A, B, C, D and E.
3. Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
4. Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
5. Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
6. Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
7. Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
8. All programming questions are to be answered using Python Language only.
Section – A
Question 1.
State True or False [1]
“A tuple is a immutable data type.”
Question 2.
Which of the following Python functions do not require importing of a module? [1]
(a) type() (b) input() (c) sqrt() (d) Both (a) and (b)
Question 3.
The alternate to math.pow() function is operator. [1]
(a) ** (b) * (c) += (d) /
Question 4.
To print all elements of tuple in reverse order using [1]
(a) [: – 1] (b) [: : – 1] (c) [1 : : ] (d) [: : 1]
Question 5.
Given : s=”[email protected]”. What will be the output of print(s[2: :2])? [1]
(a) ‘ypcalcm’ (b) ‘ypcgalcm’ (c) ‘ypcglcm’ (d) ‘pcgalm’
Question 6.
Which of the following modes open a text file, such that the new data is written in it keeping the existing
contents ? [1]
(a) r+ (b) rw+ (c) w+ (d) a
Question 7.
Which of the following functions does not require any arguments? [1]
(a) random() (b) randint() (c) randrange() (d) choice()
Question 8.
Which statement of SQL provides statements for manipulating the database objects? [1]
(a) DDL (b) DML (c) DCL (d) TCL
Question 9.
Write the output of given code [1]
s1 = ‘Hello’
s2 = ‘World’
s = s1 + s2
print(s)
(a) Hello World (b) HelloWorld (c) ‘Hellow’ ‘World’ (d) Error
Question 10.
An alternate key can be [1]
(a) only 1 in a table. (b) a table can have maximum 2 alternate keys. (c) a table can have at most 3
alternate keys.
(d) multiple in a relation.
Question 11.
Fill in the blank :
The ………. clause with GROUP BY, can filter groups from the query output. [1]
(a) WHERE (b) FILTER (c) HAVING (d) CHECK
Question 12.
Which attribute is used to return access mode with that file was opened? [1]
(a) file.mode (b) mode.file (c) filemode (d) None of these
Question 13.
State whether the following statement is True or False:
WAN refers to a small, single site network. [1]
Question 14.
Given a list L=[6,12,9,40,2,1]. Which of the following statements will arrange the list in reverse order? [1]
(a) L.arrange() (b) L.sort() (c) L.sort(reverse=True) (d) L.sort(reverse=False)
Question 15.
Fill in the blank
………… is a unique name that identifies a particular website and represents the name of the server. [1]
Question 16.
Identify among the following which is mainly used to host website. [1]
(a) Mail server (b) Web server (c) Database server (d) None of these
Directions In the question numbers 17 and 18, a statement of Assertion (A) is followed by a statement of
Reason (R). Choose the correct option.
Question 17.
Assertion (A) A function with 3 formal parameters must be called with 3 actual parameters. [1]
Reason (R) Since, all the formal parameters are used to produce the output from the function, the function
expects the same number of parameters from the function call.
(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.
Question 18.
Assertion (A) A binary file uses the dump() function to write data into it. [1]
Reason (R) The load() function reads data from a binary 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
Question 19.
(a) Expand the following terms [1 + 1 = 2]
HTTPS, HTML
(b) Which cable networks are used for LAN connections?
Or
(a) Write down the name of communication channel used for telephone line and TV.
(b) Why is a switch called an intelligent hub?
Question 20.
What will be the output of following code ? [2]
L=[10, 30, 50, 60]
L.append(70)
L.insert(2,80)
L.sort()
print(L)
Question 21.
Find outputs of following code [2]
L=[118,16,[20,30,50],120]
L1=[12,16,17]
L.extend(L1)
print(L[2][2])
print(L)
Or
Find the output of following code
t1=(9, 6, 1, 12)
t2= (10, 11, 12)
print(t1+t2)
print(t1*2)
print(t2-t1)
Question 22.
What do you understand by primary key? Give a suitable example of primary key from a table
containing some meaningful data. [2]
Or
Define UPDATE command of SQL with its basic syntax and also give one of its example.
Question 23.
Rewrite the following code into for loop [2]
i=3
while (i < 5):
if (i == 4):
print ("Welcome”)
else:
print ("No entry”)
i=i+1
print (“value of i”, i)
Question 24.
What will be the output of the following code, when executed? [2]
d={'Name':'Ram','Subjects':['Eng','Physics','CS'],'Marks':[67,78,90])
print(d['Subjects'])
print(d['Subjects'][2])
Or
What will be the output of the following code, when executed?
tupnames=("India","Australia",("UK","Nepal"),"Bangladesh")
print(tupnames[5:])
print(tupnames[2][1])
Question 25.
Write an algorithm to find out whether the given number is divisible by 3 or not. [2]
Section – C
Question 26.
Consider the following table STORE and answer the questions [1 × 3 = 3]
TABLE: STORE
Write SQL commands for the following statements:
(i) To display details of all the items in the STORE table in ascending order of LastBuy.
(ii) To display ItemNo and Item name of those items from STORE table, whose Rate is more than ₹ 15.
(iii) To display the details of those items whose Supplier code (Scode) is 22 or Quantity in Store (Qty) is
more than 110 from the table STORE.
Question 27.
Write a program to accept a filename and a position. Using the inputs, call a function SearchFile(Fname,
pos) to read the contents of the file from the position to the end. Now, display all those words that start
with “U” or “u”. [3]
Or
Write a program to search an Employee record according to Id from the “emp.txt” file. The “emp.txt” file
contains Id, Name and Salary fields. Assume that first field of the employee records (between Id and Name)
is separated with a comma(,).
Question 28.
Consider the following tables GARMENT and FABRIC. Write SQL commands for the statements (i) to (iii). [1
× 3 = 3] TABLE: GARMENT

TABLE:FABRIC
FCODE TYPE

F04 POLYSTER

F02 COTTON

F03 SILK

F01 TERELENE
(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 READYDATE in between 08-DEC-07 and 16- JUN-
08 (inclusive of both the dates).
(iii) To display the average PRICE of all the GARMENTS. Which are made up of FABRIC with FCODE as F03.
Question 29.
Write a user defined function change(L) to accept a list of numbers and replace the number in the list with
its factorial. [3]
Example : Input: [3,4,5,6,7]
Output: [6, 24, 120, 720, 5040]
Question 30.
Suppose STACK is allocated 6 memory locations and initially STACK is empty (Top = 0). [3]
Given the output of the program segment:
AAA = 4
BBB = 6
Push (STACK, AAA)
Push (STACK, 4)
Push (STACK, BBB +2)
Push (STACK, AAA + BBB)
Push (STACK, 10)
while (Top>0) :
Element = STACK. Pop ( )
print(Element)
Section – D
Question 31.
Consider the following table Student [1 × 4 = 4]
Table: Student

Write statements to
(a) Display the average Marks.
(b) Display the different Classes.
(c) Change the data type of Marks column so that it can take fractional values upto 2 decimals.
(d) Increase width of Name column to varchar(50).
Question 32.
Write a program using functions : [4]
addTransaction() To append bank transactions of following structure to “bank.csv”
TranID TranDate Amount Type
getTran() To display those transactions whose type is “Deposit”.
Section – E
Question 33.
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 Kolkata. [1 × 5 = 5]
Answer the questions (a) to (e) after going through the building positions in the campus and other details,
which are given below:
Distance 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

(a) Suggest the most suitable place (i.e. block) to house the server of this organisation. Also, give a reason
to justify your suggested location.
(b) Suggest a cable layout of connections between the building inside the campus.
(c) Suggest the placement of the following devices with justification:
(i) Switch
(ii) Repeater
(d) The organisation is planning to provide a high speed link with its head office situated in the Kolkata
using a wired connection. Which of the following cable will be most suitable for this job?
(i) Optical fibre
(ii) Co-axial cable
(iii) Ethernet cable
(e) Consultancy is planning to connect its office in Faridabad which is more than 10 km from Head office.
Which type of network will be formed?
Question 34.
(a) List the major components of database system. [1 + 4 = 5]
(b) Note the following to establish the connection between Python and MySQL:
A resultset is extracted from the database using the cursor object (that has been already created) by giving
the following statement.
Mydata=cursor.fetchone( )
(i) How many records will be returned by fetchone() method?
(ii) What will be the datatype of Mydata object after the given command is executed?
Or
(a) What is join? What are the different kinds of joins?
(b) Define fetchmany([size]). How does fetchone() method differ from fetchall() method?
Question 35.
(a) What are the advantages of CSV files? [2 + 3 = 5]
(b) Write a Python program using following functions to :
A file “teacher.csv” contains a city, teacher name and Salamount.
Search() Search and print all rows where city is “delhi”.
Sample “teacher.csv” :

Searchfromfile() From the file “teacher.csv” print all rows where teacher name is “Anil”.
Or
(a) What are the disadvantages of CSV files?
(b) Somya, wants to write the code for opening the binary file “hotel.dat” and write records of customer’s
roomid, name and days of stay.

You might also like