Question 1 Report
A wildlife charity uses a program to record sea turtle nest inspections. Fig. 1 shows its first decomposition. Rangers enter a nest code, count eggs and record whether tracks are visible. The charity wants reliable data, but the final display should show a simple warning only when an inspection needs attention.
(a) Identify the module that should write the inspection record to a file. [2]
(b) Give two validation checks that can be applied to the egg-count input. [2]
(c) Complete the abstraction by stating two data items that the warning display needs if the egg count is below 20. [2]
(d) Write pseudocode for a selection statement that displays the word CHECK when eggCount is below 20. [4]
(a) The module is Save and display, because it includes the responsibility for saving the completed inspection record, that is, updating the file. [2]
(b) Two appropriate validation checks are that the egg count is an integer and that it is greater than or equal to 0. A sensible maximum range check or rejecting blank input would also be valid. [2]
(c) The warning display needs the nest code, so rangers know which nest needs attention, and the egg count or warning status, to show why the warning was produced. [2]
(d) A valid selection statement is:
IF eggCount < 20 THEN DISPLAY "CHECK" ENDIF
The comparison is strict because exactly 20 is not below 20. [4]
Everything you need to excel in your exams