Morse Code: Programming Questions

A printable worksheet of the following questions are provided in PDF here
An Electronic Answer Document (EAD) is provided for all questions/tasks. Save this file to an accessible location before you start.

These questions refer to the preliminary material and require you to load the skeleton program, but do not require any additional programming.
  1. State the name of an identifier for:
    • A string constant (or variable used as a constant) [1]
    • A subroutine with two parameters [1]
    • A subroutine that returns a tuple (more than one value) [1]
    • A Boolean variable [1]
    • A parameter that is a list [1]
    • An integer list [1]
    • A built-in function called from within the GetMenuOption subroutine [1]
    • The identifier for a user-defined function called from the GetNextLetter subroutine [1]
  1. State the purpose of each of the following lines in the GetTransmission subroutine: [4]
  1. Describe the purpose of the While loop within the SendReceiveMessages subroutine. [2]
  1. Describe the nature and purpose of the Dash data structure in SendReceiveMessages. [3]
  1. Look at the subroutine StripLeadingSpaces. Describe the purpose and use of the variable FirstSignal. [2]
  1. Describe each of the following lines of code, taken from the StripTrailingSpaces subroutine: [6]
  1. Describe the function of the following line from the SendMorseCode subroutine: [3]
  1. Describe the purpose of the except: block in the GetTransmission subroutine.
    State one situation in which the code in the except: block would be executed. [2]
  1. The skeleton program begins with a number of constants (or variables used as constants by convention).
    State two benefits of the program being written in this way. [2]
  1. The StripLeadingSpaces subroutine uses the [1:] operation.
    Describe the purpose of the [1:] operation and explain how it is used in StripLeadingSpaces. [3]
  1. Describe each of the circumstances that would lead to the subroutine ReportError being called. [5]
  1. Describe fully the operation of the Decode subroutine if the value of CodedLetter is -..- [10]