Programming fundamentals
3
0/1

An access control system uses different types of keycards. Each card type has a specific code, as shown in the table below:

CodeCard Type
STStudent
SFStaff
VSVisitor

A program is written to update card permissions. The program:

  • asks the user to enter the card type code
  • calls the prewritten function ValidateCardType() to check whether the entered code is valid
  • if valid, asks the user to input the unique card number, combines the code and number, and calls a procedure UpdatePermission()
01  cardType = input("Enter card type code: ")
02  if (ValidateCardType(cardType)) then
03      cardNumber = input("Enter unique card number: ")
04      cardID = cardType + cardNumber
05      UpdatePermission(cardID)
06  endif

Give the line number that contains the call to the prewritten validation function.

[1]

Programming fundamentals Questions

Practise OCR GCSE Computer Science Programming fundamentals with exam-style questions for GCSE Computer Science. 100 questions, matched to the OCR GCSE Computer Science (J277) specification and written in Component 01 and Component 02 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.

PreviousNext

Programming fundamentals Questions

  1. GCSE
  2. /Computer Science
  3. /Programming fundamentals