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

s4 Questions on Algorithm

The document contains a series of algorithm and pseudocode exercises that cover various programming concepts such as user input, conditional statements, arithmetic operations, and data structures. Each exercise requires the creation of algorithms to solve specific problems, ranging from age verification for voting eligibility to calculating areas and handling student grades. The tasks are designed to enhance understanding of programming logic and control structures.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

s4 Questions on Algorithm

The document contains a series of algorithm and pseudocode exercises that cover various programming concepts such as user input, conditional statements, arithmetic operations, and data structures. Each exercise requires the creation of algorithms to solve specific problems, ranging from age verification for voting eligibility to calculating areas and handling student grades. The tasks are designed to enhance understanding of programming logic and control structures.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

QUESTIONS ON ALGORITHM

1) Write Pseudocode and algorithm that request a user to enter his/her ages. If the ages are
greater than 17 years old, the program displays “you are allowed to vote” otherwise “you are too
young”.
2) Write the pseudocode and algorithm to find the sum and average of three given numbers.

3) Write the pseudocode and algorithm which receives a number and informs the user whether
the given number is Positive, Negative or Zero.
4) Write the pseudocode and algorithm that would enable the user to enter student marks in three
subjects. The program should calculate mean marks and determine whether the student has
passed if the pass mark is 50%.
5) Write the pseudocode and algorithm that will read the two sides of a rectangle and calculate
its perimeter and area.
6) Write the pseudocode and algorithm that accepts three digits and displays on the screen the
product of the three numbers.

7) Write the pseudocode and algorithm that calculates and outputs surface area and volume of a
sphere.
8) Write an algorithm and pseudocode that asks the user to input the radius of the circle and
displays its Area and Circumference, Using PI=3.14.
9) Develop the pseudocode and algorithm to accept any given number and prove that the given
number is Odd or even.
10) Write the pseudocode and algorithm that calculates and displays the sum, product and
average of three given numbers.
11) Write the pseudocode and algorithm that read two numbers from keyboard and inform the
user if the sum of those numbers is even or odd.
12) Write an algorithm that receives three numbers entered by the user and find Smallest
Number.
13) Write an algorithm that receives three numbers entered by the user and find Largest Number.
14) Write an algorithm that prompts a user to enter a student’s scores in five subjects
(Mathematics, Computer science, Economics, Entrepreneurship and General Studies). If the
score is above 70%, the program should display “You have Scholarship” otherwise it should
display “You don’t have Scholarship”.
15) Create an algorithm which will ask a user to input a value.
 If the value is 1 it should display the text “The day is Monday”
 If the value is 2 it should display the text “The day is Tuesday”
 Do this for all the days of the week.
Use the Nested if… structure to achieve the above.

Page 1 of 3
16) Write an algorithm which will ask a user to input a value.
 If the value is 1 it should display the text “The month is January”
 If the value is 2 it should display the text “The month is February”
 If the value is 3 it should display the text “The month is March”
 If the value is 4 it should display the text “The month is April”
 Do the same for all months of a year
Use the switch statement to achieve the above
17) Formulate an algorithm to read marks (per cent) of university students and put these students
into classes accordingly and print out their grades.
Classes with their corresponding marks:
• From 80 to 100: First class honours
• From 70 to 79: Upper second class honours
• From 50 to 69: Lower second class honours
• From 40 to 49: Pass
• Below 40: Fail

18) Write an algorithm that allows the user to enter width and height to calculate area of triangle.
19) In athletics, runners are awarded medals depending on position as follows: position 1: gold;
position 2: silver and position 3: bronze. The rest of the runners are not awarded any medal but
receives appreciation message saying “Thank you for your participation”. Using nested if...else
statements, Develop an algorithm that determines the medal to be awarded to runners depending
on time each athlete touches the finish line.
20) NESA (National Examination School Inspection Authority) has implemented New Grading
System which has the following grades depending on the ranges: Excellent (Range: 70 - 100),
Very good (Range: 65 – 69.99), Good (Range: 60 – 64.99), Satisfactory (Range: 50 – 59.99),
Adequate (Range: 40 – 49.99), Fair (Range: 20 – 39.99 and Fail (Range: 0 – 19.99). Using
Nested if…else control statement, Create an algorithm that prompts a student to enter his /her
marks and displays the grade accordingly.

21) Using switch control statement, design an algorithm to display the day of the week according
to the entered number, related to that day. If the number does not match with any day, it will
display “Try again”
22) Write an algorithm that receives radius and height of a cylinder. The program should
calculate and display the volume of a cylinder.
23) Write an algorithm that requires user to enter his/her age and prints Minor if age is below 18,
Prints Youth if age is between 18 and 35 inclusive and Prints Elder if age is 35 and above.

Page 2 of 3
24) NESA (National Examination School Inspection Authority) has implemented New Grading
System which has the following grades depending on the ranges: Excellent (Range: 70 - 100),
Very good (Range: 65 – 69.99), Good (Range: 60 – 64.99), Satisfactory (Range: 50 – 59.99),
Adequate (Range: 40 – 49.99), Fair (Range: 20 – 39.99 and Fail (Range: 0 – 19.99). Using
Switch control statement, Write an algorithm that prompts a student to enter his /her marks and
displays the grade accordingly.
25) Write an algorithm program that receives three numbers entered by the user and find
Smallest Number.
26) Write an algorithm of a program that allows the user to enter(store) 24 elements in two
dimensional array and display them on the screen

27) Write an algorithm to solve quadratic equation: ax2 + bx + c

28) Write an algorithm which receives a number and informs the user whether the given number
is Positive or Negative.
29) Write an algorithm that asks the user to enter two numbers and it displays the product of
those numbers if it is positive, negative or null.

30) What will be the output?


BEGIN
FOR Count =1 to 20 DO
IF Count =7 THEN
Continue
END IF
PRINT Count
END FOR

31) In Rwanda there is a presidential election, a citizen is allowed to vote if he/she is 16 years
and above. Write an algorithm to present this situation.

32) Develop a pseudocode for reading and writing 10 elements into customer array.

33) Write an algorithm and flowchart for calculating the total of 20 received numbers. Before
computation, it checks whether the number is positive and if not print a message “the number is
negative”.

Page 3 of 3

You might also like