CS 11 Worksheet - 1
CS 11 Worksheet - 1
WORKSHEET - 1
Class: XI Subject: Computer Science
Page 1 of 5
13 Mrs. Mohini wrote the following algorithm, she told the students to make flowchart for the
same.
Step 1: Start
Step 2: Input “Enter a number” N
Step 3: rem = N%5
Step 4: if rem = 0 then “N is divisible by 5”
End of program
Step 5: if rem != 0 then “N is not divisible by 5”
Step 6: Stop
(a) While drawing a flowchart which symbol will she use for step 1?
(i) Circle (iii) Rectangle
(ii) Oval (iv) rhombus
(b) In drawing a flowchart which symbol will she use for step 2?
(i) Parallelogram (iii) Rectangle
(ii) Oval (iv) Rhombus
(c) In drawing a flowchart which symbol will she use for step 3?
(i) Parallelogram (iii) Rectangle
(ii) Oval (iv) Rhombus
(d) In drawing a flowchart which symbol will she use for step 4?
(i) Circle (iii) Rectangle
(ii) Oval (iv) Rhombus
14 Which statement is correct expression for adding the remainder of 8 divided by 3 to the product
of 5 and 6?
a. 8 % 3 + 5 * 6 c. 8 // 3 + 6.5
b. 8 / 3 + 5 * 6 d. None of the above
18 Given is a pseudocode:
1. START
2. INPUT n
Page 2 of 5
3. SET result = 1
4. IF n == 0 OR n == 1 THEN
5. PRINT result
6. ELSE
7. FOR i FROM 1 TO n
8. result = result * i
9. END FOR
10. PRINT result
11. END IF
12. END
Draw the flowchart of this pseudocode.
25 What are the different types of token in python? Give example of each.
ii)
x=40
y=x+1
x=20, y+x
print(x, y)
Page 3 of 5
iii)
a,b=12,13
print(print(a+b))
iv)
a,b,c= 2,3,4
a,b,c= a*a, a*b, a*c
print(a,b,c)
v)
x,y = 10,20
x,y=y,x
print(x,y)
vi)
a,b,c=12,7.4,1
a - = b
print(a,b)
a*= 2 + c
print(a)
b+= a*c
print(b)
vii)
x,y,z= True, False, False
a= x or (y and z)
b= (x or y) and z
print(a,b)
viii)
w,x,y,z=True,4,-6,2
res= -(x+z) < y or x**z<10
print(res)
27 Write the type of the following tokens: True, sub_cost, //, 54.7, none, for, ‘string’,”123”
28 Find the valid and invalid identifiers: 1st_room,False,total marks, Hundred$, Break, length
29 What will be displayed by the following statements?
a) type (0) b) type(int(‘0’)) c) type(3/2) d) print(print(‘hello’))
Page 4 of 5
SUBJECTIVE QUESTIONS
Note: Write Code and at least one Output for each of the Programs given below:
2. Write a program in python to input time in seconds and display the time after converting it into
hours, minutes and seconds.
Sample input: time in seconds 5420
output: 1 hour 30 minutes 20 seconds
3. Write a program in python to calculate and display area and circumference of a circle by taking
radius as input from user. (Area= π r2)
4. Write a python code to input the name and basic salary of an employee. Calculate and display the
name, gross salary and net salary of the employee when:
da= 30% of basic
hra=18% of basic
pf= 12.5% of basic
gross= basic + da + hra
net= gross-pf
5. Write a python code to input temperature in Fahrenheit and display the equivalent Celsius
temperature.
6. Write a python code to input length and breadth of rectangle and display area and perimeter of
the rectangle.
7. Write a python code to enter three sides of scalene triangle and calculate the area of the scalene
triangle by using the formula: area=√s(s-a)(s-b)(s-c) where s= (a+b+c)/2
8. Write a python code to interchange the values of two variables.
9. Write a python code to find average of three numbers.
10. Write a program to display simple interest by taking principal, rate and time as input.
Page 5 of 5