XIIComp.Sc
XIIComp.Sc
XIIComp.Sc
NOIDA EXTENSION
CLASS- XII
COMPUTER SCIENCE
TIME-3 HRS MAX MARKS- 70
General Instruction:
1. Please check this question paper contains 35 questions
2. This question paper contains five sections, Section A to E.
3. Section A, consists of 18 questions (Q1 to Q18) carrying 01 mark each.
4. Section B, consists of 07 questions (Q19 TO Q25) carrying 02 marks each
5. Section C, consists of 05 questions (Q26 TO Q30) carrying 03 marks each.
6. Section D, consists of 03 questions (Q31 TO Q33) carrying 05 marks each.
7. Section E, consists of 02 questions (Q34 TO Q35) carrying 04 marks each All
programming questions are to be answered using Python Language only
SECTION A
Q1. Consider The following: 1
t=(12,13,14,16,[2,3])
What changes will be made in t after the execution of the following statement?
t.append(4)
(i) t=(12,13,14,16,[2,3],4) (ii) t= (12,13,14,16,[2,3,4])
(iii) t=(4,12,13,14,16,12,3) (iv) t=It will give an error
Q2. 1
(i) Update
(ii) Remove
Q8. Fill in the blank: (iii) Alter
______________command is used to remove primary key from the table in SQL.
(a) update (b)remove (c) alter (d)drop
Q9. What shall be the output for the execution of the following statement? 1
“ANTARTICA”.strip(‘A’)
i. NTRCTIC
ii. [‘ ‘, ‘NT’, ‘RCTIC’, ‘ ‘]
Q10. iii.the following
Which of NTARCTIC constraints will supports the entry of duplicate 1
values in a column?
i. Unique
ii. Distinct
iii. Primary Key
Q11. The correct syntax of seek() is:
(a) file_object.seek(offset [, reference_point])
(b) seek(offset [, reference_point])
(c) seek(offset, file_object)
(d) seek.file_object(offset)
def prime():
n=int(input("Enter number to check :: ")
for i in range (2, n//2):
if n%i=0:
print("Number is not prime \n") break
else:
print("Number is prime \n’)
Q20. Write two points of difference between Circuit Switching and Packet 2
Switching
OR
Write two points of difference between Star Topology and Ring Topology.
Q21. a. What shall be the output of the following Python statement? 2
mysubject=”Computer Science with Python “
print(mysubject[-27:-10:2])
b. Write the output of the following code given below:
>>>a=[10,20,30,40,50,60,70]
>>>a[3:5]=[100,1000]
>>>a[3:5]=[10000]
>>>print(a)
Q22. Explain the use of ‘Foreign Key’ in a Relational Management System , 2
Give an example to support your answer.
Q23. i. Write the full forms of following: (i) POP (ii) HTTPS 2
ii. What is the use of SMTP?
Q24. Predict an output of the following: 2
def Disp(A=4, B=’2’ , C=2):
If type(C)==int:
print(A*C*B, end=’#’)
else: Disp()
print(A*B+C)
Disp(3,’*’,’10’)
(i) 22222222 #**10**10**10
(ii) 22222222 #******10
(iii) 22222222 #**10**10
(iv) Error
OR
What shall be the output of the following:
S=”MARSHMELLOW”.partition(‘H’) print(S[::2])
Q25. Differentiate between DDL & DML in SQL with an appropriate example 2
OR
Differentiate between count() and count(*) functions in SQL with appropriate example.
SECTION C
Q26. a. Consider the following tables Bank-Account and Branch 3
Table: Bank-Account
ACode Name Type
A01 Amrita Savings
A02 Parthodas Current
A03 Miraben Current
Table:Branch
ACode City
A01 Delhi
A02 Mumbai
A03 Nagpur
What will be the output of the following statement?
SELECT * FROM Bank-Account NATURAL JOIN Branch
b. Write the output of the queries (i) to (iv) based on the table
Tech_Course given below:
CID CNAME FEES STARTDATE TID
SECTION D
Q31. In Ahmedabad one college is starting up the network between its different wings. 5
There are four buildings named as SENIOR, JUNIOR, ADMIN and HOSTEL as
shown below:
else: print(m)
m=m+’&’
(b) The code given below reads the following record from the table named
STUDENT and display only those records that have marks greater than 75.
Roll No – Integer
Name – String Class
– Integer Marks –
Integer
Note the following to establish connectivity between Python and MySQL
● UserName is root
● Password is root
● The Table exists in a mySQL database named SCHOOL Write
the following missing statements to complete the code: Statement 1:
To form the cursor object
Statement 2: To execute the query that extracts records of those students whose
marks are greater than 75
Statement 3: To read the complete results of the query (records whose marks are
greater than 75) into the object data from the table student in the database.
cool=mysql.connect(host=’localhost’,user=’root’,’passwd=’root’,
database=’school’
mycur=--------------------------------- #Statement 1
print(‘Student marks more than 75’)
--------------------------------------
#Statement 2
data=--------------------------------
5
#Statement 3
[1+4]
for I in data:
p
r
i
n
t
(
i
)
p
r
i
n
t
(
)
Q33. i. What is the advantages of
using a binary files for
permanent storage?
ii. Write a program in Python that
defines and calls the following
user-defined functions
a. insert(): - to accept and add
data of a student to a CSV
file ‘student.csv’ . Each
record consists of a list
with field elements as
studid , name and marks to
store student ids, student
name and student marks
respectively
b. total(): to count the no
of records present in the
CSV file named
student.csv
OR
i. Give any one point of difference between a binary files and CSV file.
ii. Write a program in Python in Python that defines and calls the
following functions:
a. add() – To accept and add data of an employee to a CSV file furdata.csv.
Each record consists of a list with field elements as fid, fname, fprice to
store furniture id, furniture name and furniture price respectively
b. search() – To display the records of the furniture whose price is more
than 10000
SECTION E
Q34. Raghav has been assigned task to create a database named ‘Project_Info’ 4
He also has to cerate the following two tables in the database:
Table:Projects
Field Data Type Constraints
PID Char(5) Primary Key
PName Varchar(20)
StartDate Date
EndDate Date
Table: Employee
Field Data Type Remarks
Eid Char(4) Primary Key
Name Varchar(20)
DOB Date Can not be Null
DOJ Date Can not be Null
Salary Integer
Project Char(5) Foreign Key references PID of Project Table