Sei sulla pagina 1di 3

Section A

You are advised to spend no longer than 40 minutes answering this section.
Read the context carefully.
DO NOT attempt Tasks1, 2 and 3 now.
Read the context carefully and from your experience of the practical you did during your
sessions answer section A Question 1.

The Fisheries Ministry needs a program for a survey of fish catch. They hired 20 boats which
went to fishing on three different days in different seasons.

Write and test a program for the above survey.

All variables, constants and other identifiers must have meaningful names.
Error messages and other output need to be set out clearly and understandably.

You will need to complete these three tasks. Each task must be fully tested.

TASK 1 Set up arrays

Set-up one dimensional arrays to store:

Boat ID
Boat Name
Fish catch on:
o Day 1
o Day 2
o Day 3
Total fish catch of each boat
Total fish catch of all boats
Input and store the names of 20 boats and ID of each boat.

Input and store the fish catch of each boat on Day 1, Day 2 and Day 3. All the values must be
validated on entry and any invalid value must be rejected.

TASK 2 Calculate

Calculate the total fish catch of each boat and store in the array.
Calculate the average fish catch of all the boats.

TASK 3 Select

Select the boat with the highest fish catch and output the Boat ID, Boat Name and the total
fish catch.
1. a. All variables, constants and other identifiers should have meaningful names.
(i) Declare the arrays to store the Boat ID and Boat Name. [2]

(ii) Declare the arrays to store each boats fish catch on three different days and the
total fish catch of each boat. [3]

b. Show the design of your algorithm to complete Task 1 and Task 2 using pseudocode
or programming statements. Do not include any of the validation checks or input
prompts in your algorithm. [7]
c. Show two different sets of fish catch data that you could use to check the validation
used in Task 1. Explain why you chose each data set. [2]

Set 1

Reason for choice

Set 2

Reason for choice

d. (i) Explain how you select the boat with the highest total fish catch (Task 3). You may
include pseudocode statements to help illustrate your example. [5]

(ii) How does your program work when there is more than one boat having the same
highest total fish catch? Explain using your method given in part (d)(i). [1]

Potrebbero piacerti anche