งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

Introduction to Flowchart

งานนำเสนอที่คล้ายกัน


งานนำเสนอเรื่อง: "Introduction to Flowchart"— ใบสำเนางานนำเสนอ:

1 Introduction to Flowchart
วรวิทย์ พูลสวัสดิ์

2 Flowchart A graphical representation of the sequence of operations in an information system or program. Program flowcharts show the sequence of instructions in a single program or subroutine

3 Symbols Reference : Microsoft office visio

4 ข้อกำหนด แต่ละโปรแกรมจะ มีจุดเริ่มต้น (Start / Begin ) ได้จุดเดียว และ
มีจุดสิ้นสุด (Stop / End) ได้จุดเดียว เท่านั้น

5 Basic Structure : Sequence
#include <iostream> using namespace std; int main() { int total, input_1 , input_2 ; cin >> input_1 >> input_2 total = input_1 + input_2 ; cout << “ total is = " << total << endln ; return 0; }

6 Basic Structure : condition (Select)
#include <iostream> using namespace std; int main() { int input_1 , input_2 ; cin >> input_1 >> input_2 if ( input_1 > input_2 ) { cout << “ input 1 greater “ << endln ; } else { cout<<“ input 1 not greater “<< endln; } return 0; }

7 Basic Structure : iteration (loop)
#include <iostream> using namespace std; int main() { int I , sum ; I = 1 ; sum = 0 ; while (i<= 5 ) { sum = sum + I ; I++ ; } cout << “Summation is “ << sum ; return 0; }

8 Basic Structure : iteration (loop)

9 เทคนิคการสร้าง Flowchart สำหรับอธิบายการทำงานของโปรแกรม
วิเคราะห์ output ว่าจะแสดงผลลัพธ์ที่ต้องการคืออะไร และให้แสดงผลอย่างไร วิเคราะห์ Input คืออะไร ได้มาจากไหน นำ input เข้าสู่ระบบอย่างไร ส่วนของ input และ output มักต้องเป็นส่วนที่ติดต่อกับผู้ใช้หรือเรียกว่า interface วิเคราะห์ว่า Process ต้องทำอะไร

10 Class-work-01 โปรแกรมต้องการเปรียบเทียบค่า 3 ค่าว่าค่าใดมากที่สุด โดย 3 ค่าที่ต้องการเปรียบเทียบคือ จงเขียน Flowchart เพื่อทำการอธิบายการทำงาน จงรวมกลุ่ม กลุ่มละไม่เกิน 4 คน เพื่อเขียน Flowchart

11 Class-work-02 โปรแกรมต้องการสลับที่ค่า 2 ค่าในตัวแปร val1 และ val2 โดยค่าของ val1 = 8 และ val2 = 12 โดยเป็นการกำหนดค่าในโปรแกรม ผลลัพธ์เป็นดังนี้ Before : val1 = 8 val2 = 12 After : val1 = 12 val2 = 8 จงรวมกลุ่ม กลุ่มละไม่เกิน 4 คน เพื่อเขียน Flowchart

12 Class-work-03 โปรแกรมต้องการเปรียบเทียบจำนวนเต็มบวก 3 ค่าว่าค่าใดมากที่สุด โดยที่ค่าทั้ง 3 ค่า ป้อนจากผู้ใช้งาน ผลลัพธ์ แสดงหน้าจอภาพดังนี้ Enter number : 10 Enter number : 16 Enter Number : 8 Maximum is 16 จงรวมกลุ่ม กลุ่มละไม่เกิน 4 คน เพื่อเขียน Flowchart

13 Class work04 BMI : Body Mass index หรือ ดัชนีมวลกาย เป็นการหาช้อัตราส่วนระหว่าง น้ำหนัก (เป็นกิโลกรัม) กับส่วนสูง (เป็นเมตร) โดยที่ BMI = น้ำหนัก / (ส่วนสูง)2 BMI ที่ได้อ่านค่าตามตารางนี้ < 18.5 น้ำหนักน้อยกว่ามาตรฐาน 18.50 22.99 ปกติ 23.00 24.99 อ้วนระดับ 1 25.00 29.99 อ้วนระดับ 2 >= 30 อ้วนระดับ 3 จงรวมกลุ่ม กลุ่มละไม่เกิน 4 คน เพื่อเขียน Flowchart

14 ตัวอย่าง interface สำหรับการหาค่าดัชนีมวลกาย
--BMI Calculator-- Weight (m) : 1.77 Height (kg) : 89 BMI : 28.40 Analysis : อ้วนระดับ 2

15 Questions?


ดาวน์โหลด ppt Introduction to Flowchart

งานนำเสนอที่คล้ายกัน


Ads by Google