計算機程式 第二單元 Control Structure I 授課教師:廖婉君教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 本課程指定教材為 C++ How to Program,

Slides:



Advertisements
Similar presentations
Operations Management Unit 8: Planning Capacity 授課教師: 國立臺灣大學工商管理學系 黃崇興 教授 本課程指定教材為 Operations Management: Processes and Supply Chains, 10th ed., Lee J.
Advertisements

Inventory Management: Safety Inventory (II) 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第七單元: Inventory Management:
Operations Management Unit 7: Managing Quality (2) 授課教師: 國立臺灣大學工商管理學系 黃崇興 教授 本課程指定教材為 Operations Management: Processes and Supply Chains, 10th ed., Lee.
Andy Guo Planning Demand and Supply in a Supply Chain 第二單元 (3) : Planning Demand and Supply in a Supply Chain 郭瑞祥教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣.
Inventory Management: Safety Inventory ( I ) 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第六單元: Inventory Management:
Operations Management Unit 11: Managing Inventories (2) 授課教師: 國立臺灣大學工商管理學系 黃崇興 教授 本課程指定教材為 Operations Management: Processes and Supply Chains, 10th ed.,
Pricing and Revenue Management in the Supply Chain 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第十二單元 (2) : Pricing.
Determining Optimal Level of Product Availability Optimal Matching of Supply and Demand (III) 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC.
新生講座 8.Reading Critically : Be a critical reader
1 Self Knowledge 自我知識 第六單元: Historical background: Locke 歷史背景 : 洛克 梁益堉 教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣.
Designing the Distribution Network in a Supply Chain 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第十二單元 (3) : Designing.
佛學概論 第七講:《般若經》的佛法教學 授課教師:國立臺灣大學哲學系 蔡耀明 教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版 1.
計算機程式 第十一單元 Operator Overloading I 授課教師:廖婉君教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 本課程指定教材為 C++ How to.
計算機概論 ( 上機實習部分 ) 每週上課講義 授課教師 : 吳槐桂 最後更新 : 2004/10/21.
Student Library Workshop Higher Diploma (Early Childhood Education)
 課程網頁 :  講師姓名 : 張苑 ( ㄩㄢˋ ) 瑩  實驗室 : 資電館 734 室 
本作品由香港理工大學應用物理學系的黃文翰製作,以共享創意姓名標示 - 非商業性 - 相同方式分享 3.0 香港 授權條款釋出。如欲瀏覽本授權條款之副本,請造訪 。共享創意姓名標示.
真理大學航空運輸管理學系 實務實習說明. 實務實習部份 實務實習 校內實習 校外實習 實習時數必須在 300 小時 ( 含 ) 以上才承認 校內實習時數及實習成績。 二個寒假 各一個月 暑假兩個月.
長訊科技 EVRCOM Voice Mail System 使用者操作說明及流程. 自動總機 -- 來電語音轉接服務流程 ( 範例流程 )
真理大學航空服務管理學系 實務實習說明. 實務實習部份 實務實習 校內實習 校外實習 實習時數必須在 300 小時 ( 含 ) 以上才承認 校內實習時數及實習成績。 二個寒假 各一個月 暑假兩個月.
教材名稱:網際網路安全之技術及其應用 (編號: 41 ) 計畫主持人:胡毓忠 副教授 聯絡電話: 教材網址: 執行單位: 政治大學資訊科學系.
資訊教育 吳桂光 東海大學物理系助理教授 Tel: 3467 Office: ST223 Office hour: Tue, Fri. (10-11am)
Designing the Distribution Network in a Supply Chain 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第十 三單元 (1) :
Inventory Management: Cycle Inventory 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第四單元: Inventory Management:
授課教師:楊宏智教授 1 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用.
Sourcing Decisions in a Supply Chain 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第十一單元 : Sourcing Decisions in.
1 西方文明史 第二講: 兩河與埃及 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版 劉 慧 教授.
1 Survey of Selected Western Classics Unit 8: 如何讀莎劇 授課教師 : 國立臺灣大學外國語文學系邱錦榮 教授 【本著作除另有註明外,採取創 CC 「姓名標示- 非商業性-相同方式分享」台灣 3.0 版授權釋出】創 CC 「姓名標示- 非商業性-相同方式分享」台灣.
H.-W. Sinn European Law and Life Culture 第四單元: The European Competitveness Crisis Lecturer: Hans-Werner Sinn, Ifo Institute for Economic Research Unless.
Supply Chain Coordination & Information Integration 》【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第七單元 (2) : Supply.
Andy Guo Planning Demand and Supply in a Supply Chain 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第三單元 (1) : Planning.
計算機程式 第十四單元 Polymorphism 授課教師:廖婉君教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 本課程指定教材為 C++ How to Program, 7/e,
Operations Management Unit 10: Managing Inventories (1) 授課教師: 國立臺灣大學工商管理學系 黃崇興 教授 本課程指定教材為 Operations Management: Processes and Supply Chains, 10th ed.,
計算機程式 第四單元 Function I 授課教師:廖婉君教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 本課程指定教材為 C++ How to Program, 7/e,
Determining Optimal Level of Product Availability Optimal Matching of Supply and Demand (III) 1 蔣明晃教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用.
計算機程式 第五單元 Function II 授課教師:廖婉君教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 本課程指定教材為 C++ How to Program, 7/e,
1 西方文明史 第十三講:中古歐洲學術 ─ 大學、士林哲學 劉 慧 教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版.
Managing Transportation in a Supply Chain 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第十一單元 (2) : Managing Transportation.
計算機程式 第一單元 Introduction to Computers, the Internet and the WWW 授課教師:廖婉君教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣.
Strategic Framework to Analyze Supply Chains 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第一單元: Strategic Framework.
Determining Optimal Level of Product Availability Optimal Matching of Supply and Demand (III) 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC.
1 Self Knowledge 自我知識 第十三單元: Acquaintance theories: objections and replies 親知理論的困難與回應 梁益堉 教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用.
Legal and legislative crisis in EU and Asia : analysis and reform models? 【本著作除另有註明外,採取創用 CC 「姓名標 示-非商業性-相同方式分享」台灣 3.0 版授權 釋出】創用 CC 「姓名標 示-非商業性-相同方式分享」台灣.
LI & FUNG 【本著作除另有註明外,採取創用 CC 「姓名標示-非商業性-相 同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示-非商業性-相 同方式分享」台灣 3.0 版 郭瑞祥教授 第二單元: Case Study- Li & Fung Lifung group 1.
1 西方文明史 第六講: 羅馬(二) 劉 慧 教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版.
Inventory Management: Cycle Inventory-II 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第五單元: Inventory Management:
西方文明史 第一講: 城市與文明 1 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版 劉 慧 教授.
Determining Optimal Level of Product Availability Optimal Matching of Supply and Demand (III) 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC.
Chap. 12 The Health Benefits of Recreational Activities on Leisure Farms in Taiwan (III) 張俊彥 Chun-Yen Chang 國立臺灣大學園藝學系教授 國立臺灣大學園藝暨景觀學系 【園藝療法 】 【本著作除另有註明外,採取創用.
1 由佛典選讀入手之二 巴利經典選讀 第六講:由佛典選讀入手之二 巴利經典選讀 授課教師:國立臺灣大學哲學系 蔡耀明 教授 1 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版.
西方文明史 第十五講: 英法百年戰爭 劉 慧 教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版 1.
計算機程式 第七單元 Pointers and Strings 授課教師:廖婉君教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 本課程指定教材為 C++ How to Program,
Operations Management Unit 9: Managing Process Constraints 授課教師: 國立臺灣大學工商管理學系 余峻瑜 教授 本課程指定教材為 Operations Management: Processes and Supply Chains, 10th.
第十六單元:歐盟法與生命對話 歐盟法研討會 列強權力衝突間的緩衝區政經策略 EU Conflict Management, the Strategy of Politics and Economics in “Neutral Area” within Conflict of Super Powers.
Survey of Selected Western Classics Unit 2: A Rose for Emily 授課教師 : 李欣穎副教授 【本著作除另有註明外,採取創 CC 「姓名標示- 非商業性-相同方式分享」台灣 3.0 版授權釋出】創 CC 「姓名標示- 非商業性-相同方式分享」台灣.
計算機程式 第十三單元 Inheritance 授課教師:廖婉君教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 本課程指定教材為 C++ How to Program, 7/e,
Ch3-2. Language and Human Migration 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】 The “Work” under the Creative Commons Taiwan 3.0 License of “BY-NC-SA”.
Creating and Negotiating Peace Structures: Difficulties for Small Nations Caught Between Superpowers Part 2: Difficulties with Economic Peace Structures.
計算機程式 第十二單元 Operator Overloading II 授課教師:廖婉君教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 本課程指定教材為 C++ How to.
Operations Management Unit 1: Using Operations to Compete 授課教師: 國立臺灣大學工商管理學系 黃崇興 教授 本課程指定教材為 Operations Management: Processes and Supply Chains, 10th ed.,
Operations Management Unit 12: Designing Effective Supply Chains 授課教師: 國立臺灣大學工商管理學系 余峻瑜 教授 本課程指定教材為 Operations Management: Processes and Supply Chains,
歐盟法與生命文化 ( 二 ) 第一單元 授課教師: Dr. Lukas Lien, University of Hamburg, Germany European Union as Paradigm of globalization-In mirror of German Thinking Tradition.
歐盟法與生命文化 (二) 第七單元 EU finance policies and crisis management Ideas for a new strategy of growth for Europe and Asia! 授課教師: Mr. Dieter Lutzenberger 1 【本著作除另有註明外,採取創用.
歐盟法與生命文化 ( 二 ) 第二單元 Legal and legislative crisis in EU and Asia : analysis and reform models? 授課教師: Dr. Claudius Petzold 德國檢察官 1 【本著作除另有註明外,採取創用 CC 「姓名標示-非.
後現代主義藝術 I : 對藝術機制的批判 ─ 觀念、地景與表演藝術 劉瑞琪 本著作除另有註明外,採取創用 CC 「姓名標示-非 商業性-相同方式分享」台灣 2.5 版授權釋出創用 CC 「姓名標示-非 商業性-相同方式分享」台灣 2.5 版.
歐盟法與生命文化 (二) 第九單元 Germany’s dual vocational training system: a model for other countries? 授課教師: Mr. Raoul Kubitschek Christian Mahnke Manager Science &
實驗經濟學一:行為賽局論 Experimental Economics I: Behavioral Game Theory 補充材料:於現實驗證賽局理論:Swedish LUPI Lottery 賽局 Additional Material: “Testing Game Theory in.
Aristotle I Man as a Political Animal
實驗經濟學一:行為賽局論 Experimental Economics I: Behavioral Game Theory 第九講:學習理論:制約、計牌與EWA Lecture 9: Learning: Reinforcement, Fictitious Play, and EWA 授課教師:國立臺灣大學.
Introduction to Digital Speech Processing
Presentation transcript:

計算機程式 第二單元 Control Structure I 授課教師:廖婉君教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 本課程指定教材為 C++ How to Program, 7/e, Harvey M. Deitel and Paul J. Deitel, both from Deitel & Associates, Inc. © 2010 。 本 講義僅引用部分內容,請讀者自行準備。 1 本作品轉載自 Microsoft Office 2007 多媒體藝廊,依據 Microsoft 服務合約及著作權法 第 46 、 52 、 65 條合理使用。 Microsoft 服務合約

Control Structure Three control structures o Sequence structure o Selection structure o Repetition structure Selection structure o Single selection: if o Double selection: if…else o Multiple selection: nested if/else, switch Repetition structure o while o do…while o for Stacking vs. nesting 2

Algorithm and Pseudo-code Algorithm: o A series of action and decision o Pseudo code and flow chart o E.g., Fig.4.1 on p.112 ← pseudo code o E.g., Fig.4.2 on p.113 ← flow chart 3

Example of Pseudo code 4 p.112

Example of Flowchart 5 add grade to total add 1 to counter corresponding C++ statement total=total+grade; corresponding C++ statement counter=counter+1;

6 Sequence Selection if statement (single selection) [f] [t] if...else statement (double selection) [t][f] switch statement with break (multiple selection) break … default processing [t] [f] 7 Control Structures(I)

7 Repetition while statement [t] [f] do…while statement [t] [f] for statement body initialization increment [t] [f] 7 Control Structures(II)

if Selection if (condition) statement; 8 e.g., int a; cin>>a; if(a>=9) cout<<“:p”; e.g., if(a<=3) cout<<“:o”; cout<<“bye~”; e.g., if(a 9); cout<<“  ”; cout<<“:-<”; e.g., if(a<-8); cout<<“:p”; cout<<“bye~”; e.g., if(1<a<9) { cout<<“:p”; cout<<“bye~”; }

if/else Selection if (condition) statement1; else statement2; 9 e.g., int a; cin>>a; if(a>=2) cout<<“ ”; else cout<<“  ”; e.g., if(a<9) cout<<“ ”; cout<<“bye~”; else cout<<“  ”; cout<<“hello”; e.g., if(a>4) cout<<“:p”; else cout<<“:*p”; cout<<“bye..”; e.g., if(a=3) cout<<“:_(”; else cout<<“bye”; cout<<“zzz..”; Note: conditional operator: ? :

Nested if/else selection Nested if/else if (condition) statement; else if (condition) statement; else if (condition) statement; else if (condition) statement; else statement; 10 e.g., if(a==1) cout<<“Mon”; else if(a==2) cout<<“Tue”; else cout<<“bye..”; e.g., if(a>=3) if(a%2) cout =3”; else cout<<“a<3”;

11 stacking nesting

More on Operators 12 OperatorsAssociativityType ()left to rightparentheses static_cast () left to rightunary(postfix) ! right to leftunary(prefix) * / %* / % left to rightmultiplicative left to rightadditive > left to rightinsertion/extraction >= left to rightrelational == != left to rightequality &&left to rightlogical AND ||left to rightlogical OR ?:right to leftconditional = += -= *= /= %= right to leftassignment,left to rightcomma

版權聲明 13 頁碼作品版權圖示來源 / 作者 1-14 本作品轉載自 Microsoft Office 2007 多媒體藝廊,依據 Microsoft 服務合約及著作權法第 46 、 52 、 65 條合理使用。 2 Open Clip Art Library ,作者: ricardomaia ,本作品轉載自: ,瀏覽日期: 2013/1/16 。 3 Open Clip Art Library ,作者: ryanlerch ,本作品轉載自: ,瀏覽日期: 2013/1/16 。 4 Open Clip Art Library ,作者: aritztg ,本作品轉載自: ,瀏覽日期: 2013/1/10 。 5 C++ How to Program, 7/e ,作者: Harvey M. Deitel and Paul J. Deitel , 出版社: Deitel & Associates ,出版日期: 2010 , P.113 。 依據著作權法第 46 、 52 、 65 條合理使用。

版權聲明 14 頁碼作品版權圖示來源 / 作者 6-7 C++ How to Program, 7/e ,作者: Harvey M. Deitel and Paul J. Deitel , 出版社: Deitel & Associates ,出版日期: 2010 , P.193 。 依據著作權法第 46 、 52 、 65 條合理使用。 11 臺灣大學電機系 廖婉君教授 12 C++ How to Program, 7/e ,作者: Harvey M. Deitel and Paul J. Deitel , 出版社: Deitel & Associates ,出版日期: 2010 , P.147 。 依據著作權法第 46 、 52 、 65 條合理使用。