Section 2B Summary Questions


Previous: 2B.08 - Translators



Describe what is meant by structured programming. [3]

Tap/click to reveal Breaking down the main program into smaller, manageable modules, ✓
and designing, coding, and testing each module separately ✓
before putting it all back together. ✓



Describe two suitable validation checks for a postcode input. [4]

Tap/click to reveal Any two checks named and explained from:

- Presence check ✓
  to see if the postcode has been left blank ✓
- Format check ✓
  to see if the postcode contains only letters and numbers ✓
- Length check ✓
  to see if the postcode is between 5 and 7 characters ✓
- Format check ✓
  to see if the postcode ends with a number and two letters ✓



Describe how a good test plan can help find logic errors. [3]

Tap/click to reveal A good test plan will check most of the possible paths of the program. ✓
It should test normal, boundary, and erroneous data. ✓
If any of the outputs are not equal to the expected output, there is a logic error. ✓



Explain two advantages of low-level programming languages. [4]

Tap/click to reveal Any two advantages described and explained from:

- Low-level languages have more control over the hardware ✓
  so e.g., the programmer can control exactly how memory is used in the program ✓
- Very efficient code can be written for a particular type of processor ✓
  so programs in low-level languages generally execute faster and use less memory than programs in high-level languages ✓
- Commands in machine code can be executed directly by the computer ✓
  so a translator is not required ✓



Explain how an interpreter works. [4]

Tap/click to reveal The interpreter reads in the file statement by statement. ✓
It calls machine code subroutines to carry out commands. ✓
The interpreter stops if it finds a runtime error ✓
No machine code is outputted by the interpreter so the program needs to be translated each time it is executed. ✓





Next: 3.01 - Storage Units



© Rujul Nayak 2024-