Programming Concept Questions
Programming Concept Questions
CLASS: XI
Exam Questions
Programming
Concepts
Variables & Constants / Data Types / Input & Output / Sequence / Selection /
Iteration / Totalling & Counting / String Handling / Arithmetic, Logical & Boolean
Operators / Procedures & Functions / Local & Global Variables / Library Routines /
Maintaining Programs
Draw a line to link each pseudocode description to the most appropriate pseudocode
statement.
(4 marks)
2
2 Tick (✓) one box to show the named section of a program that performs a specific task.
A. file
B. function
C. parameter
D. process
(1 mark)
Tick (✓) one box which accurately describes the use of the variable Inches
A. answer
B. call
C. parameter
D. response
(1 mark)
3
4 A database table, 2018MOV, is used to keep a record of movie details
Complete the table to identify the most appropriate data type for each field based on
the data shown in the database table, 2018MOV.
CatNo
Title
Genre1
Streaming
4
(2 marks)
X stores a string
(3 marks)
Draw one line to connect each programming concept to the most appropriate
description
5
(3 marks)
7 Tick (✓) one box in each row to identify the most appropriate data type for each
description. Only one tick (✓) per column.
any number
(1 mark)
6
8 An algorithm has been written in pseudocode to calculate a check digit for a four-digit
number. The algorithm then outputs the five-digit number including the check digit. The
algorithm stops when –1 is input as the fourth digit.
01 Flag FALSE
02 REPEAT
03 Total 0
04 FOR Counter 1 TO 4
05 OUTPUT "Enter a digit ", Counter
06 INPUT Number[Counter]
07 Total Total + Number * Counter
08 IF Number[Counter] = 0
09 THEN
10 Flag TRUE
11 ENDIF
12 NEXT Counter
13 IF NOT Flag
14 THEN
15 Number[5] MOD(Total, 10)
16 FOR Counter 0 TO 5
17 OUTPUT Number[Counter]
18 NEXT
19 ENDIF
20 UNTIL Flag
Totalling ...........................................................................
(3 marks)
7
9 The variables P and Q are used to store data in a program. P stores a string. Q stores a
character.
Write pseudocode statements to declare the variables P and Q, store "The world" in P
and store 'W' in Q
(2 marks)
(2 marks)
8
Medium Questions
1 A function LENGTH(X) finds the length of a string X and a function SUBSTRING(X,Y,Z) finds
a substring of X starting at position Y and Z characters long. The first character in the
string is position 1.
Write a pseudocode statement to extract the word Computer from P and store it in the
variable F.
(2 marks)
2 Explain the difference between a WHILE … DO … ENDWHILE and a REPEAT … UNTIL loop
B ← FALSE
INPUT Num
FOR Counter ← 1 TO 12
IF A[Counter] = Num
THEN
B ← TRUE
ENDIF
NEXT Counter
(3 marks)
9
(4 marks)
(4 marks)
The string "The beginning is the most important part" is stored in Phrase
OUTPUT LENGTH(Phrase)
OUTPUT UCASE(Phrase)
(2 marks)
10
6 The variables P and Q are used to store data in a program. P stores a string. Q stores a
character.
find the position of Q in the string P (the first character in this string is in position 1)
(4 marks)
11
Hard Questions
1 Using a single loop, write an algorithm in pseudocode to output 50 names that have
been stored in the array, Name[]
(3 marks)
store the string "The beginning is the most important part" in Phrase.
(3 marks)
12
3 A program needs to make sure the value input for a measurement meets the following
rules:
The program needs editing to include a double entry check for the value input.
The input value needs to be stored in the variable Measurement Write pseudocode to
perform the double entry check until a successful input is made.
(3 marks)
4 An algorithm has been written in pseudocode to calculate a check digit for a four-digit
number. The algorithm then outputs the five-digit number including the check digit. The
algorithm stops when –1 is input as the fourth digit.
01 Flag FALSE
02 REPEAT
03 Total 0
04 FOR Counter 1 TO 4
05 OUTPUT "Enter a digit ", Counter
06 INPUT Number[Counter]
07 Total Total + Number * Counter
08 IF Number[Counter] = 0
09 THEN
10 Flag ← TRUE
11 ENDIF
12 NEXT Counter
13 IF NOT Flag
14 THEN
15 Number[5] MOD(Total, 10)
16 FOR Counter 0 TO 5
17 OUTPUT Number[Counter]
13
18 NEXT
19 ENDIF
20 UNTIL Flag
The algorithm does not check that each input is a single digit.
Identify the place in the algorithm where this check should occur.
Write pseudocode for this check. Your pseudocode must make sure that the input is a
single digit and checks for –1
(4 marks)
14