Professional Documents
Culture Documents
Flowcharts and Algorithms Worksheet (T.reid)
Flowcharts and Algorithms Worksheet (T.reid)
Question 1.
Write the algorithm based on the scenario below and construct a flow chart using the same
scenario.
Write and algorithm that add two numbers 40 and 50.Ensure that you take the variable sum and
initialize it to zero. Input the two numbers. Add the numbers and print the sum.
PSUDOCODE-
START
Declare
variables
Constant
Num1 = 40
Num2 = 50
Readln (num1)
Readln (num2)
Sum = 0
STOP
Question 2
Given the pseudocode for a loop draw a flow chart to find the sum of 6 numbers.
START
Sum = 0
Count = 0
Enter value
for n
Sum + n
IF NO
Count = count+1 coun Print Sum
t <6
YES
STOP
Question 3
Write pseudo code that will
c) Find the smallest (minimum) and largest (maximum) of the five entered numbers.
PSUEDOCODE
START
Variables
sum := 0
y :=0
Readln (num[y])
avg = sum/5
STOP