You are on page 1of 3

PROGRAMMING WORKSHEET

1. Complete the following statements:


(i) ……………………………… is a step by step method of solving a problem. It is commonly used for
data processing, calculation and other related computer and mathematical operations

(ii) a valid ………………………………………..that is clearly outlined.

(iii) ……………………… steps, must be specific

(iv) ………………………number of steps, steps must be limited

(v) ………………………. Must flow easily from one step to another

(vi) ………………………after a finite number of steps are completed

(vii) An appropriate………………………within steps. The result of the solution must relate


to the input 31

2. What is Flowchart? (2 marks)

3. a. List FOUR flowchart symbols. (4 marks)


b. Explain EACH. (4 marks)

4. Write a Pseudocode that will print the integers from 1 to 10. (5 marks) 32

5. What is a loop?

6. a. List TWO types of loops. (2 marks)


b. Explain each. ( 2 marks)

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)

11. Find the lowest number in a series of 41 numbers. (10 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)

15. a.Write an array of 55 addresses.


b. Write an array of 60 whole numbers.
c. Write an array of 14 odd numbers.
d. Write an array of consonants in the alphabet.
e. Write an array of the vowels in the alphabet.

16. Write segments of codes for the following data in an arrays:


a. 12,23,54,65,6,78,6 (5 marks)

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

19. Solve the following questions in PSEUDOCODE and PASCAL:


a. Read the weather condition. If the weather is Rainy, display “Stay Inside”. ( 10 marks)
b. 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)

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

24. Explain the term Trace Table.

25. a. List TWO Manual Test. (2 marks)


b. List FOUR computerized Test. (4 marks)
PROGRAMMING WORKSHEET

26. What is the difference between Syntax and Logic error? (2 marks) 33

27. List FOUR data types used in Pascal.

28. What is an assignment statement? (1 mark)

29. Write THREE statements that include assignment statements. (3 marks)

30. Explain the purpose of an operator. (1 mark)

31. a. List FOUR operators used in a Pascal program. (4 marks)


b. Write FOUR statements that contain operators. (4 marks) 34

32. Complete the following table: (6 marks)

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)

You might also like