Saturday, December 13, 2014

Flowchart (รูปแบบการเขียนผังงาน)

รูปแบบการเขียนผังงาน มี 3 ประเภทคือ
1. รูปแบบ Sequence (โคงสร้างแบบเป็นลำดับ)
รูปแบบการเขียนโปรแกรมที่ง่ายที่สุดคือ เขียนให้ทำงานจากบนลงล่าง เขียนคำสั่งเป็นบรรทัด และทำทีละบรรทัดจากบรรทัดบนสุดลงไปจนถึงบรรทัดล่างสุด สมมติให้มีการทำงาน 3 กระบวนการคือ อ่านข้อมูล คำนวณ และพิมพ์  

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.






2. รูปแบบ Decision (โคงสร้างแบบมีการเลือก)
การตัดสินใจ หรือเลือกเงื่อนไขคือ เขียนโปรแกรมเพื่อนำค่าไปเลือกกระทำ โดยปกติจะมีเหตุการณ์ให้ทำ 2 กระบวนการ คือเงื่อนไขเป็นจริงจะกระทำกระบวนการหนึ่ง และเป็นเท็จจะกระทำอีกกระบวนการหนึ่ง แต่ถ้าซับซ้อนมากขึ้น จะต้องใช้เงื่อนไขหลายชั้น เช่นการตัดเกรดนักศึกษา เป็นต้น ตัวอย่างผังงานนี้ จะแสดงผลการเลือกอย่างง่าย เพื่อกระทำกระบวนการเพียงกระบวนการเดียว  

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

 



3. รูปแบบ Loop หรือ Iteration (โครงสร้างแบบทำซ้ำ)
การทำกระบวนการหนึ่งหลายครั้ง โดยมีเงื่อนไขในการควบคุม หมายถึงการทำซ้ำเป็นหลักการที่ทำความเข้าใจได้ยากกว่า 2 รูปแบบแรก เพราะการเขียนโปรแกรมแต่ละภาษา จะไม่แสดงภาพอย่างชัดเจนเหมือนการเขียนผังงาน ผู้เขียนโปรแกรมต้องจินตนาการด้วยตนเอง

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. Programmers have to imagine for themselves.