Section A: Short-Answer Questions
High-Level Language Definition and Example (2 marks):
A high-level programming language is human-readable and abstract, making it easier to write and understand. [1 mark]
Example: Python or Java. [1 mark]
Explanation: High-level languages hide hardware details, focusing on problem-solving.
Low-Level Language Definition and Example (2 marks):
A low-level programming language is closer to machine instructions, hardware-specific, and harder to read. [1 mark]
Example: Assembly language or machine code. [1 mark]
Explanation: Low-level languages provide direct control over hardware.
Machine Code (1 mark):
Machine code is binary instructions (0s and 1s) directly executed by the CPU. [1 mark]
Explanation: It's the lowest level, not human-readable.
Assembly Language (1 mark):
Assembly language uses mnemonics (e.g., ADD, MOV) to represent machine code instructions. [1 mark]
Explanation: It's a step above machine code but still low-level.
Translators for High-Level Languages (2 marks):
Compiler and interpreter. [1 mark each]
Explanation: These convert high-level code to machine code.
Section B: Explanation Questions
Differences Between High-Level and Low-Level Languages (4 marks):
High-level: Easy to read/write [1 mark], portable across hardware [1 mark].
Low-level: Hardware-specific [1 mark], faster execution/direct control [1 mark].
Explanation: High-level suits general programming; low-level for optimized, embedded systems.
Assembler Role and Example (3 marks):
An assembler translates assembly language to machine code, with one-to-one correspondence. [2 marks]
Example: Used in writing device drivers or OS kernels. [1 mark]
Explanation: Assemblers are needed for low-level programming where precise hardware interaction is required.
Compiler vs. Interpreter (4 marks):
Compiler: Translates entire code at once to an executable file [1 mark]; advantage: Faster runtime execution [1 mark].
Interpreter: Translates and executes line-by-line, no executable [1 mark]; advantage: Easier debugging with immediate errors [1 mark].
Explanation: Compilers suit production; interpreters for development.
Why Translators are Needed (1 mark):
Computers only understand machine code; translators convert human-readable code to binary. [1 mark]
Explanation: They make programming accessible without writing binary.
Total Marks: 20