0% found this document useful (0 votes)
2 views3 pages

Exercises_data Structure and Algorithm Fundamentals (1) (1)

The document outlines exercises for a Level 4 Software Development exam focused on Data Structures and Algorithms. It consists of three sections: Section A requires answers to all questions, Section B allows the choice of three questions, and Section C allows the choice of one question. The exercises cover programming tasks, algorithms, and pseudocode related to basic operations, data handling, and algorithm design.
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)
2 views3 pages

Exercises_data Structure and Algorithm Fundamentals (1) (1)

The document outlines exercises for a Level 4 Software Development exam focused on Data Structures and Algorithms. It consists of three sections: Section A requires answers to all questions, Section B allows the choice of three questions, and Section C allows the choice of one question. The exercises cover programming tasks, algorithms, and pseudocode related to basic operations, data handling, and algorithm design.
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/ 3

Prepared by H.

Camille 1

DATA STRUCTURE AND ALGORITHM FUNDAMENTALS


EXERCISES TO PREPARE EXAM
LEVEL 4: SOFTWARE DEVELOPMENT

This exercise comprises three sections


- Section A: Answer all the questions
- Section B: Answer only 3 questions of your choice
- Section C: Answer only 1 question of your choice

SECTION A: Answer all the questions /55Marks

1. Write a program to display the Hello message on the screen.


2. Convert the following decimal 125.10 to binary
3. Write an algorithm that allows the entrance of two numbers and the display of
their product.
4. Write an algorithm/Pseudocode for swapping the content of two integers A
and B entered by the user; and display these integers after swapping.
5. Write an algorithm/Pseudocode that allows to display whether an integer
entered on the keyboard is Odd or Even.
6. Write an algorithm/Pseudocode that allows the display of the largest of three
integers entered on the keyboard.
7. Write an algorithm/Pseudocode that allows the addition of comment on the
mark entered on the keyboard (if the mark is greater than 10 then it displays
“validated” if not “not validated” (NB: the mark is between 0 and 20!)
8. Write an algorithm/Pseudocode that asks the user for two numbers M and N
and then informs him if the product of these two numbers is positive or
negative. The case where the product can be null is included in the program.
9. Write an algorithm/Pseudocode that calculates the sum of three integers
entered by the user.
10. A store offers to its customers 15% off on the purchase amounts over 200
kgs. Write an algorithm/Pseudocode that allows to enter the total price
excluding VAT and to calculate the amount including VAT taking into account
the discount and that VAT = 20%.
11. Write an algorithm/Pseudocode that asks for the age of a child and allows you
to inform about its category knowing that the categories are as follows: - "Kid
from 6 to 7 years old" - "pupil from 8 to 9 years old" - "kid of 10 to 11 years old
"-" cadet after 12 years ".
12. Write an algorithm/Pseudocode to display months in letters according to the
number entered on the keyboard. (If the user types 1 the program displays
January, if 2 displays February, if 3 displays March...)
13. Write an algorithm/Pseudocode that displays "Good evening" 10 times. Using
the While loop.
2

14. Write an algorithm/Pseudocode that calculates the sum S = 1 + 2 + 3 + ... +


10. Using the While loop.
15. Write an algorithm/Pseudocode that calculates the sum S = 1 + 2 + 3 + ... +
N, where N is entered by the user. Using the While loop.
16. Write an algorithm/Pseudocode that displays "hello" 10 times. Using the For
loop
17. Write an algorithm/Pseudocode that calculates S = 1 + 2 + 3 + 4 +…. + N.
where N is entered on the keyboard by the user. Using the For-loop.
18. Write an algorithm/Pseudocode that displays the multiplication table of an
integer entered by the user, Using the For-loop.
19. Write an algorithm/Pseudocode that displays the multiplication table of 8.
Using the do-while Loop.
20. Write an algorithm/Pseudocode for entering 10 numbers and displaying the
average of these scores.
21. Write an algorithm/Pseudocode allowing the entrance of 10 integers and the
display the maximum of these integers.
22. Write an algorithm/Pseudocode to calculate the factorial of an integer entered
by the user. For example N = 7 the factorial of 7 equal to 1* 2 * 3 * 4 * 5 *
6 * 7 = 5040.
23. Write an algorithm/Pseudocode to display Even numbers between 0 and N,
where N is entered by the user.

SECTION B: Answer any three questions of your choice /30Marks

24. Write an algorithm/Pseudocode that calculates the sum of Odd integers from
1 to an integer N entered by the user. Example N=8 Sum = 1 +3+5+7= 16
25. Write an algorithm/Pseudocode that displays a triangle of integers, according
to an integer entered by the user. Example N=4

22

333

4444

26. Define the following terms:


a) Algorithm
b) Pseudocode
c) Flowchart
27. Explain any 3 qualities of a good algorithm
3

SECTION C: Answer any one question of your choice /15Marks


28. Write a program that reads in 7 numbers and prints out both the smallest and the
greatest value of the 7 given values. All the numbers should be input by the user
only once, of course.
30. Write a truth table for the following circuit:

You might also like