0 ratings0% found this document useful (0 votes) 89 views10 pagesClass 11 Cs Question Paper
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
Kendriya Vidyalaya Sangathan
Regional Office Varanasi
Session Ending Exam
(MARKING SCHEME)
Class: XI Max Marks: 70
Max Time: 3 Hours
Subject: Computer Science
General Instructions:
(1) All questions are compulsory.
(2) Programming Language: Python 3.x
1. (a) Who developed python language?
Ans: Guido Van Rossum
(1 Mark for correct answer)
(b) What does a cross platform language means? 1
Ans: A cross platform language means it can run well on variety of platform like
Windows, Linux/Unix, Micintosh etc.
(1 Mark for correct answer)
(c) What is difference between a keyword and identifier? 2
Ans: Keyword is a special word that has a special meaning and purpose.
Keywords are reserve words. For example- if, elif, else etc.
Identifier is a user-defined name given to a part of a program i.e. variable, object,
function etc. Identifiers are not reserved. Example- amount, rate, name etc.
(% Mark for each correct definition)
(4 Mark for correct of each)
(d) What is the difference between single line string and multiline string? 2
Ans: Python allows two types of string-
() Single line string- enclosed within single or double quotes ( ‘ or“ )
Example- “Varanasi is a holy city"
(ii) Multiline string- enclosed within triple quotes (“")
Example- “™" This is a
multi line
string “"”
(4 Mark for each correct definition)
(4 Mark for correct of each)
(e) Identify valid / invalid identifier. Give reason in case of invalid.(i) Rate_2
(li) 2nd_Name
(li for
(iv) route##1
Ans: (i) Valid
(ii) Invalid - Can't start with a digit
(ii) Invalid — Can't be same as keyword
(iv) invalid — Can't contain special symbol
(%4 Mark for each correct answer)
(f) Write a program in Python to accept radius and print area of circle.
Ans:
teval(input("Enter radius: "))
area=3.14 * r*r;
Print("Area = ",area)
(2 Mark for correct answer)
(a) What are data types of Python to handle numbers?
Ans: Python provides following data types to handle numbers
() Integers
(i) Boolean
(ii) Float c
(iv) Complex
(2 Mark for correct answer)
(b) Write output of the followings.
x=10 uae
y=5 ic
for i in range(x — y * 2):
print" % *, i)
‘Ans: No output
(3 Mark for correct answer)
(c) Rewrite the code after removing the error. Underline the corrections.
weather='raining’tes, ¢
ifweather='sunny’:
print(‘Sunny”) on
elif weather='snow’ s
print(“Snow’)
else
print(weather)
Ans:
weather='raining’
if weather=='sunny’:
print(‘Sunny”)
elif weather=='snow’:
print(‘Snow’)
else:
print(weather)
(% Mark for each correction)
(d) What is the significance of break and continue statements.
Ans:
(1 Mark for each correct definition)
(e) Write a program in python to print the following-
54321
5432
543
54 :
5
Ans:
for i in range(1, 6):
for j in range(5, i
print(," ", end=' ')
print()
(3 Mark for correct answer) fe
(f) What will be the result of followings expressions * ™
() “Python* [1] arwatnion sto hem
(ii) lenCawesome’) qiaeteiiio e(iii) "Honesty’ [:4]
(iv) “apple’ in “pineapple”
(v) “King” * 3
(vi) ‘DELHI [ : 1)
Ans:
ay
(i)7
(iil) ‘Hone’
(iv) True
(v) KingKingking
(vi) IHLED
(44 Mark for each correct answer)
3. (a) What is ZeroDivisionError? 1
Ans: ZeroDivisionError is an exception (run time error) occurs when we try to
divide any number by Zero.
(1 Mark for correct answer) :
(b) Name the method to add new item in the list.
Ans: append ()
(1 Mark for correct answer)
(0) IFL1=[1,2,3,4] and L2=[4,5,6,7]. What is the output of the following
L2.extend(L1)
L1.remove(4)
print(L1)
print(L2)
Ans: [1, 2, 3]
(4, 5, 6, 7, 1,2, 3, 4]
(1 Mark for each correct line of output)
(d) What is list? How it is different from tuple? Is list mutable?
‘Ans: List is one of the most frequently used sequence and very versatile data
type used in Python which contains elements in side square bracket [].
List is different from tuple as we can change the items of list but not in tuple.List is mutable.
(4 Mark for correct answer of list)
(1 Mark for correct difference)
(% Mark for correct answer of mutable or not)
(e) What is the output produced by given code: 2
d1=({5:[6,7,8],6 : (1,2,3)}
print(d1[5])
print(d1[6})
Ans: [6, 7, 8]
(1, 2, 3)
(1 Mark for correct line of output)
(f) Write the difference between accessing items through square bracket [ ] and
get() method of dictionary. 2
Ans: Key can be used either inside square brackets [ ] or with the get() method.
The difference the two is square brackets [ ] retums KeyError when key is not
found whereas get() retums None instead of KeyError, if the key is'not found.
(2 Mark for correct answer)
|. (a) What is the function of memory? What are its measurement units?
Ans: Memory temporarily holds the data and information during processing.
Measurement units of memory are as follows- a
1 Byte = 8 Bit
14 KB = 1024 Bytes
4MB = 1024 KB
4 GB = 1024 MB
4 TB = 1024 GB
(1 Mark for correct definition)
(1 Mark for correct measurement units)
(b) Convert the followings ~
(i) (43)0= (72 ae:
nse!a
Gi) (832)e = (?)16
Ans:
(i) (43)10 = (101011)2
(li) (632)s = (15A)16
(1 Mark for each correct conversion)
(c) Verify the following using truth table. 2
X+XY=X
Ans:
Here X+XY is same as X
Hence proved X + XY = X
(1 Mark for correct answer)
(d) Draw a logic circuit for the following expression.
ABC +C'B
Ans:
(1% Mark for logic circuit)
(4% Mark for correct labelling)
(©) What is PCB? What is its role?
‘Ans: PCP stand for Process Control Block. It maintain information needed to
keep track of a process. PCB contains information like process ID, process state,
process privileges, program caunter etc. - 6
(2 Mark for correct answer) 1
(@) Differentiate between DDL and DML commands. 2
Ans: DDL stands for Data Definition Language contains statements that can
define or affect the structure of data. For example- Create, Alter etc.
DML stands for Data Manipulation, Language contains statements that is used to
manipulate data. For example- Insert, Delete, Update etc.(2 Mark for correct difference)
OR
(1 Mark for each correct definition) 1:
(b) In a Bank's database, there are two tables ‘Customer’ and ‘Transaction’ as
shown below. Consider these tables while attempting the questions given
below- 5
Table: Customer
‘Acc_No | Cust_Name | Cust_City | Cust_Phone | Open_Bal
2101001 | Sunita ‘Ambala 9710557614 [10000 |
2201002 |Sandhya | Patna | 6223545233 | 15000
2301003 | Vivek New Delhi | 9972136576 | 13000
2401004 | Meena [New Delhi | 9321305453 | 10000
Table: Transaction
[Trans_id |Acc_No | Transaction_Type | Amount
Tr001 2301003 | Credit 15000
[rroo2 [2201002 [Creat +—«| 20000'~—=s*Y|
‘Tr003 2101001 | Debit 3500
Tr004 —~(| 2301003 | Credit 26000
Troos [2801003 | Credit - [24000 |"
(i) Write a query to display customer's name who has withdrawn the money.
(i) Write a query to display customer's name along with their transaction details.
(iy Write a query to display customer's name who have not done any transaction
yet.
(iv) What will be the degree and cardinality in the Cartesian product of the above
given tables. _ :
(W) Write output for the given query- -
SELECT C.ACC_NO; TRANSACTION_TY#E, SUM/AMOUNT) FROM
CUSTOMER C, TRANSACTION T WHERE C.ACC_NO=T.ACC_NO
GROUP BY C.ACC_NO HAVING TRANSACTION_TYPE="Credit’,
Ans: f
() SELECT C.CUST_NAME |
FROM CUSTOMER C, TRANSACTION T'"®.2” 5
WHERE C.ACC_NO=T.ACC_NO AND P4RANSABTION_TYPE="Debit";
Si 52a Cl2
(il) SELECT C.CUST_NAME, T.*
FROM CUSTOMER C, TRANSACTION T
WHERE C.ACC_NO=T.ACC_NO ;
(iii) SELECT C.CUST_NAME
FROM CUSTOMER
WHERE ACC_NO NOT IN (SELECT ACC_NO FROM TRANSACTION);
(iv) Degree=9
Cardinality=20
(¥) Output for the given query is-
ACCNO
[2201002 —«| 2
2301003 6!
(1 Mark for each correct query)
(1 Mark for correct output)
30000
35000
| SUM(AMOUNT) |
(a) What is the difference between Primary Key and Foreign Key?
Ans: Primary key.is a-key which uniquely identify.a segerd where as Foreign key
is a key which is also present in related table most often as primary key.
(2 Mark for correct difference)
sR
(1 Mark for each correct definition)
(b) Answer the question baged on the tabla given below:
“Ne
Table Name: Students arty
2
Culumn Name __| Data Type, _| Si: i
Roll_No- Integer 4
Name Varchar 20
Stipend Integer 7 Stipend is greater than 0
Stream Varchar 15 Not Null |
Grade Varchar 1
(i) Write the SQL ogmmang, faycppate the above table with constraints.
levant information, in the table student
(i) Insert 2 records with
(iil) Display all the ré6oi
‘Student.
(iv) Delete the Student Whose Roll no is 100.~
(\) Change the Stream of Student to ‘Computer’ Whose Roll no. is 588.
(vi) nae one column email of data type VARCHAR and size 30 to the table
st L
Ans: oe —
(i) CREATE TABLE Student aa
(Roll_No INTEGER(4) PRIMARY KEY, vor
Name VARCHAR(20) NOT NULL,
Stipend INTEGER(7) CHECK (Stipend>0),
Stream VARCHAR(15) NOT NULL, ara
Grade VARCHAR(1));
(ii) INSERT INTO Student(Roll_No, Name, Stipend, Stream, Grade) *”
VALUES(10, “Alok Kumar Sahu", 100, “Science; “A’)
INSERT INTO Student(Roll_No, Name, Stipend, Stream, Grade),
VALUES(11, “Ankita Singh”, 150, “Science”, “A")
(iii) SELECT * FROM Student;
(iv) DELETE FROM Student WHERE Roll_No=100;
(v) UPDATE STUDENT SET Stream="Computer” WHERE Roll_No=536;
(vi) ALTER TABLE Student ADD Email VARCHAR(30);
(1 Mark for each correct query)
(a) What is cookie? . 1
‘Ans: Cookie are small jsiece of'data send from website and sf8fe'in users web
browser in the form of text file.
(1 Mark for correct answer)
(b) Describe the following terms-
( Cyber Bullying
(i) Cyber Stalking
Ans: (i) Cyber Bullying is when someone, typically tens, bully or tiarasé‘others
on social media sites. Harmful bullying behavior can iitclude posting rumors,
threats, sexual remarks etc” *
(ii) Cyber Stalking is théuss of the Internet or otffét electronic means to stalk or
_ rowers ge i
harass an individual, aroup,proreeizaton. *
~ 1
¥.
(1 Mark for each correct answer) -
(c) What is firewall?
Ans: Firewall is a mechanism to prevent usin network users from
rival +) ,
whl
accessing private networks connected to the internet or intranet.
an om eaor*
\ vas
2“(Nite tee corteet answer)
SO coe Trojan horse and Worm. 2
‘sarmis,a $elf-replicating program which eats up the entire disk space or
\emnory Aworm keeps creating its copiés until all the disk space or memory is
pela)
A Trojan horse is a program that appeafs harmless but actually performs
* matiefous functions sug as deloting or damaging files.
(2@fark for correct difference) «
OR
(1 Mark for each correct definition)
c
(e) Explain the following terms- 4
(i) Phishing
(ii) Eavesdropping
(ili) Spyware
(iv) DoS Attack
Ans: .
() In.-Phishing creator send fake emait in the hope of gaining personal/financial
information.
(ii) Eavesdropping is unauthorized monitoring of others communication.
Gi) Spyware is a type of goftware that gathers information by monitoring key
presses on a user's keyboard and activity or information is send to the person
who sent the spyware.
(iv) Dos attack isdone,by, greating.a, lange. number of fake request to the server
so that it reaches the limits. @f service angaenies js unavailabiefo the actual
bent
users.
i vein erttio set
(1 Mark for each'eertect angurar) Bile oy
)
—00000—-
) howten beshoriven