(Sequence) The programming model is the simplest. Written to run from top to bottom. Write a command line And each line from the top line down to the bottom line. Assuming a 3-step process to work, read, calculate and print. | (Decision or Selection) Decisions or conditions Programming to bring value to your actions. There is usually a two-step process to do the actual conditions of the process is done. And false to act as one process. However, if more complex Will require a multi-layer conditions Such as grading students, etc. Examples of this flowchart. Will display a selection simple. To make the process just a single process | (Iteration or Loop) Making process, many times The conditions governing The repetition is key to understanding the more difficult because the first two forms of programming languages. May not show as clearly Chemistry. You then have to imagine for themselves. |
ตัวอย่างการทำงานแบบตามลำดับ(Sequence)
เริ่มต้น
รับเงินไปจ่ายตลาดมา 100 บาท
ซื้อไข่ไก่ 25 บาท
ซื้อผลไม้ 25 บาท
จบการทำงาน
ตัวอย่างการเลือกกระทำตามเงื่อนไข(Decision or selection)
เริ่มต้น
เอาเงินมาทำงาน 100 บาท
If ซื้อหมูปิ้งดีหรือไม่ Then
จ่ายค่าหมูปิ้ง 25 บาท
จบการทำงาน
เริ่มต้น
เอาเงินมาทำงาน 100 บาท
Do
จ่ายค่าหมูปิ้ง 25 บาท
While ถ้ายังมีเงินเหลือ
จบการทำงาน



No comments:
Post a Comment