0% found this document useful (0 votes)
17 views8 pages

FinalExamination - 2022 - For Revision

The document contains a question paper divided into two sections, focusing on programming concepts and pseudocode. Section 01 includes questions on machine language, interpreters vs compilers, types of errors in programming, and syntactical vs semantic correctness. Section 02 requires the creation of pseudocode for various scenarios, including calculating interest on credit cards, generating patterns, and handling arrays.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views8 pages

FinalExamination - 2022 - For Revision

The document contains a question paper divided into two sections, focusing on programming concepts and pseudocode. Section 01 includes questions on machine language, interpreters vs compilers, types of errors in programming, and syntactical vs semantic correctness. Section 02 requires the creation of pseudocode for various scenarios, including calculating interest on credit cards, generating patterns, and handling arrays.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Section 01 (25 marks)

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:

Card Type Annual Interest Rate


Platinum(P) 20%
Gold(G) 10%
Silver(S) 5%
The annual interest amount for each card type can be determined as follows:

Annual Interest Amount = Credit Limit * Annual Interest Rate


Sample Output:
Enter Card Type: P
Enter Credit Limit:50000
The Annual Interest Amount: 10000

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

a) Draw the defining diagram for the above scenario. (5 marks)

b) Write the pseudo-code for the above problem.


(12 marks)

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)

b) Write the pseudocode for the given problem. (12 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

Write pseudocode to do the following:


a) Declare a one-dimensional array to store positive integers (1 mark)
b) Accept the positive integers as a user input and fill the array. (4 marks)
c) Find and print if there’re any odd numbers stored in the array. (6 marks)
d) Calculate the total of the odd numbers. (4 marks)

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

-------End of the Question Paper------

Page 8 of 8

You might also like