- 1、本文档共67页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
001C程序设计2
* * 语句: if((C1 C2) || (C3 C4)) S1; else S2; 其中C1,C2,C3和C4是子句,S1和S2是语句。 子句覆盖要求测试数据能使四个从句C1,C2,C3和C 4都分别至少取一次true值和至少取一次false值。 子句覆盖 * * templateclass T int Max(T a[], int n) {// 寻找a [ 0 : n - 1 ]中的最大元素 int pos = 0; for (int i = 1; i n; i++) if (a[pos] a[i]) pos = i; return pos; } 数据集a[0:4]=[2,4,6,8,9]提供何种覆盖 ? 数据集a[0:4]=[4,2,6,8,9]提供何种覆盖 ? 程序1-31 寻找最大元素 * * Edsger Wybe Dijkstra(Algol60编译器设计者和实现者,THE操作系统的设计者,72年图灵奖): “编程的艺术是处理复杂性的技术”。 “测试只能证明错误的存在,不能证明错误不存在”。 关于测试 * * 测试能够发现程序中的错误。一旦测试过程中产生的结果与所期望的结果不同,就可以了解到程序中存在错误。 确定并纠正程序错误的过程被称为调试(debug)。 逻辑推理 程序跟踪 调试(debug) * * 参数传递 递归思想 测试调试 第一章总结 * The two most important concepts in object-oriented programming are the class and the object. In the broadest term, an object is a thing, both tangible and intangible, which we can imagine. A program written in object-oriented style will consist of interacting objects. For a program to maintain bank accounts for a bank, we may have many Account, Customer, Transaction, and ATM objects. An object is comprised of data and operations that manipulate these data. * * * This diagram shows three instances of the Employee class. Their names are Bill, Steve, and Andy. They are more commonly referred to as Employee objects. One key fact to remember: A class must be defined before you can create an instance (object) of the class. * Notice that the name of the message we send to an object or a class must be the same as the method’s name. Because they are the same, the message name is commonly omitted from the diagram as shown above. Because they are the same, the phrase “calling an object’s method” is synonymous to “sending a message to an object.” * The deposit method in the previous slide is an action-only method. It takes some action when called, but returns no answer back to the caller. The getMonthlyFee method above is a value-returning method. When called, it returns a value. A method can be both: executes an action and returns some value. * * 发送消息得到返回值 这个消息没有变量 Acco
您可能关注的文档
- 住院医师规培计划讲述.ppt
- 公共财政学第13章概要.ppt
- 公关礼仪课堂笔记概要.doc
- 公务员乡镇面试概要.doc
- 公关部培训大纲概要.doc
- 公共部门会计的概述概要.ppt
- 公务员个人简历概要.ppt
- (浙美版2012)一年级美术上册心中的太阳.ppt
- (第六讲)第7章数据库查询.ppt
- (第三课时)原子的结构.ppt
- 财务人员述职报告个人亮点.pptx
- 员工安全教育培训.pptx
- 物业前台个人述职报告.pptx
- 人教版 九年级 化学 下册 第十单元 常见的酸、碱、盐《课题3 常见的盐 第1课时 氯化钠、碳酸钠、碳酸氢钠和碳酸钙》作业课件.pptx
- 人教版 九年级 化学 下册 第十单元 常见的酸、碱、盐《课题1 溶液的酸碱性》作业课件.pptx
- 人教版 九年级 化学 下册 第十一单元 化学与社会《大单元专项(三)物质的多样性》作业课件.pptx
- 人教版 九年级 化学 下册 期末学业质量评价.pptx
- 人教版 九年级 化学 下册 第十单元 常见的酸、碱、盐《课题3常见的盐 第3课时盐的化学性质 化肥》作业课件.pptx
- 人教版 九年级 化学 下册 第十一单元 化学与社会《课题2 化学与可持续发展》作业课件.pptx
- 人教版 九年级 化学 下册 第十一单元 化学与社会《课题1 化学与人体健康》作业课件.pptx
文档评论(0)