Pseudocode And Flowchart Flashcards
Condition
A state in a program that will be met or not met.
Selection
A statement that represents choice in an algorithm.
Iteration
Where a section of code is run repeatedly.
Count-controlled loop
Iteration that is performed a stated number of times. It is FOR LOOP
Condition-controlled loop
Iteration that continues until or while a condition is met. WHILE and REPEAT
The form of FOR LOOP
FOR….TO…NEXT
WHILE LOOP format
WHILE…DO….ENDWHILE
Possible that the code will not run. Condition is checked at the start.
REPEAT format
REPAT….UNTIL
Loop is ran at least once.
Condition is checked at the end
Advantages of flowchart
- the sequence of steps can easily be seen
- paths can be easily followed
- the logic can be understood easily when represented visually
Disadvantages of flowchart
- takes a lot of time
- changes mean redrawing
- large flowchart hard to follow
Format of if
IF…THEN….ELSE…ENDIF
Format of CASE
CASE….OF….OTHERWISE….ENDCASE
Use when you have number of options.
Input of data
student = USERINPUT
Output
PRINT (“”)
Read line
name=READLINE(filename, record number)