Question bank › IB Computer Science › B1 Computational thinking

Computational thinking, problem specification and tracing flowcharts

Answer on paper first, then reveal the mark scheme one mark at a time.

1Core4 marks

A company is designing a mobile app that shows the quickest bus route between two stops in a city.

(a) Explain how abstraction could be used when designing the app's route map. [2]

(b) Explain how decomposition could be used when developing the app. [2]

2Core4 marks

The diagram shows five flowchart symbols, labelled A to E.

(a) Identify the letter of the symbol that is used to represent:

(i) a step where the algorithm chooses between two routes; [1]

(ii) reading a value entered by the user. [1]

(b) State the name of symbol E and outline its purpose in a flowchart. [2]

ABCDE
3Standard5 marks

The flowchart shows an algorithm. div gives the whole-number result of a division and mod gives the remainder.

(a) Copy and complete the trace table for the input N = 3150. [3]

NDRN > 0 ?
31500

(b) State the output. [1]

(c) Outline the purpose of the algorithm. [1]

StartINPUT NR ← 0N > 0 ?YesD ← N mod 10R ← R × 10 + DN ← N div 10NoOUTPUT REnd
Stuck on Computational thinking, problem specification and tracing flowcharts?

Get it sorted in a free 30-minute session

We work through your weakest questions on this topic on Zoom. I reply the same day.

4Standard6 marks

A community library wants a system that automatically sends a text message to members whose borrowed books are overdue. The library has 4000 members, a fixed budget of £2000 and wants the system working before the start of the next school term.

(a) Distinguish between a constraint and an objective in a problem specification, using an example of each from this scenario. [2]

(b) Identify one input specification and one output specification for the system. [2]

(c) Outline two evaluation criteria that could be used to judge whether the finished system is successful. [2]

5Core4 marks

A cinema has 20 rows of seats. Row 1 has 12 seats, row 2 has 14 seats, row 3 has 16 seats, and the pattern continues to the back row.

(a) Describe what is meant by pattern recognition in computational thinking. [2]

(b) Use the pattern to determine the number of seats in row 20. [1]

(c) Outline how recognising this pattern makes it easier to design an algorithm that works out the total number of seats in the cinema. [1]

6Hard7 marks

The flowchart shows an algorithm that reads a list of positive whole numbers. The value −1 is used to end the list.

(a) The values 7, 12, 3, 12, 9, −1 are input in this order. Copy and complete the trace table and state the output. [4]

XX = −1 ?MAXC
00

(b) State the purpose of the algorithm. [1]

(c) A student inputs −4, −9, −1. Determine the output and explain why it is not the intended result. [2]

StartMAX ← 0C ← 0INPUT XAX = −1 ?YesOUTPUTMAX, CEndNoX > MAX ?YesMAX ← XC ← 1ANoX = MAX ?YesC ← C + 1ANoA
7Stretch8 marks

The flowchart shows an algorithm. div gives the whole-number result of a division and mod gives the remainder.

(a) Trace the flowchart for the input N = 60. Copy and complete the trace table, showing every output. [4]

NFN mod F = 0 ?Output
602

(b) The input is now N = 97, which is a prime number. Determine the output and the number of times the decision N mod F = 0 ? is evaluated. [2]

(c) Suggest a change to the algorithm that would greatly reduce the number of decisions evaluated for large prime inputs, and explain why the outputs are still correct. [2]

StartINPUT NF ← 2N > 1 ?NoEndYesN mod F= 0 ?NoF ← F + 1YesOUTPUT FN ← N div F
8Standard5 marks

A school's exams officer must produce the timetable for the summer exams by hand, without using any software. There are 35 subjects, 6 exam halls of different sizes and some students take up to 11 subjects.

Explain how the exams officer could apply computational thinking to solve this problem, even though no programming is involved. [5]

9Standard5 marks

A teacher wants a flowchart that reads the marks of five students and outputs their mean. The flowchart contains a logic error.

(a) The marks available to be input are 8, 6, 9, 7, 10, 4, in that order. Determine the output of the flowchart as drawn. [2]

(b) Explain the logic error. [1]

(c) Outline two different single changes, each of which would correct the error. [2]

StartTOTAL ← 0COUNT ← 0INPUT MTOTAL ← TOTAL + MCOUNT ← COUNT + 1COUNT > 5 ?NoYesAVG ← TOTAL / 5OUTPUT AVGEnd
10Hard6 marks

The flowchart shows a search algorithm. The array A holds the following nine values, indexed from 0:

Index012345678
A[Index]3811152126303441

(a) Trace the flowchart when TARGET = 26. Copy and complete the trace table and state the output. [3]

LOWHIGHMIDA[MID]POS
08−1

(b) Determine the output when TARGET = 9, and state how many times the decision A[MID] = TARGET ? is evaluated. [2]

(c) State one condition that the data in A must meet for this algorithm to work correctly. [1]

StartINPUT TARGETLOW ← 0HIGH ← 8POS ← −1ALOW ≤ HIGHAND POS = −1 ?NoOUTPUT POSEndYesMID ← (LOW + HIGH) div 2A[MID] =TARGET ?YesPOS ← MIDANoA[MID] <TARGET ?YesLOW ← MID + 1ANoHIGH ← MID − 1A

Stuck on this topic?

Book a free 30-minute session on WhatsApp and we'll find exactly which step is costing you the marks. Or build a timed paper on it.

Free 30-minute session