Programming Questions For Form 5
Programming Questions For Form 5
4. Write a Pseudocode that will print the integers from 1 to 10. (5 marks) 32
5. What is a loop?
7. Write an algorithm in Pseudocode and Pascal that will prompt the user to read the
amount of rainfall in the month of his birth. Display the total rainfall for that month.
(10 marks)
8. Write an algorithm in PASCAL which will accept the gender of students at CSS and
output the number of male students as well as female students. The algorithm should
terminate when you enter “Stop”. (5 marks)
9. Write an algorithm in PASCAL that takes the age of a student and adds it to the ages of
other students to get a total. The algorithm should terminate at 0
10. Write an algorithm that will terminate by 999, that accepts the price of an item,
calculates a 20% discount and shows the result. (5 marks)
12. Write an algorithm to find the lowest in a series of integer program with 0. (10 marks)
PROGRAMMING WORKSHEET
13. A variable is given a value of 10. Repeat the following and compute the number until the
number reaches 20 or greater. Ensure to add 2 to the number and print the appropriate result.
(15 marks)
14. Write THREE examples of Arrays being declared with the following data types:
a. INTEGER (1 mark)
b. CHAR (1 mark)
c. REAL (1 mark)
17. Write a program that will create an array called staff and allow the users of the program
to enter the names of each employee in that array. (4 marks)
18. Develop a program that will search for the number 33 in an array of 100 numbers. The
program should print the index number and what value is found ( 8 marks) 36 pdf
20. Develop an algorithm that will read a number. If the number is greater than 50, add 20
to the number. Output the number. ( 10 marks)
21. Write an algorithm that will prompt the user to enter the average received. If the average is
greater than or equal to 80, output the message “Promoted” otherwise the message
“Demoted”. (10 marks)
22. TDC Company gives out high commissions to all workers if their sales are greater than
$4000.00. Write a program that will prompt the user to input workers’ sales. If their sales are
greater than $4000.00 then 60% commission will be given. If workers’ sales are less than
$4000.00, a 30% commission is given. Output the appropriate result. (10 marks)
23. Write an algorithm that will request the user to input his birth year. Subtract this from
the current year. If the result is over 25, output “I Am An Adult”. If the age is between 13 and 18,
output “I Am Still A Teenager”. If the age is under 13, display “I Am Still A Child”. (10 marks 35
26. What is the difference between Syntax and Logic error? (2 marks) 33
33. List TWO advantages and TWO disadvantages of high level and low languages.(8 marks)
34. Categorize the generation of languages by grouping them under High level and low level
languages. (5 marks)