FinalExamination - 2022 - For Revision
FinalExamination - 2022 - For Revision
1. “Machine Language is so error prone”. Do you agree with this statement? Explain your (5 marks)
answer.
2. "An interpreter is needed every time you run the program, but compiler is needed (5 marks)
once to produce the object code". Explain this statement.
3. Name three types of errors that can occur in a computer program and explain how you can (5 marks)
detect the stated errors.
4. "A sentence can be syntactically correct, but semantically incorrect". Do you agree (5 marks)
with the above statement? Explain your answer with an example.
Page 1 of 8
5. Choose the most suitable phrase/term from those given in the list and fill in the blanks to (5 marks)
make the following sentences meaningful.
a) _____________________ are the first to use true English like phrasing.
b) _____________________ are commonly used in database programming and scripts.
c) _____________________ produce no object code in the process of translation
d) _____________________ translate the entire program into an executable object code.
e) ___________________ can be identified by desk checking.
4th generation language, syntax error, interpreter, a defining diagram, compiler, logical
error, desk checking, run time error, constant, diagrams, 5th generation language, 3rd
generation language
Page 2 of 8
Section 02 (75 marks)
1. Read the following scenario and write the pseudocode. (8 marks)
A program is required to calculate and print the annual interest amount of the credit card
depending on the credit limit and the annual interest rate. User enters the credit card type
and credit limit to the program as a user input.
The interest rate for each card type can be determined as follows:
Page 3 of 8
2. Read the following problem scenario and answer the questions a), b) and c)
A program requests the user to enter a number and prints a pattern as follows:
Enter Number: 3
Output:
1 2 3
1 2
1
Page 4 of 8
c) Desk check your solution for the following test case. (8 marks)
Sample Test Case: Input Number 2
Expected 12
Output Pattern 1
Page 5 of 8
3. Read the following scenario and answer the questions a) and b).
A program is required to prompt the user to enter a set of positive numbers, one at a time. User enters a -99
to indicate that he has completed entering numbers. Then, the program should display
• The count of numbers entered
• The sum of all numbers entered.
a) Draw the Defining diagram. (5 marks)
Page 6 of 8
4. Read the following scenario and answer the given questions.
The following array stores positive integers.
Array Index 0 1 2 3 4 5
Numbers 5 10 4 3 9 6
Page 7 of 8
5. The following figure illustrates a number pattern. Identify the pattern and write the (10 marks)
pseudocode to store the numbers in a two-dimensional array.
5 10 15 20
30 35 40 45
55 60 65 70
Page 8 of 8