170 likes | 492 Views
Flowcharting Symbols. Terminal. Decision. Input / Output. On page connector. Off page connector. Directional Lines . Processing. Piecing together a Flowchart. All programs must have a beginning. This is shown using the terminal symbol and using the word Start within the symbol. Start.
E N D
Flowcharting Symbols Terminal Decision Input / Output On page connector Off page connector Directional Lines Processing
Piecing together a Flowchart • All programs must have a beginning. This is shown using the terminal symbol and using the word Start within the symbol. Start
Input / Output When we want to read a record, write a record to a disk or print the record this symbol is used. Read/ Write/ Print
Processing Symbol This symbol contains arithmetic operations. Calculations are always completed with a symbol such as this. Processing
Decision Symbol When we must answer a question either yes or no, true or false a decision symbol is used. Since there are two possible answers to the question, there are also two possible paths Is this the last record to process?
Connecting Symbols • This symbol is used to keep the program neat yet provide a means of connecting two points on the same page without using flowlines. On-page Connector
Connecting Symbols • This symbol is used to keep the program neat yet provide a means of connecting two points on different pages without using flowlines. Off-page Connector
FLOWCHART Start LAB 4 Read a Record Print a Line Read a Record End of File n y Print End of listing Message End
Creating a Flowchart • Let’s look at how we create a flowchart. • We will examine each piece and then will once again look at the whole flowchart
Start Processing READ CN$, DEMO, REPUB, OTHER Read a Record
DO WHILE CN$ <> “END” End of File
If the answer to the question in no then the processing follows the no path and creates a loop that will reoccur until the answer to the question is yes. Print a Line Read a Record End of File n
We need to print the present record and read another record The following code causes that to happen PRINT CN$, DEMO, REPUB, OTHER READ CN$, DEMO, REPUB, OTHER Print a Line Read a Record End of File n
Each time we read a record we must again ask if we have reached the end of file. Only when the answer is yes will we stop processing with in the loop. Print a Line Read a Record End of File n y
When we have finished processing all the records we are to print a message stating the end of processing. the following code shows how End of File PRINT prints a blank line y Print End of listing Message PRINT “END OF FILE” Ends processing End
Start The complete flowchart for Lab 4. Read a Record Print a Line Read a Record End of File n y Print End of listing Message End