You are on page 1of 7

KENDRIYA VIDYALAYA SANGATHAN, GURUGRAM REGION

SESSION ENDING EXAMINATION[2018-19]

Subject :Computer Science(083) (Theory)-XI

Time Allowed: 3:00 hrs. Max. Marks: 70

Note:
• All the questions are compulsory.
• Programming Language Python.
• The paper have four section , Section A, Section B, Section C, Section D
MARKING SCHEME [2018-19]

Section-A
1. (a) What does a cross platform language mean? 1
Ans It means that it can run on a variety of platforms like windows,mac,linux.
(1 Mark for correct definition)
(b) Which of the following are valid and invalid strings in python? 2
(i) “python” (ii) ‘python’ (iii) “python’ (iv) {python}
Ans Valid- (i) “python” (ii) ‘python’
Invalid- (iii) “python’ (iv) {python}
( ½Mark for each)
(c) What are Identifiers? 1
Ans They are user defined names given to a part of program. Eg
variable,object,function etc.(1 Mark for correct definition)
(d) What is the difference between == and =? Explain with example. 2
Ans == is comparison operator whereas = is assignment operator.
(1 Mark for difference + 1 Mark for correct example)
(e) What are mutable and immutable data types? Give two examples of each 2

Ans Mutable: values can be changed in their place e.gLists,Dictionaries


Immutable: values cannot be changed in their place e.gTuples,Strings
(1 Mark for difference + 1 Mark for correct example)
(f) What is None literal in python? 1
Ans Absence of value or literal that has not yet been created.
(1 Mark for correct definition)
2 a) Rewrite the following code fragment using for loop: 2
num=20
while(num > 0):
count += 1
sum += num
num -= 2
if(count == 10):
print(sum//count)
break
Ans for num in range (20,0,-2):
count += 1
sum += num
if(count == 10):
print(sum//count)
Page 1 of 7
break
(2 Marks for correct answer )
b) Consider the following Python program: 2
n=int(input(“Enter N:”)
i=1
sum=0
while(i<n):
if(i%2==0):
sum = sum+i
i=i+1
print(sum)
What will be the output when the input value is (i) 5 (ii) 0
Ans (i) 6 (ii) 0
( 1 mark for each correct answer)
c) Write a Python program to read an integer and find its reverse. 3
Note: if user enter 1234 than the output should be 4321.
Ans Number = int(input("Please Enter any Number: "))
Reverse = 0
while(Number > 0):
R = Number %10
Reverse = (Reverse *10) + R
Number = Number //10
print(Reverse)

or
Any other correct solution

1 Mark for input


1 Mark for using while loop syntax
1 Mark for right logic

d) Write a program in python to calculate and print roots of a quadratic equation: 3


ax2 + bx +c = 0
Note: the program should take values of a, b, c and print if the roots are real,
imaginary or equal.
Ans import math
print("Quadratic function : (a * x^2) + b*x + c")
a = float(input("a: "))
b = float(input("b: "))
c = float(input("c: "))

r = b**2 - 4*a*c

if r > 0:
num_roots = 2
x1 = (((-b) + math.sqrt(r))/(2*a))
x2 = (((-b) - math.sqrt(r))/(2*a))
print("There are 2 roots: %f and %f" % (x1, x2))
elif r == 0:
num_roots = 1
x = (-b) / 2*a
print("There is one root: ", x)
else:
num_roots = 0
Page 2 of 7
print("No roots, discriminant < 0.")
exit()

or
Any other correct solution

1 Mark for input


1 Mark for appropriate use of if elif
1 Mark for right logic

e) Write aprogram in Python to print the sum of the following series: 4


s= 1 + x + x2 + x3 +……. + xn
Ans n=int(input("Enter the number of terms:"))
x=int(input("Enter the value of x:"))
sum=1
for i in range(2,n+1):
sum=sum+(x**i)
print("The sum of series is",round(sum,2))

or
Any other correct solution

1 Mark for input


1 Mark for using for loop syntax
1 Mark for right logic

3 (a) Differentiate between a syntax error and a semantic error with example. 2
Ans Syntax error: occurs when rules of programming language are violated.
e.gfori in range (0,2) :
Semantic error: occurs when statements are not meaningful.
e.ga+b=c
(1 Mark for difference + 1 Mark for correct example)
(b) Which arithmetic operator(s) can be used with strings? 1

Ans + and * ( ½ mark for each)


(c) Find the output of the following code: 3
x= “hello world”
print (x[ : 2], x[ : -2], x[-2 : ])
print (x[ 6 ], x[2 : 4])
print (x[ 2 : -3], x[ -4 : -2])
Ans he helloworld
w ll
llo wo or
(1 mark for each correct line of output)
4 a) Write the name of the function used to calculate the length of list and tuples? 1
Ans len( )
(1 mark for correct answer)

Page 3 of 7
b) Write a program in python to find maximum element in the list entered by the 2
user.
Ans lst = []
num = int(input('How many numbers: '))

for n in range(num):
numbers = int(input('Enter number '))
lst.append(numbers)

print("Maximum element in the list is :", max(lst))

1 mark for finding minimum element


1 mark for finding maximum element
c) Write a program in python to create a dictionary containing names of competition 3
winner students as keys and number of medals as values.
Ans n = int(input(“How many students”))
winners = { }
for a in range(n):
key = input(“Name of the Student”))
value = int(input(“No of wins”))
winners[key] = value
print(winners)

or
Any other correct solution

1 mark for input


1 mark for correct logic
1 mark for correct syntax

Section-B
5 a) What is the difference between RAM and ROM? 1
Ans A read-only memory (ROM) and a random-access memory (RAM) chip: ROM
can hold data without power and RAM cannot.
(1 mark for correct answer )
b) What is a language processor? Write the name of two language processors. 2
A language processor is a software program for processing program code to
machine code.Eg, Compiler, Interpreter
(1 mark for correct definition)
(1 mark for naming language processors)
c) How many possible code groups can be formed by ASCII code (ASCII is 1
a 7 bit code) ?
Ans 27 = 128

(1 Mark for correct answer)


d) Convert the following: 2

(i) (4A)16=(__________)2
(ii) (106)10=(_______)8

Ans (i) 01001010

Page 4 of 7
(ii) 152

1 mark for each correct answer

e) Name any two basic logic gates. 1


Ans (1/2 mark for each correct gate)
f) Write the expression for the following logic circuit: 2

Ans F= w.x’ + y’.z


g) What are the advantages of cloud computing? 1
Ans Rather than purchasing expensive systems and equipment for your business,
you can reduce your costs by using the resources of your cloud computing
service provider. You may be able to reduce your operating costs because: the
cost of system upgrades, new hardware and software may be included in your
contract.
( 1 mark for correct answer)
Section-C
6 a) What is the difference between degree and cardinality of table? Explain with 2
example.
Ans Degree: Number of Columns
Cardinality : Number of rows

( 1 Mark for correct difference)


( 1 mark for example)
b) Write SQL command for (i) to (vii) on the basis of the table SPORTS 6

Table: SPORTS
Studno Class Name Game1 Grade1 Game2 Grade2
10 7 Sameer Cricket B Swimming A
11 8 Sujit Tennis A Skating C
12 7 Kamal Swimming B Football B
13 7 Venna Tennis C Tennis A
14 9 Archana Basketball A Cricket A
15 10 Arpit Cricket A Atheletics C

(a) Display the names of the students who have grade ‘C’ in either Game1 or
Game2 .
(b) Display the names of students getting grade ‘A’ in Cricket.
(c) Display the games taken up by the students, whose name starts with ‘A’.
(d) Add a new column named ‘Marks’ of int type in the sports table.
(e) Insert a new row in the table with the following data (16, 10, “Mohan”,
“Cricket”, “B”, “Tennis”, “A”)
(f) Delete the row from the student table whose Studno is 12.
Ans a) Select Name from student where grade1=’C’ or grade2=’C’;
b) Select name from student where Game1= “Cricket” and grade1= “A”;

Page 5 of 7
c) Select name from student where name like “A%”;
d) Alter table sports add marks int;
e) insert into student values (16, 10, “Mohan”, “Cricket”, “B”, “Tennis”, “A”)
f) delete from student where Studno is 12;
( 1 mark for each correct command)
c) Differentiate between delete and drop command with example. 2
1 mark for Correct definition + 1 mark for example
d) Write SQL command to create the following table STUDENT with constraints. 2

Field Name Type Width Constraints


Rollno int Primary key
Stud_Name varchar 25
DOB date
Subject varchar 24
Marks int
Ans Create table student ( Rollno int Primary Key, Stud_Name varchar(25),DOB
date,Subject varchar(24),Marks int);

(2 marks for correct command)

e) What is an equi join in SQL? 1


Ans An equijoin is a join with a join condition containing an equality operator. An
equijoin returns only the rows that have equivalent values for the specified
columns.
( 1 mark for correct answer)
f) What is the use of indexes in databases? 2
Ans Indexes are used to quickly locate data without having to search every row in a
database table every time a database table is accessed. Indexes can be created
using one or more columns of a database table, providing the basis for both
rapid random lookups and efficient access of ordered records.
( 2 marks for correct answer)
Section-D(SLE-1)
7 a) What is cyber stalking? 1
Ans The repeated use of electronic communications to harass or frighten someone,
for example by sending threatening emails.

( 1 Mark for correct answer)


b) What do you understand by identity theft? 1
Ans Identity theft, also known as identity fraud, is a crime in which an imposter
obtains key pieces of personally identifiable information, such as Social Security
or driver's license numbers, in order to impersonate someone else.
(1 Mark for correct answer)
c) How is phishing different from pharming? 2
Ans Phishing and pharming are two different ways hackers attempt to manipulate
users via the Internet. Phishing involves getting a user to enter personal

Page 6 of 7
information via a fake website. Pharming involves modifying DNS entries, which
causes users to be directed to the wrong website when they visit a certain Web
address.
(2 Marks for correct difference)
d) Explain the terms spyware and malware. 2
Spyware is software that aims to gather information about a person or
organization, sometimes without their knowledge, that may send such
information to another entity without the consumer's consent.
Malware" is short for malicious software and used as a single term to refer to
virus, spy ware, worm etc. Malware is designed to cause damage to a stand
alone computer or a networked pc.
( 1mark for each correct definition)
e) What is cybercrime? How can you report it? 2
Cybercrime is defined as a crime in which a computer is the object of the crime
(hacking, phishing, spamming) or is used as a tool to commit an offense.
Report it firstly to the parents, school authorities and than to police
( 1 Mark for definition)
( 1mark for correct reporting method)

f) What is eavesdropping? 2
Eavesdropping is the unauthorized real-time interception of a private
communication, such as a phone call, instant message, videoconference or fax
transmission.
(2 marks for correct answer)

Page 7 of 7

You might also like