Note AcademyNote Academy

Computer Science · May / June 2022 · Paper 21 · Question 1

0478

As printed in the paper

Show the answer and mark scheme
  • 1(a)[5]

    One mark per mark point, max five

    Data Structure(s), max two

    MP1

    arrays

    MP2

    variable(s) / constant(s)

    Further description, max three

    MP3

    name(s) one or more

    MP4

    sample data for appropriate arrays or variables

    MP5

    use(s) one or more

    Additional data structure description using the same data structure type, max one

    MP6

    two or more full descriptions of the data structure including name, sample data and use

    For example:

    An array (1) named FirstName (1) to store the first names of the members (1) such as James (1). A variable (1) could also be used to enter whether or not they wish to volunteer. (5 marks)

    A variable (1) named FirstName (1) to input the first names of the members (1) such as James (1). A variable could also be used to enter whether or not they wish to volunteer, with sample data of ‘yes’ (1). (5 marks)

    Task 1 – becoming a member of Friends of Seaview Pier

    Set up a system to enable people to become members of Friends of Seaview Pier and for each new member enter:

    their first name and last name
    whether or not they wish to work as a volunteer
    if they choose to volunteer, identify the area from:

    o

    the pier entrance gate

    o

    the gift shop

    o

    painting and decorating

    the date of joining
    whether or not they have paid the $75 fee.

    All of this information needs to be stored using suitable data structures.

  • 1(b)[3]

    Explanation of how each was done. Code is allowed, but must be fully explained.

    One mark per mark point, max three

    MP1

    add/use a (new) variable/array to total the membership fee money // total number of members who have paid MP2

    initialise the totalling variable to 0 at the start of the program

    MP3

    check whether the new member has paid the $75 fee using a conditional statement

    MP4

    …if they have paid, and the amount paid is being totalled, add 75 to the current running total of the membership fee total

    MP5

    …if they have paid, and the number of paid members is being totalled, add 1 to the total number of members who have paid

    MP6

    …if they have paid, and the number of paid members is being totalled, multiply total by 75, to give total paid.

  • 1(c)[3]

    Any code must include a description of what it is for.

    One mark per mark point, max three

    Max two for just naming different appropriate validation checks

    MP1

    apply a presence check // to ensure that data has been entered (to the question do you want to work as a volunteer?)

    MP2

    apply a type check // to ensure that data has been entered of the correct data type e.g. integer if the response required is 1 or 0

    MP3

    checking the valid inputs would be either yes or no // apply a check to ensure that the data matches the expected input

    MP4

    the valid inputs would be to choose in which area the new member wishes to volunteer e.g. a list of areas MP5

    if input is not valid, an error message is output (and a new input is requested)

    MP6

    if input is valid, the program continues

  • 1(d)[5]

    One mark per mark point, max five

    MP1

    input for sponsor’s name / name taken from previous data // input for message on plaque

    MP2

    both inputs correct with appropriate prompts // input for message on plaque correct with appropriate prompt and name taken from previous data

    MP3

    output of input(s) for confirmation …

    MP4

    … method for sponsor to confirm that the input(s) are correct

    MP5

    method to enable re-entry of message on plaque if errors made

    MP6

    charge of $200 acknowledged / charged / confirmed / displayed

    MP7

    (name and) message stored in arrays

    MP8

    array index incremented for next sponsor

    Task 3 – sponsoring a wooden plank

    Add an additional option to the program in Task 1 to enable the pier’s wooden planks to be sponsored. Separate data structures should be used to store the names of the individuals and the short messages they would like to have written on their brass plaque. An output would display everything that was input for the sponsor to confirm. If errors are found, the program should allow data to be re-entered. Once complete, the data is stored and the sponsor is charged $200. Example answer

    ArrayIndex ← 0 //initial array's index

    Check ← "N"

    WHILE Check <> "Y"

    OUTPUT "Enter your name"

    INPUT Name

    OUTPUT "Enter the message you would like on your brass plaque"

    INPUT Message

    OUTPUT "The data you have entered is, name: ", Name, " and your

    message for the plaque is: ", Message

    OUTPUT "Is this correct (Y or N)"

    INPUT Check

    IF Check <> "Y"

    THEN

    OUTPUT "The data entered is incorrect, please re-enter"

    ENDIF

    ENDWHILE

    PlankName[ArrayIndex] ← Name

    Message[ArrayIndex] ← Message

    ArrayIndex ← ArrayIndex + 1

    OUTPUT "The fee for this service is $200"

    //some method of paying the fee or acknowledgement of the fee

  • 1(e)[4]

    Explanation of how each was done. Code is allowed, but must be fully explained.

    One mark per mark point, max four

    MP1

    a menu is provided/options are displayed so that the user can choose which of the lists they wish to see MP2

    the user inputs a number/code as shown on the menu corresponding to their menu choice

    MP3

    attempt to validate input

    MP4

    … if it does not match an option, give an error message and ask for re-input

    MP5

    … if it matches an option, a range of IF statements/conditional statements/CASE statement are/is used to compare the input with the available options

    MP6

    … output the chosen list e.g. using a loop to output the contents of the appropriate first and second name arrays corresponding to the user input

    MP7

    identification of empty list and appropriate action

    Task 2 – using the membership data

    Extend the program in Task 1 so that a list of the first and last names of members can be output in any of the following categories:

    Members who have chosen to work as volunteers.
    Volunteers who would like to work at the pier entrance gate.
    Volunteers who would like to work in the gift shop.
    Volunteers who would like to help with painting and decorating tasks.
    Members whose membership has expired (they have not re-joined this year).
    Members who have not yet paid their $75 fee.

    Section B

Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.