You are on page 1of 2

COURSE TITLE: ALGORITHM AND DATA STRUCTURE

TIME ALLOWED 3H
LECTURER: ATANGANA OTELE CHARLIE GAEL
SECTION A 15marks
1. Provide appropriate definition of the followings: data structure, variable, function,
flowchart, recursion (5marks)
2. How many type of data types can we use when writting an algorithm? Name them and
provide for each type three suitable examples (4marks)
3. what is the difference between call by value and call by reference? (2marks)
4. State four basic instructions used in algorithm (2marks)
5. write the minimal syntax of an algorithm (2marks)

SECTION B: STRUCTURAL QUESTIONS. 10marks

Consider the following loop:


Declare Number As Integer
Set Number=1
Repeat
Write 2* Number
Set Number= Number+1
Until Number>10
Work required:
1. Is this loop a pre-test loop or a post-test loop? Why? (2marks)
2. List the statements in the body of the loop. (2marks)
3. What is the test condition for this loop? (2marks)
4. What is the output of this loop? (2marks)
5. Draw the flowchart of this loop. (2marks)

SECTION C: STRUCTURAL QUESTIONS. 10marks

1. Write an algorithm to solve the first degree equation ax+b=0. a,b and x belong to
the real set. (2marks)
2. What is a conditional statement? (1mark)
3. List four conditional statements (2marks)
4. Write an algorithm to compute the GCD betwwen two integers collected from
the keyboard and display it (2.5marks)
5. given that the square root of a perfect number can be obtained through
successive subtractions between the number and the various odd numbers as
follows: 4-1=3; 3-3=0. the number of subtraction is 2 which is the square root of
4. 9-1=8; 8-3=5; 5-5=0. the number of subtractions is 3 therefore the square root
of 9 is 3. write the algorithm collecting as input a perfect number and
generating its square root according to the above description. (2.5marks)

Section D: Problem. 15marks

1
1- Mr SANGA, a lecturer of INSAM BAFOUSSAM of the ECONOMICS
department needs your help for a more quick student average computation, for
the normal session. According to him the algorithm must fulfill the following
requirements: The number of students is collected from the keyboard. The
number of courses each student is offering is also collected from the keyboard
and can vary from one student to the next.
Work required:
a) Write an algorithm to perform the avarage of each student and display the
result. (3marks)
b)write a subprogram collecting as input an array of students marks to display
them (3marks)
c)Write a subprogram to collect from the keyboard all the marks of a particular
student for the various courses. (3marks)
d) Write an algorithm to sort out the array of students marks average in
ascending order. (3marks)
e) Write an algorithm to find out the mark 15 in an array of student average
marks and return the corresponding position of the mark in the array. (3marks)

You might also like