You are on page 1of 2

Lab 1

1. Identify the flowchart notation for the following


a. Start
b. Process
c. Input
d. Decision

2. Design a program using flowchart to find the average of 5 positive numbers.

3. Design a program using pseudocode to calculate the Area and the circumference for a circle.

Pseudocode

Terminator: BEGIN / START ….. END

INPUT: read, get, input

OUTPUT : Display, Print, output, write , save

Preparation: Declare (eg. Declare num)

Initialization: SET, Initialize , assign

CALCULATION: Calculation , formula (a=b+c / add b and c together)

IF… THEN … ELSE … ENDIF

CASE OF …. ENDCASE

FOR …. STEP … NEXT / ENDFOR

DOWHILE …. ENDDO

REPEAT … UNTIL…

CalculateAverage5PosValues
DECLARE value, average, total, counter
Total = count = 0
DOWHILE counter <5
DISPLAY “Enter values:”
READ value
IF value > 0 THEN
Total = total + value
Counter = counter + 1 / add 1 into counter
ELSE
DISPLAY “Invalid input- need positive value”
ENDIF
ENDDO
Average = total /5
Display “ The average of 5 values:”,average
END

You might also like