Marking Scheme - Structured
Programming CAT 2
a) The role of printf() function (2 marks)
• Correctly states that printf() is used to display/print output to the screen. (2 marks)
• Partial explanation (1 mark)
b) Reserved words in C (2 marks)
• States that reserved words are predefined keywords in C with special meaning, cannot be
used as identifiers (2 marks)
• Partial understanding (1 mark)
c) Program to receive number and display grade (6 marks)
Mark allocation:
• Correct declaration of variables (1 mark)
• Input statement using scanf (1 mark)
• Correct condition checking (if/else if/else) (2 marks)
• Display correct grade (printf) (1 mark)
• Logical correctness and compilation (1 mark)
d) Program to display message (6 marks)
Mark allocation:
• Correct inclusion of header file (1 mark)
• Main function declaration (1 mark)
• Correct printf() statement with exact message (3 marks)
• Closing return 0; (1 mark)
e) Compilation vs Debugging (2 marks)
• Correctly defines compilation (translating source code to machine code) (1 mark)
• Correctly defines debugging (process of identifying and removing errors) (1 mark)
f) Arrays in C (4 marks)
• Correct definition of array (2 marks)
• Example declaration (int arr[5];) (2 marks)
g) Four Programming Paradigms (8 marks)
Award 2 marks for each correctly stated and explained paradigm:
• Procedural Programming (2 marks)
• Object-Oriented Programming (2 marks)
• Functional Programming (2 marks)
• Logic Programming (2 marks)
(Other valid paradigms accepted if correctly explained)