流程图设计.ppt_第1页
流程图设计.ppt_第2页
流程图设计.ppt_第3页
流程图设计.ppt_第4页
流程图设计.ppt_第5页
已阅读5页,还剩34页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Che YiChen 元培資訊管理系 Ch02 1 程式設計 FundamentalProgramming 程式流程圖 Che YiChen Ch02 2 元培資訊管理系 課程大綱 何謂流程圖 流程圖圖例 flowchartingsymbols 如何畫流程圖 流程圖範例 Che YiChen Ch02 3 元培資訊管理系 流程圖 flowchart 通常在進行系統開發時 必須在可能情況下 盡力去計畫出每個可能遭遇的狀況和動作 而描述系統流程常用的方式就是 流程圖 flowchart 流程圖 就如名字所示 是描述 系統進行流程 的一種圖表 他不僅描寫了系統由頭至尾的順序 更應盡可能的敘述所有可能的狀況 Che YiChen Ch02 4 元培資訊管理系 流程圖發展步驟 可將流程圖發展步驟分成三大部分 Alessi Trollip 1991 第一層流程圖 Level 1Flowchart 通常少於一頁 對於系統的流程和方法 做一個概略的描述 第二層流程圖 Level 2Flowchart 以 第一層流程圖 為依據 加上必要的決策和分支點 第三層流程圖 Level 3Flowchart 以 第二層流程圖 為基礎 再加上說明 計算 條件判斷 資料處理和使用者輸出入控制等 並不是所有系統 都必須達到 第三層流程圖 使用的時機完全取決於系統的複雜程度 Che YiChen Ch02 5 元培資訊管理系 流程圖圖例 程序 替代處理程序 決策 輸出入預設處理作業 內部儲存裝置 文件多重文件起始 結束點準備作業 人工輸入人工作業接點換頁接點 卡片 打孔紙帶匯合連接點或自動分頁排序 排序合併儲存資料延遲 循序存取儲存裝置 磁碟直接存取儲存裝置顯示 Che YiChen Ch02 6 元培資訊管理系 流程圖圖例 EmbeddedElements Indicatesthatthereareelements i e audio video animation text embeddedinthetoppageorscreen Purchasesubroutine Indicatesacomputerfunctionthatallowstheusertomakepurchases MakeaRequest Asubroutinebyuserrequest wheretheuserisabletorequestinfo aparticularsubroutineetc fromtheprogram i e Dialogueboxforsearch searchresults ProgramDecision twooptions WhenaWebSiteorCD ROMprogramgivestheuseroptionstochoosefrom theselectionmadewillchangehowtheuserproceedsthroughtherestoftheprogram i e Quizgameswithonlytrue falseoryes nooptions Che YiChen Ch02 7 元培資訊管理系 Flowchartsymbols TheProcessingSymbol Displaysthecalculationstobeperformed Arectangleisusedwhenevercalculationsorcomputationsaretobeperformed Asinglevariablemustalwaysbeplacedonthelefthandsideoftheequalsideoftheequalsign thisisthememorylocationintowhichthevalueoftheexpressionisstored Thestatement3 1 Xisinvalidsince3 1isaconstant thelefthandsideoftheequalsideoftheequalsignmustbeavariableandnotaconstant However thestatementX 3isavalidwayofassigningthevalue3tothevariableX Che YiChen Ch02 8 元培資訊管理系 輸出 輸入的方框 Thegeneralformoftheinput outputsymbolistheparallelogram ThecommandsREAD WRITE INPUT PRINT etc areusedintheinput outputsymbol RepresentsanI Ofunction whichmakesdataavailableforprocessing input orfordisplaying output ofprocessedinformation Che YiChen Ch02 9 元培資訊管理系 決策的菱形 Decisionsymbolsprovideameansforconditioningbranching i e transferringtodifferentblocksdependingoncertainconditions Conditionalbranchesallowforbypassingofcertainblocksintheflowchart Inthiswayaflowchartcanexhibitseveralalternatepaths whichmaybetakendependingonwhetherornotcertainconditionsaremet Alldecisionsmustultimatelybemadeintermsofacomparisonbetweentwovariablesorexpressions Che YiChen Ch02 10 元培資訊管理系 系統流程製作的方法 系統流程製作所採用的方法 可由所採用的程式語言 編輯系統和所擁有的資源與工具等因素來決定 另外 也包括了你所能掌握的時間 人力 費用等客觀條件 詳細的編製流程和步驟 如下面敘述 程序一 Level 1Flowchart 採用簡單而明瞭的方式來描述一個程序的進行 沒有任何分岐或決策的點 它能讓大部份的人一目了然 無須加上任何細節 Che YiChen Ch02 11 元培資訊管理系 系統流程製作的方法 程序二 Level 2Flowchart 當Level 1流程圖完成之後 若條件上許可的話 下一步就要進行Level 2流程圖之編製 原則上將Level 1流程圖之處理程序 長方形符號 加上說明 解釋和安排 原則上應包括 主要分支 和 主要流程 程序三 Level 3Flowchart 對於一般簡單的系統而言 是不需採用到Level 3流程圖的 但是 若程式研發人員採用傳統程式語言來發展的話 那麼Level 3流程圖可能就是必要的了 因為程式設計師必須對系統全部的架構有所瞭解 若採用的是別人已經開發好的元件 Level 3流程圖就不是那麼必要了 Che YiChen Ch02 12 元培資訊管理系 系統流程製作的工具 人工方式利用 流程圖尺 來編製流程圖 但完成之後若要修改的話 可要大費周章了 電腦化工具Shapeware公司的VISIO是一套多功能的流程圖編製軟體 操作十分簡便 MicroGrafx公司的ABCFlowCharter此為Windows下一套整合軟體 結合了ABCFlowCharter ABCDataAnalyzer ABCSnapGraphic三套軟體 是全功能的流程繪製工具 它還支援了VisualBasic的設計 和連接Excel與Word物件的功能 ShapewNovaGraph公司的Chartist軟體 此為一共享軟體 Shareware 雖是共享軟體 但麻雀雖小 卻五臟俱全 AdvancedTechnologyGroup公司的SuperFLow 能夠在短時間內完成一流程圖 Che YiChen Ch02 13 元培資訊管理系 如何畫流程圖 Thefollowingaresomeguidelinesinflowcharting Indrawingaproperflowchart allnecessaryrequirementsshouldbelistedoutinlogicalorder Theflowchartshouldbeclear neatandeasytofollow Thereshouldnotbeanyroomforambiguityinunderstandingtheflowchart Theusualdirectionoftheflowofaprocedureorsystemisfromlefttorightortoptobottom Onlyoneflowlineshouldcomeoutfromaprocesssymbol or Che YiChen Ch02 14 元培資訊管理系 如何畫流程圖 Onlyoneflowlineshouldenteradecisionsymbol buttwoorthreeflowlines oneforeachpossibleanswer shouldleavethedecisionsymbol Onlyoneflowlineisusedinconjunctionwithterminalsymbol Che YiChen Ch02 15 元培資訊管理系 如何畫流程圖 Writewithinstandardsymbolsbriefly Asnecessary youcanusetheannotationsymboltodescribedataorcomputationalstepsmoreclearly Iftheflowchartbecomescomplex itisbettertouseconnectorsymbolstoreducethenumberofflowlines Avoidtheintersectionofflowlinesifyouwanttomakeitmoreeffectiveandbetterwayofcommunication Ensurethattheflowcharthasalogicalstartandfinish Itisusefultotestthevalidityoftheflowchartbypassingthroughitwithasimpletestdata Che YiChen Ch02 16 元培資訊管理系 ADVANTAGESOFUSINGFLOWCHARTS Thebenefitsofflowchartsareasfollows Communication Flowchartsarebetterwayofcommunicatingthelogicofasystemtoallconcerned Effectiveanalysis Withthehelpofflowchart problemcanbeanalysedinmoreeffectiveway Properdocumentation Programflowchartsserveasagoodprogramdocumentation whichisneededforvariouspurposes EfficientCoding Theflowchartsactasaguideorblueprintduringthesystemsanalysisandprogramdevelopmentphase ProperDebugging Theflowcharthelpsindebuggingprocess EfficientProgramMaintenance Themaintenanceofoperatingprogrambecomeseasywiththehelpofflowchart Ithelpstheprogrammertoputeffortsmoreefficientlyonthatpart Che YiChen Ch02 17 元培資訊管理系 LIMITATIONSOFUSINGFLOWCHARTS Complexlogic Sometimes theprogramlogicisquitecomplicated Inthatcase flowchartbecomescomplexandclumsy AlterationsandModifications Ifalterationsarerequiredtheflowchartmayrequirere drawingcompletely Reproduction Astheflowchartsymbolscannotbetyped reproductionofflowchartbecomesaproblem Theessentialsofwhatisdonecaneasilybelostinthetechnicaldetailsofhowitisdone Che YiChen Ch02 18 元培資訊管理系 BasicFlowchart 1 Abasicflowchartidentifiesthestartingandendingpointsofaprocess thesequenceofactionsintheprocess andthedecisionorbranchingpointsalongtheway Che YiChen Ch02 19 元培資訊管理系 流程圖範例 2 Drawaflowcharttofindthesumoffirst50naturalnumbers Che YiChen Ch02 20 元培資訊管理系 1 2 3 50 Che YiChen Ch02 21 元培資訊管理系 流程圖範例 3 DrawaflowcharttofindthelargestofthreenumbersA B andC Che YiChen Ch02 22 元培資訊管理系 流程圖範例 4 DrawaflowchartforcomputingfactorialN N WhereN 1 2 3 N Che YiChen Ch02 23 元培資訊管理系 DeploymentFlowChart流程圖範例 5 Orderentry Shipping Accounting Receiveorder CreditOk CheckCustomerstatus Hold NotifyCustomer PrepareShipper FillOrder Ship SendInvoice Y Y N N Che YiChen Ch02 24 元培資訊管理系 練習 九九乘法表相信大家都能琅琅上口 此次的作業就請用流程圖來畫出九九乘法表吧 includemain inti j sum for i 1 i 10 i for j 1 j 10 j sum i j printf d d 2d i j sum printf n Che YiChen Ch02 25 元培資訊管理系 練習 執行的結果 1 1 11 2 21 3 31 4 41 5 51 6 61 7 71 8 81 9 92 1 22 2 42 3 62 4 82 5 102 6 122 7 142 8 162 9 183 1 33 2 63 3 93 4 123 5 153 6 183 7 213 8 243 9 274 1 44 2 84 3 124 4 164 5 204 6 244 7 284 8 324 9 365 1 55 2 105 3 155 4 205 5 255 6 305 7 355 8 405 9 456 1 66 2 126 3 186 4 246 5 306 6 366 7 426 8 486 9 547 1 77 2 147 3 217 4 287 5 357 6 427 7 497 8 567 9 638 1 88 2 168 3 248 4 328 5 408 6 488 7 568 8 648 9 729 1 99 2 189 3 279 4 369 5 459 6 549 7 639 8 729 9 81 其他流程圖範例 Che YiChen Ch02 26 元培資訊管理系 九九乘法表 第一層流程圖分別計算出1 1 1 1 2 2 1 9 9 2 1 2 9 9 81的結果 印出結果 Start End 乘法計算 條件判斷 Che YiChen Ch02 27 元培資訊管理系 九九乘法表 Start End 宣告變數i 1 j 1 sum 0 i 10 j 10 Sum i j Printsum i i 1 j j 1 Print跳行 j 1 流程圖範例一 Y N Y N Che YiChen Ch02 28 元培資訊管理系 九九乘法表 Start End 宣告變數i 1 j 1 sum 0 i 10 j 10 Sum i j Printsum i i 1 j j 1 Print跳行 j 1 流程圖範例二 Y N Y N Che YiChen Ch02 29 元培資訊管理系 九九乘法表 使用VB PrivateSubCommand1 Click Fori 1To9Forj 1To9Printi j i j NextjPrint NextiEndSub 九九乘法表相信大家都能琅琅上口 此次的作業就請用流程圖來畫出九九乘法表吧 includemain inti j sum for i 1 i 10 i for j 1 j 10 j sum i j printf d d 2d i j sum printf n Che YiChen Ch02 30 元培資訊管理系 再接再厲 partI 請畫出下列程式的流程圖本程式預計算出 F F NF 30000 N為一遞減數字從100減至0並當N 49時 F F 2 N並當N 38時 F F N 100預計執行結果為F 30000N 100 F F N F 29900F 29900N 99 F F N F 29801F 29801N 98 F F N F 29703 Che YiChen Ch02 31 元培資訊管理系 再接再厲 partI 流程圖 Start F 30000n 100 F F n 印出結果 F F 2 n n n 1 End N Y n 49 Y F F n 100 n 38 Y N N n 0 Che YiChen Ch02 32 元培資訊管理系 再接再厲 partI 流程圖 Start F 30000n 100 F F n 印出結果 n n 1 End N Y n 0 Che YiChen Ch02 33 元培資訊管理系 再接再厲 partII F 20 21 22 23 2k或 F 1 2 4 8 2k請以上例數學式子畫出其流程圖 本程式將算出F 2 0 2 1 2 2 2 k請輸入次數 K值 101 th f 12 th f 33 th f 74 th f 155 th f 316 th f 637 th f 1278 th f 2559 th f 51110 th f 1023 Che YiChen Ch02 34 元培資訊管理系 再接再厲 partII C語言程式碼 includemain intf 0 n 1

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论