You are on page 1of 9

ASSIGNMENT(CLASS XI)

SUBJECT COMPUTER SCIENCE

Q1(a) What is the syntax to print output in a single line. 1


(b) Define NoSQL Database. 1
(c) Differentiate between list and tuple constructs of Python 1
(d) Draw XOR gate using minimum number of NAND gate. 2
(e) What is a function call IN PYTHON? Give Example 2
(f) Write the Python code to create the dictionary to include the list of following countries
and their capital. 2
India New Delhi
Pakistan Islamabad
Srilanka Colombo
Bangladesh Dhaka
Q2(a) Write a program in python to find out greater of two numbers. 2
(b) Given the following code , write down what would be printed as output- 1
A=3
While(I in a):
Print “”Happy”**i
(c) Write pseudo-code / flowchart to input the year and to test and display whether the given
year is leap year or not? 3
(d)Write python program to calculate area of circle. The radius being the input. 2
(e)Given the following python code what values are printed as output? 2
def afunc(B):
B=B%2
Print B
A=2
afunc(A)
afunc(A+5
)
Print A

Q3: a) Is python a compiled or an interpreted language? 1


b) Differentiate between compiler and interpreter. 1
c) Write a short note on string constructs in python. 2
d) What are the benefits of using cloud computing (any two)? 2
e) List some common datatypes used in python. 1
Q 4: Answer the following questions-
(a)What is the function performed by len() and reverse() in the list module. 2
(b) Find error in the given SQL code: (Consider the table: ADM ) 1

insert into values {“admin”,”write”}; Q5:


2 a) Rewrite the following code fragment using for loop: num=20 2
while(num > 0):
count += 1 sum += num num -= 2
if(count == 10):
print(sum//count) break

Page 1 of 9
b) Consider the following Python program: n=int(input(“Enter N:”) 2
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

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.
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.
e) Write aprogram in Python to print the sum of the following series: 4
s= 1 + x + x2 + x3 +……. + xn

Answer the following Questions:


(a) Convert: 2
A) (1234.56)10 = (?)16
B) (476)8 = (?)2
b) i) What is the role of load balancing in parallel computing? [2X1=2]
ii) Arrange the following in ascending order of memory capacity:
TB , Byte, KB, Nibble, PB, MB, GB 1
(c) Define primary key. 1
Q5: 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 bullying. How it is done. 2
e) What are the tips to safely browse the internet. 2
Q.6 Answer the question based on the table given below:

(i) Write the SQL command to create the above table with constraints. 1
(ii) Insert 2 records with relevant information, in the table student 1
(iii) Display all the records of the table Student. 1
(iv) Delete the Student Whose Roll no is 100. 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
Q7: Answer the question based on the table given below:

Page 2 of 9
(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:-
(i) Select COUNT(DISTINCT charges) from HOSPITAL; 1
(ii) (ii) Select MIN(Age) from HOSPITAL where Sex="F"; 1
Q8 (a) What is the difference between math.abs() and math.fabs()?
Give Example. 2
(b) What is String? How do you create a string in Python? 2
(c) Write a program to check whether entered string is palindrome or not. 3
(d)Refer the following code and predict the output [4x1/2=2]
a=[1,2,3]
b=[4,5,6]
c=a*b
d=c[0:3
]
e=d
a[5]=10
c[1]=20
e[0]=30
(i) Print e (ii) print a (iii) print d (iv) print c
e) Write a python program to receive the numbers from user through keyboard until user gives 0
(to end the input process), then the program calculate and display the sum of given odd numbers
and even numbers respectively.e.g.
if the user gives the following sequence of numbers: 7 5 10 14 3 9 11 12

Page 3 of 9
Then the output should be as follows:
The Sum of even numbers in given input sequence = 36

The Sum of odd numbers in given input sequence = 35

1. Answer the following questions:


a) Define Software. (1 mark)
b) How many characters are supported in ASCII? (1 mark)
c) Expand DRAM. (1 mark)
d) Write a Python program to print table from 5 to 10. (2 marks)
2. Answer the following Questions:
a) Name three levels of data abstraction. (1 mark)
b) Define Network DBMS. (1 mark)
c) Write two features of Linux Operating System? (2 marks)
d) What is a software interrupt? Give an example. (2 marks)
3. Answer the following questions:
a) What is the difference between c[:] and c[:-1] Assuming, c is a list ? (1 mark)
b) Write short note on Object Oriented Programming Approach. (2 marks)
c) What are decorators in python? (2 marks)
d) What is the difference between lists, tuples and dictionaries? Give an example for their usage.
(3 marks)
e) What types of conditional structures are present in a programming language? How many of
them are supported in Python? (3 marks)
4. Answer the following questions:
a) What are Global Variables? What is their scope in program? (2 marks)
b) Write the output produced by this program below.
words = ‘Hello World’
print (words.title())
print (words.replace(“World”, ‘Oswal’))
print (words.upper())
print (words * 2) (2 marks)
c) What is interpreter? Draw a diagram showing working of interpreter. (3 marks)
d) Assuming num = 125, determine the value of each of the following Python
expressions:
(i) num / 125
(ii) num%100
(iii) (num==21) & (2<3)
(iv) not((num<45.9) & (6*2<=13)) (4 marks)
e) Write a program to enter a number in python and print its octal and hexadecimal equivalent.
(4 marks)
f) Write an algorithm to enter a date in DD/MM/YYYY format and check if the date is in the
correct format or not. (4 marks)
9.Answer the following questions:

Page 4 of 9
g) What will be the output of the following?
def func(x):

print (x**3)
func(4) (1 mark)
h) Apply strip() to the following string:
s = ‘ aaa bbb ccc ddd ’ (1 mark)
i) If you are given the phone numbers of a class of students how would you store it and in what
datatype? (2 marks)
j) The following code is supposed to remove numbers less than 5 from list n, but there is a bug.
Fix the bug and underline each correction made by you. n =
[1,2,5,10,3,100,9,24]
for e of n:
if e>5:
n.remove(e)
print e (3 marks)
k) Demonstrate the use of exception handling in python. (4 marks)
10.Answer the following questions:
l) Differentiate between ceil( ) and floor( ). (1 mark)
m) 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’) (2 marks)
n) Find the error in the following program.
line = “its my world’
print (“You typed”, line)
line = line * “h”
num = int(line)
print (“You typed the number “, num) (3 marks)
o) Draw a flowchart to calculate greatest of three entered numbers. (4 marks)
11.Answer the following questions:

Page 5 of 9
p) Write one function performed by School Management System. (1 mark)
q) Define Booting. (1 mark)
r) Write three differences between Bluetooth and Infrared. (3 marks)
s) Write a short note on Third Generation of Computers. (3 marks)
Q12(a) How many types of strings are supported in Python. 1
(b) What are datatypes? 1
(c) What is the difference between a keyword and an identifier? 1
(d) Draw XOR gate using minimum number of NAND gate. 2
(e) What is a function call IN PYTHON? Give Example. 2
(f) Write the Python code to create the dictionary to include the list of following countries
and their capital. 2
Srilanka Colombo
Bangladesh Dhaka
India New Delhi
Pakistan Islamabad
Q13(a) Write a program in python to find out smaller of two numbers. 2
(b) What will be the output of the following- 1
(i) print(len(str(17//4)))
(ii) print(len(str(17/4)))
(c) Write pseudo-code / flowchart to input the year and to test and display whether the given
year is leap year or not? 3
(d)Write python program to calculate area of rectangle. 2
(e)Given the following python code what values are printed as output? 2
def afunc(B):
B=B%2
Print B
A=2
afunc(A)
afunc(A+5)
Print A
Q14: a) What is the significance of an empty statement? 1
b) Differentiate between compiler and interpreter. 2
c) Write a program to illustrate the difference between break and continue statements. 2
d) What are the benefits of using cloud computing (any two)? 2
e) Write a python script to generate divisors of a number. 2
Q 15: Answer the following questions-
(a)What is the function performed by len() and reverse() in the list module. 2
(b) Find error in the given SQL code: (Consider the table: ADM ) 1
insert into values {“admin”,”write”};
Q16: Answer the following Questions:

(a) Convert: 2
A) (434.05)10 = (?)16
B) (523)8 = (?)2

b) i) What is the role of load balancing in parallel computing? [2X1=2]


ii) Arrange the following in ascending order of memory capacity:

Page 6 of 9
TB , Byte, KB, Nibble, PB, MB, GB 1
(c) What is a database system? What is its need. 1
Q17: Answer the following Questions:
a) Describe following Cybercrimes:
(i) Cyber Bullying (ii) Cyber Stalking 2
b) What is Cracking? Suggest the ways to protect the computer from cyber attack. 2
c) Define eavesdropping and phishing . 2
d) What measures should one take to avoid and maintain confidentiality of personal
information? 2
e) What are the tips to safely browse the internet. 2
18 a) What is cyber stalking? 1
b) What do you understand by identity theft? 1
c) How is phishing different from pharming? 2
d) Explain the terms spyware and malware. 2
e) What is cybercrime? How can you report it? 2
f) What is eavesdropping? 2
Q19 (a) What is the length of the tuple shown below?
T = ((((‘a’,1) , ‘b’ , ‘c’), ‘d’, 2), ‘e’, 3) 2
(b) Write a program to check whether entered string is palindrome or not. 3
(c) Refer the following code and predict the output [4x1/2=2]

a=[1,2,3] b=[4,5,6]
c=a*b d=c[0:3]
e=d a[5]=10
c[1]=20
e[0]=30
(i) Print e (ii) print a (iii) print d (iv) print c

e) Write a python program rotates the element of a list so that the element at the first index moves
to the second index, the element in the second index moves to the third index, etc., and the element
in the last index moves to the first index..
[4]
Section-A
20. (a) What does a cross platform language mean? 1
(b) Which of the following are valid and invalid strings in python? 2
(i) “python” (ii) ‘python’ (iii) “python’ (iv) {python}
(c) What are Identifiers? 1
(d) What is the difference between == and =? Explain with example. 2
(e) What are mutable and immutable data types? Give two examples of each 2
(f) What is None literal in python? 1
21 (a) Differentiate between a syntax error and a semantic error with example. 2
(b) Which arithmetic operator(s) can be used with strings? 1

Page 7 of 9
(c) Find the output of the following code: x= “hello world” 3
print (x[ : 2], x[ : -2], x[-2 : ])
print (x[ 6 ], x[2 : 4])
print (x[ 2 : -3], x[ -4 : -2])
22 a) Write the name of the function used to calculate the length of list and tuples? 1
b) Write a program in python to find maximum element in the list entered by the user. 2
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.
Section-B
23 a) What is the difference between RAM and ROM? 1
b) What is a language processor? Write the name of two language processors. 2
c) How many possible code groups can be formed by ASCII code (ASCII is a 7 bit code) ? 1
d) Convert the following: 2

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

e) Name any two basic logic gates. 1


f) Write the expression for the following logic circuit: 2

g) What are the advantages of cloud computing? 1


Section-C
24 a) What is the difference between degree and cardinality of table? Explain with 2
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

1) Display the names of the students who have grade ‘C’ in either Game1 or Game2
2) Display the names of students getting grade ‘A’ in Cricket.
3) Display the games taken up by the students, whose name starts with ‘A’.
4) Add a new column named ‘Marks’ of int type in the sports table.
5) Insert a new row in the table with the following data (16, 10, “Mohan”, “Cricket”,
“B”, “Tennis”, “A”)
6) Delete the row from the student table whose Studno is 12.

c) Differentiate between delete and drop command with example. 2


Page 8 of 9
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

e) What is an equi join in SQL? 1


f) What is the use of indexes in databases? 2

Page 9 of 9

You might also like