0% found this document useful (0 votes)
12 views

Datastructure and algorithm fundamentals

Uploaded by

Habimana Daniel
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Datastructure and algorithm fundamentals

Uploaded by

Habimana Daniel
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

SCHOOL COMPREHENSIVE ASSESSMENT A/Y: 2024-2025 Term:1

EXAM TITLE: Datastructure and Algorithm fundamentals

EXAMINER: ......................................................

SOFTWARE DEVELOPMENT TOTAL MARKS: 70 marks

LEVEL 4 SWD TIME: 3 hours

Date:....../12/2024

Instructions:

This paper Consists of Two sections: A and B

 Section A: Attempt all questions (50 marks)


 Section B: Attempts any (2) questons (20 marks)
 Separate your answer with horizontal line

Addition instruction:

 Calculator & Drawing materials should be used where applicable

Section A: Attempt all questions (50 marks)

1)
a) Convert 111 110 000 from base 2 to base 8
b) Convert 193 from base 10 to binary
c) Convert 1011 1110 0000 1001 from base 2 to base 16
2) A well-defined algorithm include the qualities of good algorithm. As a programmer what
do you consider as quality of good algorithm.
3) An operator is a symbols that tell compiler to perform specific mathematical or logical
manipulations. Match the following operator with their respective categories

Page 1 of 4
Operator Categories
?: Arithmetical
*+% logical
/=,^= conditional
==,!= Compound
|||&|& Relational

4) A given the following illustration of Boolean logical gates complete the truth table

INPUT OUTPUT
A B AND NAND OR NOR EXOR EXNOR
0 0
0 1
1 0
1 1

5) Analyze the following Boolean algebra and then try to simplify (i) and (ii)
I. (A+B)(A+C)=AA+AC+AB+BC (2.5marks)
II. AB+A(B+C)+B(B+C)=AB+AB+AC+BB+BC (2.5marks)
6) Write an algorithm to read n number of values in an array and display them in reverse order.
Find the output of the following program: If the value of a=20, b=3, what will be the value of the
sum? (5marks)

7) Demonstrate (show) by the truth table the following De Morgan theorems. 5Marks

Page 2 of 4
a.

b.
8) Copy and complete the following table (5marks)
Name of the symbol Diagram Description

Start/end(oval) ……………………. …………………….

…………………………. ………………………. It is used for data processing

……………………. …………………..

Connector(circle) …………………… ………………………….

…………………….. ……
…………………….

9) Write an algorithm which receives student note and it displays the grade as follows:
5Marks
Note form 16 and above: Grade A
Note 14-16 : Grade B
Note 12-14 : Grade C
Note below 12 : Grade D
10) Write an algorithm which receives a number and informs the user whether it is positive
or negative. 5Marks

SECTION B: Attempt Only 2 (4) questions (20)Mark

1) Write algorithm and the flowchart for the problem that allow the user to input three
numbers and display the sum, the average and the product of them. (10marks)
2) Compare for loop with while loop. (10marks)
3) Write an algorithm that allows the user to input the positive number and displays the
sum of positive numbers up to that number.
4) White a pseudocode to keep asking for a number less than 100 and stop when the
number is multiple of 3, 5, and 7. (Hint: Use while loop). (10marks)

Page 3 of 4
End!

Page 4 of 4

You might also like