6 Flowchart for Calculating the Average of Three Numbers Start Input three values Calculate the average Display the average End 처음으로 배우는 C 프로그래밍 제 1
7 Flowchart Symbols SYMBOL NAME DESCRIPTION Terminal Indicates the beginning or end of an algorithm Input/Output Indicates an input or output operation Process Indicates computation or data manipulation Flow Lines Used to connect the flowchart symbols and indicate the logic flow Decision Indicates a decision point in an algorithm Loop Indicates the initial, final, and increment values of a loop Predefined Process Indicates a predefined process, as in calling a sorting process Connector Indicates an entry to or exit from another part of the flowchart 처음으로 배우는 C 프로그래밍 제 1
14 main() 함수(구동함수) main() You go first I’m done gross_pay( ) The Function name You go second I’m done { taxes( ) You go third net_pay( ) The Function body } You go last I’m done Main() gross_pay( ); taxes( ); net_pay( ); output( ); output( ) The main() Function Controls All Other Functions A Sample main( ) Function 처음으로 배우는 C 프로그래밍 제 1
18 기본 프로그래밍 형태 • 프로그램 1 -3 #include <stdio. h> void main(void) /* this program prints a message */ { printf(“Hello there world!”); /* a call to printf() */ } 처음으로 배우는 C 프로그래밍 제 1
20 모듈과 하향식 설계 Inventory control program Data entry section Calculation section Inventory control program Report section Data entry section First-Level structure diagram Enter data Modify data Calculation section Delete data Report section Screen reports Printed reports Second-Level Refinement Structure Diagram 처음으로 배우는 C 프로그래밍 제 1