Algorithm design and problem-solving – IGCSE Computer Science (0478)

199 questions · page 4 of 14 · Clear filters

0 / 0Answer a question to start your score.
Quick quiz (10)Saved 0
Advertisement
46
0478/23/O/N/24 · Question 1Oct/Nov 2024Paper 231 marks
Loading question…
Question text

1
Tick (✓) one box to show which of the following is used to validate data on input.
A
checksum
B
double entry check
C
type check
D
visual check
[1]

47
0478/23/O/N/24 · Question 2Oct/Nov 2024Paper 231 marks
Loading question…
Question text

2
Tick (✓) one box to show a method used to construct a solution to a problem.
A
abstraction
B
structure diagram
C
test data
D
variable
[1]

48
0478/23/O/N/24 · Question 5Oct/Nov 2024Paper 236 marks
Loading question…
Question text

5
One stage of the program development life cycle is the analysis stage.
Identify and describe two other stages of the program development life cycle.
Stage …
Description …
…
…
…
…
Stage …
Description …
…
…
…
…
[6]
ĬÏĊ®Ġ´íÈõÏĪÅĊàù¸þ×

Advertisement
49
0478/23/O/N/24 · Question 7Oct/Nov 2024Paper 239 marks
Loading question…
Question text

7
A programmer is testing a program that requires a positive value between 1 and 100 inclusive to
be entered. The range check in the program is to be tested.
Identify three different types of test data to be used.
For each type of test data, give an example of the value(s) to be used and the expected outcome.
Type 1 …
Example …
Outcome …
…
Type 2 …
Example …
Outcome …
…
Type 3 …
Example …
Outcome …
…
[9]
ĬÏĊ®Ġ´íÈõÏĪÅĊÞù¸Ā×

50
0478/23/O/N/24 · Question 9Oct/Nov 2024Paper 234 marks
Loading question…
Question text

9
A flowchart checks that values stored in three variables are identical.
If they are different, the highest value is stored in all three variables.
START
No
Is A = B AND
STOP
B = C ?
Yes
Yes
Is A >= B OR
B
A
A >= C ?
C
A
No
Yes
Is B >= A AND
A
B
B >= C ?
C
B
No
A
C
B
C
Identify four errors in the flowchart and suggest a correction for each error. You may label each
error on the diagram with the corresponding error number.
Error 1 …
Correction …
…
Error 2 …
Correction …
…
Error 3 …
Correction …
…
Error 4 …
Correction …
…
[4]
ĬÓĊ®Ġ´íÈõÏĪÅĊßûµþ×

51
0478/21/M/J/24 · Question 1May/June 2024Paper 211 marks
Loading question…
Question text

1
Tick ( ü ) one box to complete this sentence.
A validation check to make sure that an email address contains an ‘@’ sign is a
A
range check.
B
visual check.
C
presence check.
D
format check.
[1]

52
0478/21/M/J/24 · Question 5May/June 2024Paper 215 marks
Loading question…
Question text

5
Write the pseudocode statements to perform this task:
•
accept the input of a whole number from 1 to 4 inclusive
•
use a CASE statement to:
○ output the number (1 to 4 inclusive) that was entered
○ output the word “ERROR” if a 1 to 4 inclusive number was not entered.
…
…
…
…
…
…
…
…
…
… [5]

53
0478/21/M/J/24 · Question 6May/June 2024Paper 2138 marks
Loading question…
Question text

6
The flowchart represents an algorithm.
START
Result
Limit DIV 2 + 1
INPUT
Limit
OUTPUT
Numbers[Result]
Count
1
INPUT
Numbers[Count]
STOP
Count
Count + 1
No
IS Count >
Limit?
No
IS Numbers[Count] >
Yes
Numbers[Count + 1]?
Flag
TRUE
Yes
Swap
Numbers[Count]
IS Flag =
No
TRUE?
Numbers[Count]
Numbers[Count + 1]
Yes
Flag
False
Numbers[Count + 1]
Swap
Count
1
Flag
True
IS Count >
Yes
No
Limit – 1?
Count
Count + 1
(a) Complete the trace table for the input data:
7, 47, 50, 52, 60, 80, 63, 70
Numbers
Limit
Count
[1]
[2]
[3]
[4]
[5]
[6]
[7]
Flag
Swap
Result
OUTPUT
[7]
(b) Outline the processes involved in the algorithm shown in the flowchart on page 6.
…
…
…
…
…
… [3]

Advertisement
54
0478/22/M/J/24 · Question 1May/June 2024Paper 221 marks
Loading question…
Question text

1
Tick (✓) one box to identify a method used to design and construct a solution to a computing
problem.
A
analysis
B
coding
C
flowchart
D
testing
[1]

55
0478/22/M/J/24 · Question 3May/June 2024Paper 223 marks
Loading question…
Question text

3
Identify three different tasks in the analysis stage of the program development life cycle.
1 …
…
2 …
…
3 …
…
[3]

56
0478/22/M/J/24 · Question 4May/June 2024Paper 2210 marks
Loading question…
Question text

4
A program needs to make sure the characters input for a product code meet these rules:
•
The product code is six characters in length.
•
The first two characters must be “PD”.
•
The last four characters must be a number in the range 1000 to 9999 inclusive.
(a) Identify three validation checks and state how each check would make sure the product code
met one of these rules.
Check 1 …
…
…
Check 2 …
…
…
Check 3 …
…
…
[6]
(b) The program design will include a pseudocode algorithm. Assume that the product code is
stored in the variable Product
(i)
Write the pseudocode to make sure that the product code is six characters in length.
…
…
…
…
… [2]
(ii)
Write the pseudocode to make sure that the first two characters of the product code are
“PD”.
…
…
…
…
… [2]

57
0478/22/M/J/24 · Question 6May/June 2024Paper 228 marks
Loading question…
Question text

6
Totalling and counting are standard methods of solution.
Numbers are input. The number 9999.9 is the last number to be input and is ignored.
(a) Write an algorithm in pseudocode to total the numbers input and to output the total.
You do not need to validate the input.
…
…
…
…
…
…
…
…
… [4]
(b) Write an algorithm in pseudocode to count and output the number of input values that are
greater than 100. You do not need to validate the input.
…
…
…
…
…
…
…
…
…
… [4]

58
0478/22/M/J/24 · Question 9May/June 2024Paper 2237 marks
Loading question…
Question text

9
This flowchart represents an algorithm.
START
A
FALSE
B
1
No
IS List[B] >
T
List[B]
List[B + 1]?
Yes
List[B]
List[B + 1]
List[B + 1]
T
A
TRUE
B
B + 1
No
IS B =
5?
Yes
Yes
IS A =
TRUE?
No
STOP
(a) The array List[1:5] used in the flowchart contains this data:
List[1]
List[2]
List[3]
List[4]
List[5]
15
17
20
5
9
,
,
Complete the trace table using the data given in the array.
A
B
List[1] List[2] List[3] List[4] List[5]
T
15
17
20
5
9
[5]
(b) Describe what the algorithm represented by the flowchart is doing.
…
…
…
… [2]

Advertisement
59
0478/23/M/J/24 · Question 1May/June 2024Paper 231 marks
Loading question…
Question text

1
Tick (3) one box to complete this sentence.
This flowchart symbol
A
represents a subroutine.
B
represents a decision.
C
represents an input/output.
D
represents a terminator.
[1]

60
0478/23/M/J/24 · Question 5May/June 2024Paper 2313 marks
Loading question…
Question text

5
The flowchart represents an algorithm.
START
L
0
S
10000
T
0
A
0
INPUT
Limit
Count
1
INPUT
Value
IS
IS
No
No
Value < S
Value > L
?
?
Yes
Yes
L
Value
S
Value
T
T + Value
IS
No
Count >
Count
Count + 1
Limit ?
Yes
T / Limit
A
OUTPUT "L = ", L, " S = ",
S, " T = ", T, " A = ", A
STOP
(a) Complete the trace table for the input data:
10, 30, 18, 8, 25, 12, 17, 2, 50, 15, 5
L
S
T
A
Limit
Count
Value
OUTPUT
[6]
(b) Outline the purpose of the algorithm.
…
…
…
… [2]
(c) Explain why the identifiers L, S, T and A may not be appropriate to use as identifiers and how
they could be improved.
…
…
…
…
…
… [3]
(d) State a more appropriate identifier for each of the variables L, S, T and A
Original identifier
Improved identifier
L
S
T
A
[2]

Advertisement