EXAM SEN 102 Principle of Programming
EXAM SEN 102 Principle of Programming
1(a) What is the difference between a high-level programming language and a low-level
programming language? Provide examples of each. (8 Marks)
b) Explain the concept of variables in programming. What are the common data types used to
declare variables, and what is their significance? (8 Marks)
c) Describe the difference between procedural programming and object-oriented programming
(OOP). Provide examples of programming languages that support each paradigm. (9 Marks)
2 (a)What is a control structure in programming? Discuss the types of control structures,
including conditional statements (if-else, switch-case) and looping constructs (for, while, do-
while). (10 Marks)
b) What is the purpose of functions or methods in programming? Explain the concept of
function parameters and return values. (8 Marks)
c) Discuss the importance of code comments. What are the different types of comments, and
how do they contribute to code readability and maintenance? (7 Marks)
3(a) Explain the concept of arrays and their significance in programming. Provide examples of
array operations and common array manipulation techniques. (9 Marks)
b) What are algorithms and why are they important in programming? Describe the
characteristics of a good algorithm and provide examples of algorithmic problem-solving.
(8 Marks)
c) Describe the concept of debugging in programming. What are common debugging
techniques and tools used to identify and fix errors in code? (8 Marks)
4. a) Write a Program in GW BASIC to calculate the following
I. Circumference of a Circle (8 Marks)
ii. Area of a Circle (8 Marks)
b) Write a program in GW BASIC to calculate Simple Interest and Compound Interest (9 Marks)
5 (a) Give explanation for the following
i. Flowchart (5 Marks)
ii. Pseudocode (5 Marks)
b. Draw a flowchart to read the two sides of a rectangle and calculate its area. (7 Marks)
c. Draw a flowchart to reads two values, determines the largest value and prints the largest
value with an identifying message. (8 Marks)
6. d) Discuss the concept of data structures in programming. Please provide examples of basic
data structures such as arrays, linked lists, stacks, and queues, and explain their use cases.
(25 Marks)