In drawing a flowchart, use of certain symbols such as figure 1.1. The following example can be used to better understand the differences in the use of the symbols. Suppose we want to find the sum of 2 numbers, then the flowchart it is like figure 1.2.
Another example, suppose we want to know whether a number odd or even. For that we need to make a flowchart like this picture 1.3.
Pseudo CodePseudo Code is a sequence of lines of programming code and algorithms, such as not having a standardized syntax. Pseudo Code is more commonly used by experienced programmers. However, the flowchart is more easily understood by novice programmers, pseudo code is very easily implemented into the code of the program compared with the flowchart. We can freely write pseudo code for it is easy to understand for others. However, advisable to use commonly used keywords such as: if, then, else, while, do, repeat, for, and others. And follow the writing style of programming such as Pascal, C + +, etc.. Notice the code below:
1. Start
2. Enter a number
3. Enter a number and show
4. Take the previous figures and show
5. Completed
Although the pseudo code above is still understandable but there are some ambiguous statement. From the second row, we do not know where that number is saved and we also do not know which numbers are referred to "the previous figure." Is the number of the first or the second. Pseudo code above can be modified to be as follows:
1. Start
2. Enter A
3. Enter B, Show B
4. Show A
5. End
Pseudo code above better than ever before. We can clearly see where the numbers are stored and where the numbers are displayed. Now we will change the flowchart in figure 1.2
1. Start
2. Enter A and B
3. C = A + B
Tidak ada komentar:
Posting Komentar