XIComp SC S E 89-Merged-Merged
XIComp SC S E 89-Merged-Merged
XIComp SC S E 89-Merged-Merged
2. (a) What is sorting? Write a program to sort a list by using insertion sort. 4
(b) Write a python program to find factorial of a number. 3
(c) Rewrite the following code in python after removing all syntax error(s).
Underline each correction done in the code. 2
Val= int(rawinput(“Value”))
Adder= 0
for C in range(1,Val,3)
Adder += C
if C%2 = 0:
Print C*10
Else:
Print C*
print Adder
(d) Write a program to print a pattern like: 2
4321
432
43
4
(e) Write a program to input a number and test if it is a prime number or not. 3
(f) Write program in python to find reverse of a number. 3
(g) Write a program to count and display the number of digits and the number
of alphabet present in a string. 3
3. (a) What is the difference between Local and Global variable? Give suitable
code as example. 2
(b) What is Token? Define any two type of token with example. 2
(c) What is dictionary? Write a command to create a dictionary and delete
an element from dictionary. 2
(d) What will be the output of following code? 2
tup1 = (“comp sc”, “info practices”, 2017, 2018)
tup2 = ( 5, 11, 22, 44, 9, 66)
print(“tup1[0]:”, tup1[0])
print(“tup2[1:5]:”, tup2[1:5])
(e) Write the output of following: 2
list = [‘I’,’N’,’D’,’I’,’A’]
print(list[0:3])
print(list[3:]
print(list[:])
print(list[1:-2])
4. (a) What is the difference between syntax error and semantics error? 2
(b) What is operator? 1
(c) Define flowchart. 1
(d) What is debugging? 1
5. (a) What is the purpose of ALTER TABLE command? How is it different from
UPDATE command? 2
(b) What is primary key? How is it different from candidate key? Explain with
the help of suitable example. 2
(c) Explain the purpose of DDL and DML statement. Give two examples of
each. 2
(d) Define NoSQL database. Write two advantages and two disadvantages of
MongoDB. 3
6. (a) Write a MySQL command to create the table STOCK including its
Constraints. 3
Table: STOCK
Field Type Size Constraint
Book_Id Varchar (6) Primary Key
Book_Name Varchar (25)
Price Integer
Type Varchar (15)
Quantity Integer Not Null
(b) Consider the table Flight given below, write command in SQL for (i) to (ii)
and output for (iii) to (iv): 3
Table: Flight
Flight_No Origin Destination Seats FlightDate Rate
1005 Varanasi Nepal 275 12-Dec-07 3000
2785 Delhi Kerala 290 17-Jan-08 5500
6587 Mumbai Varanasi 435 19-Feb-08 5000
1265 Varanasi Nepal 200 02-Jan-08 5400
4457 Delhi Lucknow 150 22-Feb-08 4500
6856 Varanasi Mumbai 180 03-Mar-08 6000
Que: 2
a) Define keyword with example. [1]
b) What are variables? How we can create variable in python give examples. [1]
c) The following code is not giving desired output. We want to input value as 20 and obtain
output as 40.Identifiy the problem and do the required correction in the code [1]
x =input (“Enter number :”)
y = x*4
print(y)
d) What will be the output of the following code? [1]
x=45
y=x+1
x=20,y+x
print(x,y)
e) Predict the output? [2]
x =10
x= x+15
x=x-5
print(x)
x,y = x-2 , 22
f) Define identifiers. Identify the valid and invalid identifiers in the following list. [2]
i) x_y_z ii) x_abc@1 iii) 1abc_d3 iv) continue
g) Write a program in python to obtain the length and breadth of rectangle and find its area.[2]
h) Write a program in python to obtain the principal amount, rate and time and calculate the
compound interest..[2]
Que:3
a) Explain the use of // (floor division) operator and = = operator with example.
[1]
b) Explain mutable and immutable data types in python. [1]
c) Identify the type of following literals? [2]
i) 45.789 ii) 23789 iii) “True” iv) 0XFACE
d) Explain implicit and explicit type casting . [2]
e) What are comments? How comments are specified in python give example .[2]
f) Write the equivalent python expression for the following expressions. [2]
i) √a2+b2+c2 ii) (p + q) / (r+s)4
i. For the first 100 callls the minimum bill amount is 100 Rs.
ii. For the next 50 calls Rs. 0.40 per call will be charged extra.
iii. For the next 50 callls Rs. 0.50 per call will be charged extra.
iv. For the calls beyond 200 Rs. 0.60 per call will be charged extra.
c) Write a program in python to find the roots of a quadratic equation ax2+bx+c. [3]
d) Write a program in python to perform arithmetic operations (+, - , *, /, %). [2]
e) Write a program in python to enter a number and check whether it is positive or
negative. [2]
Que:5
a) Write a program in python to enter a number and check whether it is prime number or
not. [4]
b) Write a program to find the sum of even numbers and odd numbers between 1 to n
separately. [3]
c) Write a program in python to print the following series. [3]
2 5 10 17 26 37
d) Define what are iteration statements .Write the syntax of while loop . [2]
e) Write the following program using while loop. [2]
for I in range(1,16):
if i%3 = =0 :
print(i)
Que:6
a) Explain different types of errors in python with examples. [3]
b) Write the differences between testing and debugging. [1]
Que:7
a) Write a program that reads a string and change the string in uppercase. [2]
b) What is the use of isupper( ) and isalnum( ) methods in python explains with
example.[2]
c) What is string slice? find the output of following python code : [2]
Q.1 (a) What is the difference between an Interpreter and a Complier. [2]
(b) What is the function of memory. What are its measuring units. [2]
(c) What is an operating system What is its roles. [2]
(d) Write a short note on mobile processor. [2]
(e) Draw block diagram for basic computer organization. [2]
Q.3 (a) State and verify Absorption law in Boolean Algebra. [2]
(b) Prove algebraically X.Y+X‟Z+YZ=X.Y+X‟Z [2]
(c) Draw logic circuit using NOR gate only (X+Y)(X‟+Y)(X‟+Y‟) [2]
(d) Write the dual form of (A.1)+(A+0+A‟) [2]
ICode Brand
101 Videocon
202 Videocon
303 Sony
404 Dell
Q.6(a) Write an SQL query to create a table “SPORTS” with the following structure: [2]
(i) Write a query to add a column „Price‟ with data type integer.
(ii) Suggest suitable candidate key for above given table.
**************************************************************************
KENDRIYA VIDYALAYA SANGATHAN, TINSUKIA REGION
HALF YEARLY EXAMINATION 2018-19
Class: XI
Subject: COMPUTER SCIENCE
Set: A
Maximum Marks: 70 Time Allotted: 3 hours
Important Instruction:
1. Programming Language: Python.
2. All questions are compulsory.
Q1.
A Write a Python statement to accept your name as input from a user and store it in a variable 1
‘NAME’.
B Find and write the output of the following Python program code : 1
i). >>> 25 != 25
ii). >>> False + 10
C Write the data type of variables that should be used to store: 1
i). Marks of a student.
ii). Grades of student (Grade can be ‘A’ or ‘B’ or ‘C’)
D Write the type of Python tokens (keywords and user defined identifiers) from the following : 2
i). For
ii). elif
iii). list
iv). break
E Differentiate between ‘/’ and ‘//’ operators of Python with the help of suitable examples. 2
F Find and write the output of the following Python program code : 2
print (3**2 + 18/9 - 3**4+1)
print ((4 - 16)/8 + (2**4+3))
G Write a Python program to calculate the compound interest. The principal, rate of interest and time 3
must be entered by the user.
(Formula: Compound Interest = Principal (1 + Rate/100)Time )
Q2.
A How many asterisks does the following code fragment print? 1
a=3
while a < 20:
print('*', end='' '')
a += 1
B Rewrite the following Python code after removing any/all syntactical errors with each correction 2
underlined:
Len = 12
for var on range( 1, len):
if var % 2 = 0 :
Print(“Even Number!”)
print(‘END of Program!!”)
C Write a Python program that allows the user to enter exactly five integer values. The program then 3
prints the sum and average (arithmetic mean) of the values entered.
D Write a Python program to print the following pattern using for loop: 3
$
$$
$$$
$$$$
$$$$$
E Consider the following Python code fragment: 4
if i < j:
if j < k:
i=j
Page 1 of 3
else:
j=k
else:
if j > k:
j=i
else:
i=k
print("i =", i, " j =", j, " k =", k)
What will the code print if the variables i, j, and k have the following values?
i). i is 5, j is 6, and k is 7
ii). i is 4, j is 7, and k is 5
iii). i is 8, j is 3, and k is 7
iv). i is 2, j is 7, and k is 1
Q3.
A Differentiate between Tuples and Lists with the help of Python examples. 2
B Write a Python program to perform the Linear Search operation on the following given list: 2
[25,12,28,56,13,19,25]
C Find and write the output of the following Python code : 2
list1 = [10,20,30,40,50]
start = 1
sum = 0
for i in range (start,3):
sum = sum + list1[i]*10
print (i, ":", sum)
D Write the output for the following Python codes. 3
A={1:100,2:200,3:300,4:400,5:500}
print (A.items())
print (A.keys())
print (A.values())
E Create a list that contains the names of 5 students of your class: Write Python codes 4
i). Ask the user to input one name and append it to the list.
ii). Ask user to input a number. Print the name that has the number as index
(Generate error message if the number provided is more than last index value).
iii). Ask the user to type a name. Check whether that name is in the list. If exist, delete the name,
otherwise append it at the end of the list.
iv). Create a copy of the list in reverse order and print the new list.
Q4.
A What is the output of the following? 1
print('INDIA'.capitalize())
B Differentiate between Syntax Error and Run-Time Error. Also, write a suitable example in Python to 2
illustrate both.
C Write a Python program to find and display those place names, in which there are more than 5 2
characters.
For example :
If the list PLACES contains ["Miao", "Tawang", "Chabua", "Kimin", "Imphal", "Dimapur"]
The following should get displayed :
Tawang
Chabua
Imphal
Dimapur
D Write a Python program to check whether a user inputted string is palindrome or not. (Example of 3
Palindrome string: MADAM i.e. a word/sequence that reads the same backwards as forwards.)
E Find and write the output of the following Python code : 4
my_string = 'Tinsukia'
print(my_string[:3])
for i in range(len(my_string)):
print(my_string[i].upper(),end="@")
print()
Page 2 of 3
print (my_string)
print (my_string[3:6])
Q5.
A How RAM (Random Access Memory) is different from ROM (Read Only Memory). 1
B Convert the following: 2
i). (101011)2 to its Decimal equivalent.
ii). (125)10 to its Binary equivalent.
C State and proof the DeMorgan’s Theorem using truth table. 3
D Briefly explain all the functional units/components of a Computer System with help of a diagram. 4
Q6.
A What is the practice of using a network of remote servers hosted on the Internet to store, manage, 1
and process data, rather than a local server or a personal computer is known as?
B ‘Hardware is of no use without software and software cannot be used without hardware.’ Explain. 2
C Explain the following terms: 3
i). Compiler
ii). Application Software
iii). Interpreter
D Find and write the output of the following Python code : 4
x= [1, 2, [3, "KVS", 4], "KV"]
print(x[0])
print(x[2])
print(x[-1])
print(x[0:1])
print(2 in x)
print(x[0]==8)
print(len(x))
x.extend([12,32,4])
print(len(x))
Page 3 of 3
K e n dt’! / a Vid/ B]a ya Sangathan: Raipur Region
SP. S STo Endlng Examlnatlon - zo19
Subject c g= pMter Sctence {Theory) 0B3
Time : 03 Hn. MM : 70
General [ Fl s suct ion:
1 This QM S- t a a l'F £D0L6ins Tota16 Questions.
2. Attempt all questions.
ie e ri e uesti n n bR b e tte t nits
reve Se =0
dgitu nu mXl0
rnum=fnum/10
prinroe R e nu is )
y Fit g ygmmzlnd to reverse the given tuple
y = (15, 110,115, 12O)
I f0llowing series:
(F)
I1
111
1111
Scanned by CamScanner
(C) WriLe any two difference between LIST and TUPLfi5 Ig python7 _ Z_
{D) Why exception handling equired 7 ./.
(E} Convert the following: 2
1. (FACE), a to binary
(F) Write a python program that reads a string and Check whether }t iS
a palindrome strlng or not7
3. {A) What are state transition diagramsT 1
(B) What is the role of CPU of a mobile system7
(C) Draw the LogiE CTrEuit for Boolean expreSsiOf\ tA+By.(C+D) usi f lg
only NOR gate :
(D) State and Prove Both DeMorgan’s Laws MSIn g Trut h Tdb!^
(E) What Is cloud computing ?
(F ) ExamiI tP- the foIiowin g code a nd Blvd’- t he answer of given below 3
question:
Numlist = eval(input {°Enter list :"))
odds=evens=0
length=Ien(numlist)
white pos<length:
il numfist [poz]R2=' O:
evens=evens+1
else:
odds•adds+1
tf odds>evens:
prlnt(" Balanced oddity*)
Ill what in this progwm calculating ›
(b) What does the progr am fOr the USt [I,S,Zm3,g,6,9j 2
(‹) What does the program print for the list [Z,b,2,3,6,6,9] 7
how can we fix ahis 2
4. (n) What will be the output of following code7
print{x,Y)
(B) Rg-Wri te the code fragmenu using for loop:
while x«5:
x=x+1
rint (x)
state output produced by the following code statement»
81//5.0
Page z of4
Scanned by CamScanner
Consider the following python
N = int(IDput{° Enter N:"))
i=i
sum-a
hTle i< N ;
SUm- sum+1
i-i+1
PSI I (sum)
(a) What is the output when Input values is 57
(b) What is the nutput when Input vslues is 07
(E) StatR output of the following python statement:
*+> string =’heIln‘
(a) >>>string,isIower()
(b) >>>string.isspace()
(F) Write a program to sort a sequence using insexion wn:
aList - i15,6,13,22,3,5Z,2]
5 |A) Define NoSQL database7 1
(B) What do you mean by comments in MySQL7 1
(C) Write one advantage and one disadvantage of NoSQL daFa6ase7 f2 j
.\p\ ENI at do vou mean by Primary Key and Csndfdate Keys7 2 /
(E) consider Che following table names EXAM with details of marks. 4
wriEe command of MyOl for (i) to (iVj and Output far (v) to (Vii). +
Table: EXAM.
j t{qo 5Name ) Percentage Clsecdon Stream
RD01 Sushant 9D.2 12A Science
R0o2 VaidyanaCh 80.5 13B Humanities
R003 Miara 68.9 12B Sci+nce
R004 Nlara t 96.D 12A Commerce
RODs Shin§ni | 88.9 1ZD Commerce
XI-CS./R
Scanned by CamScanner
Scanned by CamScanner
SHREE VALLABH ASHRAM’S MCM KOTHARI INTERNATIONAL GIRLS’
RESIDENTIAL SCHOOL, KILLA PARDI
PERIODIC TEST – II, 2018-19
CLASS XIS COMPUTER SCIENCE (083) M.M 70; TIME 3 HRS
22/10 /18
Instructions:
1|Page
Q14. What would following expression return? 2
(a) “Hello World”.upper().lower()
(b) “Hello World”.find(“Wor”,1,6)
(c) “Hello World”.find(“wor”)
(d) “123FGH”.isdigit()
Q15. Suggest appropriate functions for the following tasks: 2
(i) To check whether the string contains digits
(ii) To capitalize all the letters of the string
(iii) To remove all white spaces from the beginning of a string.
(iv) To check whether all letters of the string are in capital letters.
Q16. What will be the output produced by following code fragments: 2
y=str(123)
x=”hello” * 3
print(x,y)
x=”hello”+”world”
y=len(x)
print(x,y)
Q17. What will be the output produced by following code fragments: 2
x=”hello”+”to Python”+”world”
for char in x:
y=char
print(y+”:”,end=” “)
Q18. Given a string S=”CARE DIEM”. If n is length/2 (length is the length of 2
the given string), then what would following return:
(i) S[:n]
(ii) S[n:]
(iii) S[n:n]
(iv) S[1:n]
Q19. What is the result of the given statement: 2
S=”987654321”
print(s[-1],s[-3])
print(s[-3:],s[:-3])
print(s[-100:-3],s[-100:3])
Q20. Find the errors: 2
S=”PURA VIDA”
S1=S[:5]
S2=S[5:]
S3=S1*S2
S4=S2+’3’
S5=S1+3
Q21. What do you understand by mutability of lists, briefly 2
Q22. What are list slices? What for can you use them? 2
Q23. What are the difference between lists and strings? 2
Q24. Given two lists 2
L1=[“this”,”is”,”a”,”List”]
L2=[“this”,[“is”,”another”],”List”]
Which of the following will cause an error and why
(i) L1.upper()
(ii) L1[3].upper()
(iii) L2[1][1].upper()
Q25. Create the table Employee table based on the following table: 2
Column
ID First Name Last Name Dept_ID
Name
Data Type Int varchar Varchar int
Length 8 25 25 8
2|Page
Q26. Write SQL commands for the following on the basis of given table 4
STUDENT:
Table: STUDENT
No Name Stipend Stream AvgMark Grade Class
1 Karan 400.00 Medical 78.5 B 12B
2 Divakar 450.00 Commerce 89.2 A 11C
3 Divya 300.00 Commerce 68.6 C 12C
4 Arun 350.00 Humanities 73.1 B 12C
5 Sabina 500.00 Nonmedical 90.6 A 11A
6 John 400.00 Medical 75.4 B 12B
7 Robert 250.00 Humanities 64.4 C 11A
8 Rubina 450.00 Nonmedical 88.5 A 12A
9 Vikas 500.00 Nonmedical 92.0 A 12A
10 Mohan 300.00 Commerce 67.5 C 12C
3|Page
KENDRIYA VIDYALAYA SANGATHAN RANCHI REGION
HALF YEARLY EXAMINATION 2019-20
SUB: COMPUTER SCIENCE, CLASS - XI
SET-2
ANSWER KEY
Ans(1) 1MARKS FOR EACH CORRECT ANSWER
(A) (i)
(B) (i)
(C) (i)
(D) (iii)
(E) (iii)&(iv)
(F) (ii)
(G) Guido Van Rossum
(H) Bit
(I) Bus
(J) Input
Q2. (A) Briefly explain the basic architecture of a computer with diagram? [2]
(B) What is the function of memory? What are its measuring units? [2]
Ans: The memory temporarily holds the data and information during
processing. The smallest unit of memory is bit.
(1Marks for writing function of memory and 1Marks for measuring
unit)
(C) What do you mean by memory devices? Explain RAM and ROM. [2]
Ans: 1Marks for memory devices and 1Marks for explain RAM and ROM
XI/CS/2019-20/SET-2 1|Pageoutof7
(D) What is SoC? How it is different from CPU? [2]
(i) Assembler
(ii) Compiler
(iii) Interpreter
(B) What is cloud computing and what are its types? [2]
XI/CS/2019-20/SET-2 2|Pageoutof7
(C) What is parallel computing? [1]
Ans:
Parallel computing is a type of computation in which many
calculations or the execution of processes are carried out
simultaneously. Large problems can often be divided into smaller ones,
which can then be solved at the same time.
(2Marks for writing any correct definition)
(D) What are the various category of software explain in brief? [2]
Ans:
(E) What is Operating System? Give one example of each single user and [2]
Q4. (A) Name the law shown below and verify it using a truth table. [2]
A + B.C=(A+B).(A+C)
XI/CS/2019-20/SET-2 3|Pageoutof7
(B) Write the equivalent Boolean expression for the following Logic Circuit : [2]
Q5. (A) What is the difference between a keyword and an identifier? [2]
(B) Name the Primitive data types in python. Explain mutable and [2]
XI/CS/2019-20/SET-2 4|Pageoutof7
(C) Predict the output of following code snippet: [2]
Ans: 1Marks for defining Token and 1Marks for its categories
(E) Find and write the output of the following Python program code : [2]
Ans: -69.0
9
(1Marks for each correct line of output)
Q6. (A) Write Python expressions equivalent to the following [2]
arithmetic/algebraic expression:
𝒂+𝒂
(i) ut + ½ ft2 (ii) √𝒂 +
𝒂
2 𝒂𝒂 |2x2 – 4x|
(iii) 3 + (iv) e
𝒂
code?
XI/CS/2019-20/SET-2 5|Pageoutof7
(iii) a, b, c = 2, 8, 9 (iv) name= “Hari”
print (a ; b; c) print (name)
name[2] = ‘R’
print( name)
Ans:
(i) max_temp=30 (ii) a=30
print(max_temp) b= a+b # b is not define
print(a, b)
Q7. (A) Write a Python program to calculate the compound interest. The [2]
principal, rate of interest and time must be entered by the user.
(Formula: Compound Interest = Principal (1 + Rate/100)Time )
Ans: p = float(input("Enter the principal amount: "))
r = float(input("Enter the interest rate: "))
t = float(input("Enter the time in years: "))
interest = p * (pow((1 + r / 100), t))
print("Compound interest is %.2f" % interest)
(1Marks for logic(Formula) and 1Marks for input and output)
XI/CS/2019-20/SET-2 6|Pageoutof7
(B) Write a Python program to obtain width and height of a rectangle and [2]
calculate its area.
(C) Write a program in python to accept a character from the user and [3]
display whether it is a vowel or consonant.
Ans: nterms = 20
n1 = 0
n2 = 1
count = 0
print("Fibonacci sequence upto",nterms,":")
while count < nterms:
print(n1,end=' , ')
nth = n1 + n2
# update values
n1 = n2
n2 = nth
count += 1
(2Marks for loop(for/while) and update values, 1Marks for disply)
XI/CS/2019-20/SET-2 7|Pageoutof7
CLASS – XI
COMPUTER SCIENCE WITH PYTHON
TIME – 3 HOURS [MAX. MARKS – 70]
General Instructions:
i) All questions are compulsory.
ii) Mark for each question is mentioned against it.
iii) Programming Language: PYTHON
d) Given that A=4, B=5, C=4, what will be the result of the following expressions:2
i)A<=C ii)A<=B
e) What is error? 1
f) What are variables? Give example. 2
g) Write the pseudo code that will take a number from the user 2 and print if it is positive,
negative or zero. 2
h) Rewrite the following program using for loop : 2
sum=0
i=1
while (i<=10):
sum=sum+i
i=i+1
print(“sum=”,sum)
i) Write a Python script to print Fibonacci series. 3
j) Identify the errors in the following code: 2
i. i. L1 = [1,2,3,5] ii. L1 = [1,3,5,8]
An = L1.remove(7) An = L1.remove(8)
print(An + 2)
l) Suggest appropriate functions for the following tasks: 2
(i) To check whether the string contains digits
(ii) To capitalize all the letters of the string
(iii) To remove all white spaces from the beginning of a string.
(iv) To check whether all letters of the string are in capital letters.
m) Write a program, which consider a list and find the average of number entered through
keyboard until enter ‘0’, if number is Zero then it will quit. Finally displays list of numbers. 3
n) t1= (1,)*3
t1[0]=2
print(t1) , What is the output ? 1
o) What is the use of json package? 1
p) Write the steps to arrange the elements using insertion sort. 12,5,14,8,3,54,25,10,27,30
2
q) What will be the output 2
t2=(1,2,3)
t3=(6,7)
t4=t3+t2
t5=t2+t3
print(t4)
print(t5)
r) Write a program to find factorial of a given number. 4
s) Write an appropriate for loop to be repeated 100 times, except the loop is to be terminated
if the value of the variable p becomes 50. 2
(a) To list the names all the patients admitted after 15/01/98. 1
(b) To list the names of female patients who are in ENT department. 1
(c) To list names of all patients with their date of admission in ascending order. 1
(d) To display Patient’s Name, Charges, Age for only female patients. 1
(e )Find Out the Output of Following SQL Command:- 2
(i) Select COUNT(DISTINCT charges) from HOSPITAL;
(ii) (ii) Select MIN(Age) from HOSPITAL where Sex="F";
f. Define the following 6
(i) foreign key (ii) DBMS (iii)desc command
(iv) group by clause (v)Order by clause (vi) candidate key
4. Answer the following Questions:
a) What are the rules for using social networking sites 2
b) What is Cracking? Suggest the ways to protect the computer from cyber attack. 2
c) Define eavesdropping and phishing . 2
d) What is cyber stalking? How it is done. 2
e) What are the tips to safely browse the internet. 2
KENDRIYA VIDYALAYA SANGATHAN, PATNA REGION
5.a)Write the pseudo code that will take a number from the user 2
and print if it is positive, negative or zero.
b) Draw the flow chart to find the area of a triangle using formula 2
𝜋⁄
𝜋 base x height.
c)Rewrite the following program using for loop : 2
sum=0
i=1
while (i<=10):
sum=sum+i
i=i+1
print(“sum=”,sum)
d) Write a program to compute simple interest and compound 3
interest.
e) Write a program to find the greatest among the three integers. 3
f)Write a program to find the sum of the series : 3
S = 1 + x + x2 + x3 +……+ xn
6.a)What do you mean by syntax error and semantics error? 2
b) Why are logical errors harder to locate? 2
c)If P = (5,4,3,2,1,0) evaluate the following expressions : 2
i) P[0] ii) P[1]
iii) P[P[0]] iv) P[P[-1]]
d) Find the output of the following Python code : 3
for Subject in [‘Physics’,’Chemistry’,’Mathematics’,’English’]:
print(Subject)
if Subject[0]==’M’
break
else:
print(‘Compulsory’)
print(‘Optional’)
e) What is a dictionary in Python?How can we access data from a 3
dictionary?What is the main use of a dictionary?
f)Write the algorithm to sort a list in ascending order using bubble 3
sort.
SAMPLE PAPER
Half Yearly Exam-2018
CLASS-XI
Que: 2
a) How variable is differ than identifier . [1]
b) What are variables? How we can create variable in python give examples. [1]
c) The following code is not giving desired output. We want to input value as 20 and obtain
output as 40.Identifiy the problem and do the required correction in the code [1]
x =input (“Enter number :”)
y = x*5
print(y)
d) What will be the output of the following code? [1]
x, y =2, 5
x, y =y, x+2
print(x, y)
e) Predict the output? [2]
x =15
x= x+10
x=x-5
print(x)
x,y = x-2 , 22
f) Define identifiers. Identify the valid and invalid identifiers in the following list. [2]
i) x_y125z ii) _abc@5 iii) abc_d53 iv) break
g) Write a program in python to obtain three numbers and print their sum and average .[2]
h) Write a program in python to enter the temperature in Celsius and convert it in to
Fahrenheit.[2]
Que:3
a) Explain the use of %( modulas) operator and = = operator with example. [1]
b) Explain mutable and immutable data types in python. [1]
c) Identify the type of following literals? [2]
i) 23.5789 ii) 237895 iii) True iv) 0XFACE
d) Explain type casting and its type with examples. [2]
e) What are comments? How comments are specified in python give example .[2]
f) Write the equivalent python expression for the following expressions. [2]
i) √a2+b2+c2 ii) (p + q) / (r+s)4
i. For the first 100 callls the minimum bill amount is 100 Rs.
ii. For the next 40 calls Rs. 0.40 per call will be charged extra.
iii. For the next 60 callls Rs. 0.50 per call will be charged extra.
iv. For the calls beyond 200 Rs. 0.60 per call will be charged extra.
c) Write a program in python to find the roots of a quadratic equation ax2+bx+c. [3]
d) Write a program in python to perform arithmetic operations (+, - , *, /, %). [2]
e) Write a program in python to enter a number and print whether it is an even number or
an odd number. [2]
Que:5
a) Write a program in python to print the Fibonacci series up to n terms. [4]
0 1 1 2 3 5…….n
b) Write a program to find the sum of even numbers and odd numbers between 1 to n
separately. [3]
c) Write a program in python to print the sum of following series. [3]
1+ X+ X2 +X3 +…. + Xn
d) Define entry controlled loop in python with example. [2]
e) Rewrite the following program using for loop. [2]
i=100
while(i>0):
print(i)
i-=3
Que:6
a) Explain different types of errors in python with examples. [3]
b) Write the differences between testing and debugging. [1]
Que:7
a) Write a program that reads a string and display it in reverse order. [2]
b) What is the use of islower( ) and isalnum( ) methods in python explains with
example.[2]
c) What is string slice? find the output of following python code : [2]
Q3. What is Primary key? Explain with the help of suitable example. [2]
Q4. Assume a table Emp with 15 rows and 5 columns. Write its degree and cardinality. [2]
3 rows are deleted and one more column is added. What will be the new degree
and cardinality?
Q5. What do you mean by SQL? What are the different categories of commands [2]
available in SQL.
Q7. Write SQL Commands for (a) to (e) and write the outputs for (f) to (h)on the basis [8]
of the following table :
Table : FURNITURE
(a) To list the details of furniture whose price is more than 10000
(b) To list the Item name and Price of furniture whose discount is between
10 to 20.
(c) To delete the record of all item where discount is 30.
(d) To display the price of ‘Babycot’.
(e) To list item name, type and price all items whose names starts with ‘D’.
(f) Select Distinct Type from Furniture;
(g) Select Max(Price) from Furniture where DateofStock>’2002-02-15’;
(h) Select Count(*) from Furniture where Discount<25;
Q9. What is a constraint? Name some constraints that you apply to enhance database [3]
integrity?
Q10. Differentiate between (i) Char and Varchar (ii) Primary Key and UNIQUE [4]
Q12. In a database ‘SCHOOL’ there are two tables ‘MEMBER’ and ‘DIVISION’ as shown [4]
below:
MEMBER
EmpID Name Pay DivNo
101 Rajesh 20000 10
102 Ajay 26000 50
103 Tina 22000 20
DIVISION
DivNo DivName Location
10 Media Delhi
20 Dance Kolkata
30 Song Guwahati
Q13. What is NoSQL database? Write main features of NoSQL databases? [3]
Q15. What are terms used in mongoDB to refer the following relational database terms: [2]
(i) row (ii) column (iii) table (iv) database
Q16. (i) Write command to create a new database by the name ‘newdb’ in mongoDB. [1]
(ii) Create a collection with the name ‘People’ and insert the following data in it: [2]
“name”:”Albert”, “age”:21, salary:15000
“name”:”Bibhash”, “age”:35, salary:50000
(iii) Write query to list all documents in collection ‘People’. [1]
*************
SHREE VALLABH ASHRAM’S MCM KOTHARI INTERNATIONAL GIRLS’
RESIDENTIAL SCHOOL, KILLA PARDI
PERIODIC TEST-3, 2019-20
CLASS XIS COMPUTER SCIENCE (083) M.M 50; TIME 1 HR
/12/19
Instructions:
1) All questions are compulsory
Q. 1. 10 marks
a) Define computer
1
b) Which is computer memory? 1
c) Differentiate compiler and interpreter? 2
d) Define following: 2
i. Operating System ii. Parallel Computing
e) Write difference between SRAM and DRAM. 2
f) Prove De-morgan s law using truth table. 2
Q. 2. 10 marks
a) Convert following 2
1) (101110)2=()8
2) (4156)8=()16
b) Write full form of following 2
1)ASCII
2)ISCII
c) Define proprietary software and write any two example . 1
d) What is data? What is output of data processing system? 1
e) What is bit? How bit, byte and nibble are related with each other? 2
f) What is application software? Write any two example. 2
Q. 3. 8 marks
Q. 4. 10 marks
a) What are data types? What are python s built in core data types? 2
a=12
b=7.4
c=1
a-=b
print (a, b)
a*=2+c
print(a)
b+=a*c
print( b )
e) Write a program to determine if the number is even or odd. 2
Q. 5. 10 marks
if int( zero ) == 0 :
Print( zero )
elif str(0) == zero :
Print (0)
elif str(0) == 0 :
Print (str(0))
else:
Print( none of the above )
c) Write a Python script to print Fibonacci series first 20 elements. Some initial elements of a
Fibonaci series are: 3
0 5 8 …….
d) Write a program that reads a string and checks whether it is a palindrome string or not. 3
e) Find the errors in the following code— 2
s= PURA VIDA
s1=s [ : 5]
s2=s [ 5 :]
s3=s1 * s2
s4=s2 + 3
s5=s1+3
Q. 7. 10 marks
a) What do you mean by Syntax errors and Semantics errors? Answer with example. 2
b) How are tuples different from list when both are sequences? 2
c) Consider the following code and then answer the question that follow— 4
myDict={ a :27, b :43, c :25, d :30}
valA=
for I in myDict:
if I > valA
valA=i
valB= myDict[i]
print (valA) #Line1
print (valB) #Line2
print (30 in myDict) #Line3
myLst= (myDict.items())
myLst.sort()
print (myLst[-1]) #Line4
d) What type of objects can be used as keys in dictionaries? Also explain why? 2
Common Annual Examination [2018-19]
Subject: Computer Science (Theory) XI class
Time Allowed: 3:00 hrs. Max. Marks: 70
• All the questions are compulsory.
• Programming Language Python.
• The paper have four sections Section A, Section B, Section C, Section D
Section A has 10 questions carrying 1 marks each.
Section B has 15 questions carrying 2 marks each.
Section C has 6 questions carrying 3 marks each.
Section D has 2 questions carrying 6 marks each.
Section A
1) What is cyber stalking?
2) What are the advantages of cloud computing?
3) What is the difference between RAM and ROM?
4) What does a cross platform language mean?
5) Arrange the following in ascending order of memory capacity:
TB, Byte, KB, PB, MB, GB
6) Give the full form of PROM
7) Is python a compiled or an interpreted language?
8) Define NoSQL Database.
9) Which Loops are supported by python?
10) What is the use of math.cos(x)?
Section B
11) List the differences between Low Level Languages and High Level Language.
12) What is the difference between input() and raw_input()? Explain with example.
13) Write the output of following program
a=10
b=20
b=b+a
print ”a=,”,a, ”b=”,b
14) How can you define a function in Python? Give proper syntax.
15) Draw a labeled diagram of basic computer system.
16) Identify Errors in the following lines of codes(Underline each correction )
def sin(x,n) #line 1
sine=0
for (i in range [n]):
sine=(-1)*i**I # line 2
sine=sine +((x**(2.0*i-1))/factorial1(2**i-1))*sign
return sine
17) Differentiate between a syntax error and a semantic error with example.
18) Convert the following:
(i) (4A)16 = ( )2
(ii) (106)10 = ( )8
1|Page
19) Write the name of the function used to calculate the length of list and tuples?
20) Write two features of Operating System.
21) Write the output produced by this program below.
x=3
If x!=2:
print ‘First’
else :
print ‘Second’
if 2>x: print ‘Third’
print ‘Fourth’
print ‘Fifth’
22) What are datatypes in python? Give an example.
23) What are Global Variables? What is their scope in program?
24) What is DDL? List the commands used in DDL.
25) Write the developer of python with year of establishment.
Section C
26) Draw a flowchart to calculate greatest of three entered numbers.
27) Write short note on Generation of Computers.
28) What is the difference between lists, tuples and dictionaries? Give an example for their usage.
29) Define eavesdropping, phishing and cyber bullying .
30) Write a short note on cloud computing.
31) Answer the question based on the table given below:
(i) Write the SQL command to create the above table with constraints.
(ii) Insert 2 records with relevant information, in the table student
(iii) Display all the records of the table Student.
Section D
32) What are the types of software in computer system and organization? Explain and give an example of each.
33) Attempt any two python programs given below:
i) Fibonacci Series
ii) Factorial of a number
iii) Palindrome of a string
2|Page
HALF YEARLY EXAMINATION (2018-19)
CLASS- XI
SUBJECT: COMPUTER SCIENCE (083)
Time: 03 Hrs. Max Mark: 70
Instructions:
(i) All questions are compulsory.
(ii) Programming Language: Python
(iii) For output based questions ignore errors (if any)
(i) valid
(ii) invalid
(i) True
(ii) 5
F Write a program to enter the sides of rectangle and print area & perimeter. 3
Area=l*b
Perimeter=2*(l+b)
FALSE
C What will be output of following 2
code: A,B,C,D=9.2, 2.0, 4, 21
print(A/4) print(A//4) print(B**C)
print(A%C)
2.3
2.0
16.0
1.2
D What will be output of following program segment: 3
A,B,C=9,12,3
X=A-B/3+C*2-1
Y=A-B/(3+C)*(2-1) Z=A-
(B/(3+C)*2)-1 print(“X=”,X)
print(“Y=”,Y)
print(“Z=”,Z)
X=10.0
Y=7.0
Z=4.0
SI=(PTR)/100
P=principal amount, T=Time in years, R=Rate of interest
If (condition):
Statement
IF(condition):
Statement
ELSE:
Statement
n1=int(input(“enter number1”))
n2= int(input(“enter number2”))
rem=n1%n2 if
rem==0:
print(n1,”is divisible by”,n2) else:
print(n1,”is not divisible by”,n2)
X=INT(INPUT(”ENTER NUMBER1”))
Y=INT(INPUT(”ENTER NUMBER1”))
Z=INT(INPUT(”ENTER
NUMBER1”)) IF (X>Y AND X>Z):
PRINT(X,”IS LARGE”) IF (Y>Z AND
Y>X): PRINT(Y,”IS LARGE”) IF
(Z>X AND Z>Y):
PRINT(Z,”IS LARGE”)
F Write program to read two numbers and an arithmetic operator and display 3
the computed result.
X=FLOAT(INPUT(“ENTER NUMBER1”))
Y=FLOAT(INPUT(“ENTER NUMBER2”))
OP=INPUT(“ENTER OPERATOR:+/-/*//”) RESULT=0
IF OP==‟+‟:
RESULT=X+Y
ELIF OP=‟-„:
RESULT=X-Y
ELIF OP=‟*„:
RESULT=X*Y
ELIF OP=‟/„:
RESULT=X/Y ELSE:
PRINT(“ENTER VALID OPERATOR”)
PRINT(X,OP,Y,‟=‟,RESULT)
B (i)0,1,2,3,4,5 (iii)5,9,13,17 2
(ii)7,8,9 (iv)12,10,8,6,4,2
C The continue statement in Python returns the control to the beginning 3
of the while loop. The continue statement rejects all the remaining
statements in the current iteration of the loop and moves the control
back to the top of the loop any example of break and continue
(Two marks for definition and One mark for example)
D n=1 for a in 3
range(5):
print(n)
n=n*10+1
½ marks for input ½ for output and 2 marks for logic
5 A (i)syntax error 1
(ii)Semantics error
B (i)p =print for variable value (ii) h=for help 1
C for any one correct reason one marks 1
D A run-time error typically generates an exception or otherwise terminates 2
program e.g. dividing by zero. The program is doing something that is
undefined.
Dictionary are group of key value pairs. The elements in a dictionary are
indexed by keys. Keys should be unique. we can access the data from
dictionary by using keys
C Write a statement for following: 1
(i) Sum of all elements in a list([1,2,3,…100]) (ii)
sum of all odd numbers in a list ([1,2,3,….100])
(ii) sum(range(1,101,2))
D What will be output of following: 2
(i) >>>[4]*4
(ii) >>>num=[17,123]
>>>num[-1]
(i) [4,4,4,4]
(ii) 123
E Rewrite the following after removing all syntax errors. Underline each 2
correction
num=[10,51,2,18,4,31,13,5,23,64,29]
print(“list element s are:”,end=” “)
for i in num:
print(i,end=” “) print()
find=int(input(“”enter element to search))
flag=0 for i in num: if(i===find):
flag=1
break if
flag==1:
print(“element found) else:
print(“element not found)
(i) Error
(ii) 222
B What will be output of following: 1
word=‟AMAZING‟
print(word[0:3])
print(word[-5:-1])
AMA
AZIN
HALF YEARLY
Class XI
Computer Science(083)
Question Paper
SL Question Marks
No
Q1 Answer the following questions:
(a) Define Software? 1
(b) How Many Characters are supported in AsCII? 1
(c) Expand DRAM? 1
(d) Write a python program to print table of 5? 2
Q2 Answer the following questions:
(a) Write two features of Linux Operating system? 2
(b) What is a software interrupt? Give an example? 2
(c) What is the difference between c[:] and c[:-1] assuming c is a list? 1
(d) In which generation integrated Circuits(IC) used? 1
Q3 Answer the following questions:
(a) Write short note on Object oriented approach. 2
(b) List the differences between compiler and interpreter? 2
(c) What is the difference between range() and xrange()? 1
(d) Write a line of code to execute infinite loop in python. 1
Q4 Answer the following questions:
(a) What is Booting? What are the types of booting 2
(b) What is bytecode? 1
(c) Why the statement is not valid? 1
X+1=X
(d) How can you know the datatype of a variable? 1
Q5 Answer the following questions:
(a) Explain rint() and abs() from math module with an example? 2
(b) What do you mean by Logical errors with an example? 2
(c) What is the role of a comment in a comment in a program ? Is it
necessary to comment every line of code? 2
(d) WAP to print area of a circle? 2
Q6 Answer the following questions:
(a) WAP to convert temperature from degree to Fahrenheit. 2
(b) What do you mean by Latency? Should it be less or more for ideal
system? 2
(c) Given the following code, write down the output? 3
a=3
b=1
For I in range(a):
For j in range (b):
Print (“hello”*i+”oswal”*j)
(d) WAP to delete all the even nos from a numeric list. 2
Q7 Answer the following questions:
(a) Convert the following: 2
1. (1011010)2 to Hexadecimal
2. (723)8 to Decimal
(b) Draw a flow chart to calculate factorial of a number. 3
(c) Rewrite the following code after removing syntactical errors. Underline
each correction done in the code. 2
For name in [amar,shweta,parag]
If name[0]=’s’:
Print(name)
(d) Name the function/method required to 2
(i) Check if a string contains only alphabets.
(ii) Give the total length of the list.
Q8 Answer the following questions:
(a) State and prove the DeMorgan’s Theorem algebraically. 3
(b) Draw a logic circuit diagram for the following Boolean expression: 2
X’.(Y’+Z)
(c) Write two characteristics of cloud computing. 2
(d) WAP that computes the real roots of a quadratic equations. 3
(e) WAP to check whether entered string is palindrome or not. 3
Class XI
Session 2018-19
BLUE PRINT
S no. Typology of VSA(1 mark) SA(2 marks) LA(3 marks) Total No of Total Marks
Questions questions
1 Programming in 6(1) 11(2) 4(3) 21 40
Python(Unit-1
upto List
manipulation)
2 CSA(Unit-2) 5(1) 11(2) 1(3) 16 30
TOTAL 11 44 15 37 70
Question Paper
SL Question Marks
No
Q1 Answer the following questions:
(a) Define Software? 1
(b) How Many Characters are supported in AsCII? 1
(c) Expand DRAM? 1
(d) Write a python program to print table of 5? 2
Q2 Answer the following questions:
(a) Write two features of Linux Operating system? 2
(b) What is a software interrupt? Give an example? 2
(c) What is the difference between c[:] and c[:-1] assuming c is a list? 1
(d) In which generation integrated Circuits(IC) used? 1
Q3 Answer the following questions:
(a) Write short note on Object oriented approach. 2
(b) List the differences between compiler and interpreter? 2
(c) What is the difference between range() and xrange()? 1
(d) Write a line of code to execute infinite loop in python. 1
Q4 Answer the following questions:
(a) What is Booting? What are the types of booting 2
(b) What is bytecode? 1
(c) Why the statement is not valid? 1
X+1=X
(d) How can you know the datatype of a variable? 1
Q5 Answer the following questions:
(a) Explain rint() and abs() from math module with an example? 2
(b) What do you mean by Logical errors with an example? 2
(c) What is the role of a comment in a comment in a program ? Is it
necessary to comment every line of code? 2
(d) WAP to print area of a circle? 2
Q6 Answer the following questions:
(a) WAP to convert temperature from degree to Fahrenheit. 2
(b) What do you mean by Latency? Should it be less or more for ideal
system? 2
(c) Given the following code, write down the output? 3
a=3
b=1
For I in range(a):
For j in range (b):
Print (“hello”*i+”oswal”*j)
(d) WAP to delete all the even nos from a numeric list. 2
Q7 Answer the following questions:
(a) Convert the following: 2
1. (1011010)2 to Hexadecimal
2. (723)8 to Decimal
(b) Draw a flow chart to calculate factorial of a number. 3
(c) Rewrite the following code after removing syntactical errors. Underline
each correction done in the code. 2
For name in [amar,shweta,parag]
If name[0]=’s’:
Print(name)
(d) Name the function/method required to 2
(i) Check if a string contains only alphabets.
(ii) Give the total length of the list.
Q8 Answer the following questions:
(a) State and prove the DeMorgan’s Theorem algebraically. 3
(b) Draw a logic circuit diagram for the following Boolean expression: 2
X’.(Y’+Z)
(c) Write two characteristics of cloud computing. 2
(d) WAP that computes the real roots of a quadratic equations. 3
(e) WAP to check whether entered string is palindrome or not. 3
24. Write a Python program to read the values of X, Y, and Z from the user and calculate 4
the expression: 5X4+6Y3+3Z+6
25. Define the following terms: Algorithm and Flowchart 2
26. What are jump statements in Python? Name and state the purpose of each? 2
27. Find and correct the errors in following code: 3
# Program to check whether a number is EVEN or ODD
num = input('Enter any Number')
if num%2 = 0:
print('EVEN NUMBER')
else
print('ODD NUMBER')
28. Write a Python program to display first N terms of the Fibonacci series? 3
29. Write a Python program to display the following pattern using loop statements? 4
A
A B
A B C
A B C D
A B C D E
30. Differentiate between Syntax and Semantic errors? 1
31. What is an exception in Python? Name any two of them? 2
***----***---***---***
SHREE VALLABH ASHRAM’S MCM KOTHARI INTERNATIONAL GIRLS’
RESIDENTIAL SCHOOL, KILLA PARDI
PERIODIC TEST I - 2018-19
CLASS XI COMPUTER SCIENCE M.M 50; TIME 3HRS
18/07/18
(ii) First =2 2
Second=3
Third=first+second
Print(first,second,third)
First=first+second+third
Third=second+first
Print(first,second,third)
Q14. Can nongraphic characters be used in Python? Give examples to support your 2
answer
Q16. Find out the errors in the following code fragment: (the input entered is XI) 2
(i) C=int(input(“ENTER YOUR CLASS”))
print(“YOUR CLASS IS”,C)
(ii) a,b,c=2,3,4
a,b,c=a*a, a*b, a*c
print(a,b,c)
Q19. Write a program in Python to find the simple interest based on the value of 3
principal, rate and time. (Hints. simple_interest=(amount*rate*time)/100)
Q20. Describe functional components of computer system with the help of diagram. 5
b) Write an appropriate for loop to be repeated 100 times, except the loop is to be
terminated if the value of the variable P becomes 50. 2
a=[1,2,3]
b=[4,5,6]
c=a+b
d=c[0:3]
e=d
c[5]=10
c[1]=20
e[0]=30
print(a)
print(c)
print(d)
print(e)
(i) Write the SQL command to create the above table with constraints. 1
(v) Change the Stream of Student to ‘Computer’ Whose Roll no. is 536. 1
(vi) Add one column email of data type VARCHAR and size 30 to the table student. 1
(a) To list the names all the patients admitted after 15/01/98. 1
(b) To list the names of female patients who are in ENT department. 1
(c) To list names of all patients with their date of admission in ascending order. 1
(d) To display Patient’s Name, Charges, Age for only female patients. 1
BLUE PRINT
Long Long
Very Short Short Short Answe
Answer r Total
Answer Answer-I Answer -II
S. No Typology of Questions (L.A.) (L.A.) Marks
(VSA) (SA-I) (SA-II)
(4 (6
(1 mark) (2 marks) (3 marks)
marks) marks)
Programing in Python -
1 3 11 2 1 35
(Unit1)
2 CSO (Unit2) 6 2 -- – -- 10
Total Marks 10 38 6 4 12 70
ST.JOSEPH CALASANZ CBSE SCHOOL, KANYAKUMARI
SEMESTER I, - 2019-2020
COMPUTER SCIENCE
CLASS : XI Max Marks: 70
TIME: 3 hrs
• All the questions are compulsory
• The paper have four sections Section A, Section B, Section C, Section D
Section A has 14 questions carrying 1 marks each
Section B has 15 questions carrying 2 marks each.
Section C has 6 questions carrying 3 marks each.
Section D has 2 questions carrying 6 marks each.
Section- A (1 x 15=15)
1. What are the Boolean numbers in python?
2. Which one of the following is not a python’s predefined data type
a) Int b)Tuple c)complex d) Class
3. Draw the logic circuit from the following expression AB+A’C
4. What is the value of X is
X=int(43.55+2/2 )
a) 23 b) 22 c) 44 d) 43
5. Name the function that tells the data type of an object.
6. Write a python statement to assign the values “ Periodic Test”, “ CS”, “XI” to Variables
Exam, sub, clss
7. Name any 2 devices that run on mobile OS.
8. What are the three types of Language Processor.
9. Proof x + xy = x
10. What is the value of the expression 4+2**5//10
a) 1233 b) 7 c) 9 d) 45
11. What is an atom? What is an expression?
12. If you give the following for str1=”Hello” why does python report error str1[2]=’p’
13. Find out the output
a) 13 &12 b) ~8
14. a=True
b=False
c=False
If a or b and c:
Print(“hello”)
else:
Print(“hai”)
15. Find out the error and rectify it
X,Y=3
Z=x+y
Pirnt(the value of z is z)
Section- B (15 x 2 = 30)
Section- D (2 x 5 =10)
36. Write a python program to generate the numbers (1 to 30) , then the program calculate and
display the sum of odd numbers and even numbers respectively.
e.g. if the user gives the following sequence of numbers:
ex: 1 2 3 4 5 6 7 8 9 10
Then the output should be as follows:
The Sum of even numbers in given input sequence = 25
The Sum of odd numbers in given input sequence = 38
37. a) Get any 2 digit positive number from user(ex:25). Print the Reverse number Check the
Reverse number is Palindrome or not?(3)
b) Find out the factorial value of given number “n”.( Get the n value read from the user). If
the given number is less than 0 then Print the words “We can’t find out the factorial of
negative number.(2)
SAMPLE PAPER
HALF YEARLY
Class XI
Computer Science(083)
Question Paper
SL Question Marks
No
Q1 Answer the following questions:
(a) Define Software? 1
(b) How Many Characters are supported in AsCII? 1
(c) Expand DRAM? 1
(d) Write a python program to print table of 5? 2
Q2 Answer the following questions:
(a) Write two features of Linux Operating system? 2
(b) What is a software interrupt? Give an example? 2
(c) What is the difference between c[:] and c[:-1] assuming c is a list? 1
(d) In which generation integrated Circuits(IC) used? 1
Q3 Answer the following questions:
(a) Write short note on Object oriented approach. 2
(b) List the differences between compiler and interpreter? 2
(c) What is the difference between range() and xrange()? 1
(d) Write a line of code to execute infinite loop in python. 1
Q4 Answer the following questions:
(a) What is Booting? What are the types of booting 2
(b) What is bytecode? 1
(c) Why the statement is not valid? 1
X+1=X
(d) How can you know the datatype of a variable? 1
Q5 Answer the following questions:
(a) Explain rint() and abs() from math module with an example? 2
(b) What do you mean by Logical errors with an example? 2
(c) What is the role of a comment in a comment in a program ? Is it
necessary to comment every line of code? 2
(d) WAP to print area of a circle? 2
Q6 Answer the following questions:
(a) WAP to convert temperature from degree to Fahrenheit. 2
(b) What do you mean by Latency? Should it be less or more for ideal
system? 2
(c) Given the following code, write down the output? 3
a=3
b=1
For I in range(a):
For j in range (b):
Print (“hello”*i+”oswal”*j)
(d) WAP to delete all the even nos from a numeric list. 2
Q7 Answer the following questions:
(a) Convert the following: 2
1. (1011010)2 to Hexadecimal
2. (723)8 to Decimal
(b) Draw a flow chart to calculate factorial of a number. 3
(c) Rewrite the following code after removing syntactical errors. Underline
each correction done in the code. 2
For name in [amar,shweta,parag]
If name[0]=’s’:
Print(name)
(d) Name the function/method required to 2
(i) Check if a string contains only alphabets.
(ii) Give the total length of the list.
Q8 Answer the following questions:
(a) State and prove the DeMorgan’s Theorem algebraically. 3
(b) Draw a logic circuit diagram for the following Boolean expression: 2
X’.(Y’+Z)
(c) Write two characteristics of cloud computing. 2
(d) WAP that computes the real roots of a quadratic equations. 3
(e) WAP to check whether entered string is palindrome or not. 3
Roll Number………………..
GURUKUL KURUKSHETRA
COMPUTER SCIENCE
SEPTEMBER EXAMINATION
SESSION (2019-20)
CLASS: XI (083)
(i) ‘Python is an interpreted high level language’. What does it mean to you? 1
(ii) What is Type casting? Elaborate with example. 1
(iii) What is IDLE? 1
(iv) Define a keyword. Give two examples. 1
(v) What are the two modes of working in Python? 1
(vi) Draw a flow chart to find the greatest of 3 numbers. 2
(vii) Write the output of the following: 3
(a) a,b=20,30
a=a+5
b=b+10
a,b=b,a
print (a)
print (b)
2
print(‘Over’)
(xvii) Write a program to generate the following series. 2
1 2 3
1 2 3
1
(xviii) Write a program in python to calculate the factorial of 5. 2
(xix) Give the output of the following python statements. 2
y=5
for i in range(1,3):
for j in range(0,i):
z=i+j-1
if(z%2)==0:
y=y+z
elif(z%3)==0:
y=y+z-2
print("y=",y)
(xx) Write the output of the following: 2
L=[10,20,30,40]
L1=[500,600]
L2=[35,45]
L1.extend(L2)
L.insert(25,2)
print(L1+L2)
print(L1)
print(L.index(30))
print(L2*2)
(xxi) Write a program to find and display prime numbers below 50. 3
(xxii) Find the output of the following: 1
T1=(10,20,30,40,50)
T2=(100,200,300)
T1,T2=T2,T1
print(min(T1))
print(max(T2))
5
(i) What are the components of CPU? What is its role? What is the function of
control unit of CPU? 2
(ii) What is cloud computing? Write two benefits. 1
(iii) Write the difference between compiler and interpreter. 2
(iv) Two devices used by the supermarket point-of-sale (POS) terminal are a
barcode reader and keyboard. Name two other input/output devices used at the
POS and give a use for each device. 1
(v) Why are NAND and NOR gates more popular? 1
(vi) Answer the following questions:- 4
(a) Convert (10110.0101)2 into decimal number.
(b) Convert (325)10 into octal number.
(c) Convert decimal number (0.375) to its equivalent binary number.
(d) Add 101101 to 11001.
(vii) Draw logic circuit diagram for the following expression: 2
Y = a e + ē o+ ō ā
(viii) State DeMorgan’s Law of Boolean Algebra and verify them using truth table.2
(ix) Write the equivalent Boolean Expression for the following Logic Circuit: 2
General Instruction:
i. All the questions are compulsory.
ii. Please write down the serial number of the question before attempting it.
iii. Programming Language: PYTHON.
Q1. (A) Components that provide internal storage to the CPU is: [1]
(B) Which of the following is used to hold the running program [1]
instructions?
(i) Primary Storage (ii) Virtual Storage
(iii) Internal Storage (iv) Minor Device
(E) Which of the following are not valid string in Python? [1]
XI/CS/2019-20/SET-2 1|Pageoutof5
(G) Python was developed by ............................................ in February [1]
1991.
Q2. (A) Briefly explain the basic architecture of a computer with diagram? [2]
(B) What is the function of memory? What are its measuring units? [2]
(C) What do you mean by memory devices? Explain RAM and ROM. [2]
(i) Assembler
(ii) Compiler
(iii) Interpreter
(B) What is cloud computing and what are its types? [2]
(D) What are the various category of software explain in brief? [2]
(E) What is Operating System? Give one example of each single user [2]
XI/CS/2019-20/SET-2 2|Pageoutof5
and multiuser Operating System
Q4. (A) Name the law shown below and verify it using a truth table. [2]
A + B.C=(A+B).(A+C)
(B) Write the equivalent Boolean expression for the following Logic Circuit : [2]
Q5. (A) What is the difference between a keyword and an identifier? [2]
(B) Name the Primitive data types in python. Explain mutable and [2]
(D) What is Token? What are categories of Token exist in Python? [2]
(E) Find and write the output of the following Python program code : [2]
XI/CS/2019-20/SET-2 3|Pageoutof5
>>>print (3**2 + 18/9 - 3**4+1)
>>>print (12%5*3+(2*6) // 4)
Q6. (A) Write Python expressions equivalent to the following [2]
arithmetic/algebraic expression:
(B) Find out the error(s) in following code fragments and rewrite [2]
corrected code?
Q7. (A) Write a Python program to calculate the compound interest. The [2]
principal, rate of interest and time must be entered by the user.
(Formula: Compound Interest = Principal (1 + Rate/100)Time )
(B) Write a Python program to obtain length and breadth of a rectangle [2]
and calculate its area.
XI/CS/2019-20/SET-2 4|Pageoutof5
(C) Write a program in python to accept a character from the user and [3]
display whether it is a vowel or consonant.
(D) Write a python program to print Fibonacci series’ first 20 elements. [3]
Some initial elements of a Fibonacci series are:
0 1 1 2 3 5 8…………………
********************
XI/CS/2019-20/SET-2 5|Pageoutof5