Four program modules form part of a program for a library. A description of the relationship between the modules is summarised as follows: Module name | Description --- | --- UpdateLoan() | • Calls either LoanExtend() or LoanReturn() LoanExtend() | • Called with parameters LoanID and BookID | • Calls CheckReserve() to see whether the book has been reserved for another library user | • Returns TRUE if the loan has been extended, otherwise returns FALSE CheckReserve() | • Called with BookID | • Returns TRUE if the book has been reserved, otherwise returns FALSE LoanReturn() | • Called with parameters LoanID and BookID | • Returns a REAL (which is the value of the fine to be paid in the case of an overdue loan)
- (a)Draw a structure chart to show the relationship between the four modules and the parameters passed between them.[5]
- (b)The definition for module LoanReturn() is amended as follows: Module name | Description --- | --- LoanReturn() | Called with parameters LoanID, BookID and Fine | The module code checks whether the book has been returned on time | and then assigns a new value to Fine • LoanID and BookID are of type STRING • Fine is of type REAL Write the pseudocode header for the amended module LoanReturn().[2]
- (c)A program will: • input 50 unique integer values • output the largest value • output the average of the values excluding the largest value. Draw a program flowchart to represent the algorithm. Variable declarations are not required. It is not necessary to check that each input value is unique.[6]
Mark scheme
Marking points from the official mark scheme (May/June 2021). The mark or mark type is shown in brackets.
- [1] All four boxes correctly labelled and positioned
- [1] Selection diamond (only on UpdateLoan and no iteration arrows)
- [1] Parameters to and from LoanExtend()
- [1] Parameters to and from CheckReserve()
- [1] Parameters to and from LoanReturn()
- [1] PROCEDURE LoanReturn
- [1] (LoanID, BookID : STRING,
- [1] BYREF Fine : REAL)
- [1] Initialise MAX to first value input
- [1] Set Total to zero
- [1] Input 49 more values (or 50 values in total)
- [1] Sum all values input
- [1] Set new MAX when Input value > MAX in a loop
- [1] Sum all but largest (or subtract MAX from total), calculate and output average
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →