Note AcademyNote Academy

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

0478

As printed in the paper

The question as text

All variables, constants and other identifiers must have meaningful names.

Read automatically from the paper; the printed page above is exact.

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

    Any meaningful array related to Task 1 – one mark (max two) e.g.

    ItemCode

    Description

    Correct purpose for each array related to Task 1 – one mark (max two) e.g.

    …to store the item codes

    …to store the descriptions of the items for sale

  • 1(a)(ii)[4]

    Any meaningful variable related to Task 1 – one mark (max two) e.g.

    PurchaseItem

    TotalPrice

    Correct purpose for each variable related to Task 1 - one mark (max two) e.g.

    … to allow input of an item/code for purchase

    … to store/calculate the total price of the transaction

  • 1(b)[2]

    Any one correct statement e.g.

    The Code data is made up of letters/alphabetic characters/not numbers
    Real data must have numerical value/would not be used in calculations

    One mark for:

    String
  • 1(c)[5]

    Any five from

    Input with message to allow choice of mobile device
    Attempt to validate input to check for valid item code
    Accurate validation of input to check for valid item code
    Determination of whether device is phone or tablet
    Restriction to only allow input for SIM card required if mobile device is a phone
    Input with message to find out if a SIM card is required

    Example answer

    OUTPUT "Which type of phone or tablet would you like? Input the Item Code"

    DeviceFlag ← False

    WHILE DeviceFlag = False

    INPUT DeviceCode

    Count ← 0

    WHILE Count<10 DO

    IF DeviceCode = ItemCode[Count]

    THEN

    IF Count < 6

    THEN

    DeviceType ← "Phone"

    ELSE

    DeviceType ← "Tablet"

    ENDIF

    DeviceFlag ← True

    Count ← 10

    ENDIF

    Count ← Count + 1

    ENDWHILE

    IF DeviceFlag = False

    THEN

    OUTPUT "Your code doesn’t exist, please try again"

    ENDIF

    ENDWHILE

    IF DeviceType ← "Phone"

    THEN

    OUTPUT "Would you like a SIM Card? (Answer Y or N)"

    INPUT SimRequired

    ENDIF

  • 1(d)[5]

    Any five from

    Explanation of finding if more than one device is purchased
    Explanation of application of device discount
    Explanation of calculating the discount(s) and finding the new price
    Explanation of outputting new total
    Explanation of outputting amount saved
    Explanation of messages used

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