Cambridge AS Level Computer Science 9618 · 12.2 Program Design

Q11 · 9618/22/M/J/21 Q2

Worked solution from the Software Development Paper 2 Problem-solving and Programming booklet, Part 2 of 3.

Q119618/22/M/J/21original Q2Structured · 11 marks
Question 2 from 9618/22/M/J/21

Worked solution

(a)(i)

Count the arrows in the diagram. S1 to S2, S2 to S3 and S1 to S3 change state; the loop on S2 does not. The two arrows with | Activate pump and | Deactivate pump have outputs. The arrow into S1 from the dot is the start arrow. The double circle is the end state.

Answer
The number of transitions that result in a different state3
The number of transitions with associated outputs2
The label that should replace 'X'Start
The final or halting stateS3

Different state: 3 [1]

Transitions with outputs: 2 [1]

Label for X: Start [1]

Final state: S3 [1]

(a)(ii)

From S1, the first Low level detected goes to S2 and activates the pump (one output). The next three Low level detected inputs loop on S2 and give no output.

Number of outputs: 1 [1]

Current state: S2 [1]

(b)(i)

Write three items that belong to one loan, such as User ID (or username), Book ID and date of loan (or return date).

At least one correct item [1]

All three correct items [1]

(b)(ii)

Write data the system needs but that is not part of each loan, for example:

The user's name (or address or phone number), or the book title (or author, ISBN, publisher, rack number). Any one of these. [1]

(b)(iii)

Write two other things the system does to the loan data, any two of:

Create a loan (borrow a book) [1]

Return a book (or send an email or letter to a user about an overdue book, or view the loan history of a book or user) [1]

KEY IDEARead a state-transition diagram arrow by arrow: input before the bar, output after it, and an arrow back to the same state is a loop.
TOTAL 11 marks

Official mark scheme

Mark scheme for 9618/22/M/J/21 question 2
VIDEO
▶ Whole paper

Video solution of the whole paper · by Papersdock. Tap the picture to open it on YouTube.

Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.