表格模板-Chart流程图is 精品.ppt
《表格模板-Chart流程图is 精品.ppt》由会员分享,可在线阅读,更多相关《表格模板-Chart流程图is 精品.ppt(23页珍藏版)》请在第一文库网上搜索。
1、Programming ConstructProgramming Construct1)We divide the basic programming construct into three types:Sequential Structure 、Selection Structure and Loop Structure.2)Flow Chart(流程图):is a graphical representation in which specific symbols and necessary letters are used to describe the steps.3)The flo
2、w chart about the three basic programming construct is as follows:ABconditionABconditionASequential structureSelection StructureSelection Structure1、relation operator and relation expression 2、logical operators and logical expression3、if statements4、 switch statements5、 examplesChapter OutlineThree
3、forms: (1)if(expression)statements (2)if( expression ) statements 1 else statements 2 (3)if( expression 1) statements 1 else if (expression 2) statements 2 else if (expression 3) statements 3 else if(expression m) statements m else statements nexexex第第五五章章选选择择结结构构If语语句句的的形形式式Brief Summary if(express
4、ion)statementsexpressionstatementsF(0)T(not 0)ex: if(xy) printf(“%d”,x); Firstly,solve the expression. If the value of the expression is not zero,then the corresponding ststement sequence is excuted. If none of the expression is false,then excute the statements after if derectly.第第五五章章选选择择结结构构If语语句句
5、的的形形式式exampleexpressionstatements1statements2TFex: if(xy) printf(“%d”,x); else printf(“%d”,y);if(expression)statements1 else statements2第第五五章章选选择择结结构构If语语句句的的形形式式exampleexpression1expression2expression3expression4statements1statements2statements3statements4 statements5FFFFTTTTex: if (number500) cost
6、=0.15; else if (number300) cost=0.10; else if (number100) cost=0.075; else if (number50) cost=0.05; else cost=0;nested- if statements第第五五章章选选择择结结构构If语语句句的的形形式式example (1)The expression of three forms behind if-statements always is logical or relation expression.DCL of three if- statements forms(2)In
7、 form2 and forme3,there is a semicolon in front of else, also in the end of all statements.(3)Behind if or else,it may include only one operate statements,also include many statements ,but should be drawed together with brace.( )第第五五章章选选择择结结构构If语语句句的的形形式式Ex: #include main() int x,y; scanf(“%d,%d”,&x
8、,&y); if(xy) x=y; y=x; else x+; y+; printf(“%d,%dn”,x,y); Compile Error!ex: if(a+ba&c+ab) s=0.5*(a+b+c);area=sqrt(s*(s-a)*(s-b)*(s-c); printf(“area=%6.sf”,area); else printf(“it is not a trilateral”); Notice:The brace( “”)s outer face need not semicolon。Because in the brace() there is a full compoun
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 表格模板-Chart流程图is 精品 表格 模板 Chart 流程图 is
