Académique Documents
Professionnel Documents
Culture Documents
Pseudocode
start read num1,num2, num3 Average =(num1+num2+num3)/3 print average Stop.
Flowcharts
Flowcharts use special geometrical objects to designate the basic steps of a program, which are: Input, processing and output
Rectangle used to represent processing/assignment operations process box Decision used to represent Conditional and loop constructs. -Decision box An elliptical shape used to represent Start/Stop - Terminal box
Special symbol:
The connector symbol is a small circle with a number or letter inscribed therein and is used where flowchart cannot fit on a single page.
Flowchart Section 1
Flowchart Section 2
Flowchart Section 3
do B
Yes F G
No
Read num1,num2,num3
Average = (num1+num2+num3)/3
Print Average
Stop
This algorithm calculates the wages (including overtime) due to an employee based on the number of hours worked.
BasicPay = hoursworked * 40
Overtime = hoursworked - 40
Yes
Wages = BasicPay + (Overtime *2*rate)
No
Overtime > 0 Wages = rate* hoursworked
Specimen Q1
The variable CustBalance stores the amount of money owed by customers. CustBalance is MOST likely of data type: Integer Character Real Array
A. B. C. D.
Specimen Q2
a. Define the term flowchart. 1mk
Specimen Q2
b. The following symbols are used when drawing a program flowchart. Give the name of EACH of the program flowcharting symbols shown below.
START STOP
(i) (ii)
(iii)
Specimen Q2
b. The following symbols are used when drawing a program flowchart. Give the name of EACH of the program flowcharting symbols shown below.
(iv)
Yes
No
Specimen Q2
b. The following symbols are used when drawing a program flowchart. Give the name of EACH of the program flowcharting symbols shown below.
(v)
1 1
Specimen Q2
c. Draw a flowchart to obtain TWO values and print the larger of the TWO values.
Start Read Value1, Value2 If Value1 > Value2 then Print Value1 Else Print Value2 Endif Stop
Specimen Q3
1. Draw a flowchart to represent the algorithm below:
INPUT X, Y, Z Y=X+Y X=X-Y Y=X+Y IF X > Y THEN Z=X+Y-Z ELSE Z=X+Y+Z ENDIF PRINT X, Y, Z
Specimen Q3
2. Draw a flowchart to represent the algorithm below:
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. begin J=2 C=1 while (J < 99) print J J=J+2 C= C + 1 endwhile Print C Print J end