AmbifulWorksheets
Practice that never repeats
CBSE · Class 11 · Computer Science

Introduction to Problem Solving

Standard difficulty · 20 questions · 40 marks · Time: 39 minutes

Name: Date: Score: ____ / 40

Show your working for Sections B and C. Answers are on the last page — try every question first!

Section A — Choose the correct answer8 × 1 = 8 marks
1.
Which is the first step in solving a problem with a computer?
  1. testing
  2. debugging
  3. coding
  4. analysing the problem
2.
What does this pseudocode print?
 1 INPUT N (N = 32)
 2 SET S = 0
 3 SET I = 3
 4 WHILE I <= N
 5 SET S = S + I
 6 SET I = I + 3
 7 END WHILE
 8 PRINT S
  1. 165
  2. 135
  3. 198
  4. 166
3.
How many times does the loop run?
 1 SET P = 1
 2 SET C = 0
 3 WHILE P < 70
 4 SET P = P * 3
 5 SET C = C + 1
 6 END WHILE
 7 PRINT C, P
  1. 3
  2. 5
  3. 23
  4. 4
4.
What is an algorithm written in plain structured English, close to code called?
  1. analysing the problem
  2. sequence
  3. pseudocode
  4. an algorithm
5.
What does this pseudocode print?
 1 INPUT A, B, C (A = 45, B = 46, C = 49)
 2 SET M = A
 3 IF B < M THEN SET M = B
 4 IF C < M THEN SET M = C
 5 PRINT M
  1. 44
  2. 46
  3. 49
  4. 45
6.
This pseudocode should print the factorial of N (1 × 2 × … × N), but for N = 8 it prints 5040 instead of 40320. Which line is wrong?
 1 INPUT N (N = 8)
 2 SET P = 1
 3 SET I = 1
 4 WHILE I < N
 5 SET P = P * I
 6 SET I = I + 1
 7 END WHILE
 8 PRINT P
  1. line 2
  2. line 3
  3. line 4
  4. line 5
7.
To check whether N = 293 is prime, method A divides N by every number from 2 to N − 1, and method B divides only by the numbers from 2 to the whole part of √N. (293 is prime, so neither stops early.) How many divisions does method A make?
  1. 293
  2. 292
  3. 291
  4. 16
8.
Which flowchart symbol is used for the direction of flow?
  1. arrow (flow line)
  2. small circle (connector)
  3. diamond (decision box)
  4. oval (terminal)
Section B — Short answer8 × 2 = 16 marks
9.
List the steps of problem solving in order.
10.
What does this pseudocode print?
 1 INPUT N (N = 417588)
 2 SET R = 0
 3 WHILE N > 0
 4 SET R = R + 1
 5 SET N = N DIV 10
 6 END WHILE
 7 PRINT R
11.
Trace this pseudocode. (a) What does it print? (b) How many times does the loop run?
 1 INPUT A, B (A = 144, B = 227)
 2 WHILE B ≠ 0
 3 SET R = A MOD B
 4 SET A = B
 5 SET B = R
 6 END WHILE
 7 PRINT A
12.
Put the steps for swapping the values of A and B in order. Write the letters in order.
(a) Set A to B
(b) Set temp to A
(c) Set B to temp
(d) Print A and B
13.
Linear search looks for 26 in the list 83, 38, 26, 16, 76, 95, 23, 89, checking from the left. (a) How many comparisons are made? (b) Is 26 found (Yes or No)?
14.
What does this pseudocode print? (It adds 1 + X + X2 + … + Xᴺ.)
 1 INPUT X, N (X = 2, N = 3)
 2 SET S = 0
 3 SET T = 1
 4 FOR I = 0 TO N
 5 SET S = S + T
 6 SET T = T * X
 7 END FOR
 8 PRINT S
15.
What values of A and B are printed?
 1 SET A = 42
 2 SET B = 46
 3 SET T = A
 4 SET A = B
 5 SET B = T
 6 SET A = A + 9
 7 SET B = B * 2
 8 PRINT A, B
16.
Decompose this problem: 51 students go on a trip. The bus costs Rs 4,080 in all, an entry ticket is Rs 140 each and lunch is Rs 120 each. (a) What is the bus cost per student? (b) What do the ticket and lunch cost per student? (c) What is the total cost per student?
Section C — Word problems4 × 4 = 16 marks
17.
Explain the steps of problem solving with the example of finding the average marks of a class.
18.
Trace this pseudocode.
 1 INPUT N (N = 10)
 2 SET S = 0
 3 SET I = 2
 4 WHILE I <= N
 5 SET S = S + I * I
 6 SET I = I + 3
 7 END WHILE
 8 PRINT S
(a) What does it print? (b) How many times does the loop run? (c) What is I when the loop stops?
19.
This pseudocode should print the sum 1 + 2 + … + N.
 1 INPUT N (N = 22)
 2 SET S = 0
 3 SET I = 1
 4 WHILE I <= N
 5 SET S = S + I
 6 SET I = I + 2
 7 END WHILE
 8 PRINT S
(a) What does it actually print for N = 22? (b) Which line number is wrong? (c) What should it print?
20.
Two algorithms check whether 389 is prime. A divides it by every number from 2 to 388; B divides only by 2 up to the whole part of √389. (389 is prime.) (a) How many divisions does A make? (b) How many does B make? (c) How many fewer does B make?
AmbifulWorksheets
Practice that never repeats
CBSE · Class 11 · Computer Science

Answer key

Introduction to Problem Solving · AW-11CS-PRS-2026-V1 · For parents — fold back or tear off before handing the sheet to your child.

QAnswerWorking
1(d) analysing the problem—
2(a) 165I takes the values 3, 6, 9, 12, 15, 18, 21, 24, 27, 30
3(d) 4P: 1, 3, 9, 27, 81
4(c) pseudocode—
5(d) 45M keeps the smaller value each time
6(c) line 4line 4 should be: WHILE I <= N
7(c) 2912 to 292: 291 divisions
8(a) arrow (flow line)—
9Analyse the problem, develop an algorithm, code it, then test and debug the program.—
106the number of digits
11(a) 1; (b) 9the GCD of 144 and 227 by Euclid's method
12b, a, c, dSet temp to A → Set A to B → Set B to temp → Print A and B
13(a) 3; (b) Yes26 is item 3
14151 + 2 + 4 + 8
15A = 55, B = 84after the swap A = 46, B = 42
16(a) Rs 80; (b) Rs 260; (c) Rs 3404,080 ÷ 51; 140 + 120; add the parts
17Analyse: inputs are the marks, output the average; algorithm: add all marks, divide by the count; code it; test with known marks and debug any error.—
18(a) 93; (b) 3; (c) 11I: 2, 5, 8, then 11 > 10
19(a) 121; (b) 6; (c) 253line 6 should be: SET I = I + 1
20(a) 387; (b) 18; (c) 369√389 ≈ 19.72