- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
ModuleInvocationamp;amp;Parameters-CollegeofComputing模块调用amp;amp;参数计算学院.ppt
Module Invocation Parameters Tracing the Execution of Instructionswith the Activation Stack Module Invocation Parameters As Modules are Invoked algorithm Nonsense // dummy alg to show calls this_var isoftype Num this_var - 6 this_var - Square(this_var) Output_Results(this_var) endalgorithm // Nonsense Use parameters to specify which of your variables you wish to have communicate with the subroutine you are calling. In this case, this_var is being passed first to function Square, and then is passed to procedure Output_Results. As Modules are Declared function Square returnsa Num (the_num isoftype in Num) // returns the square of the_num Square returns (the_num * the_num) endfunction procedure Output_Results (answer isoftype in Num) // prints out answer with text message print(“The answer is”, answer) endprocedure Each parameter variable has two types: a parameter type and a data type Each function also has its own data type specifying the type of data of its result Specifying Multiple Parameters function Min returnsa Num (num_one, num_two, num_three isoftype in Num) //returns smallest of three numbers if ((num_one = num_two) AND (num_one = num_three )) then Min returns num_one elseif ((num_two = num_three ) AND (num_two = num_one)) then Min returns num_two else Min returns num_three endif endfunction Using Multiple Parameters In use… algorithm Example small, medium, large, smallest isoftype Num small - 4 medium - 6 large - 34 smallest - Min(small, medium, large) print(“The smallest is”, smallest) endalgorithm Formal Parameter Lists In the declaration header: function Min returnsa Num (num_one,num_two,num_three isoftype in Num) the formal parameter list (parameter variables and their types are declared here) Actual
您可能关注的文档
- 小学一年级语文课件《入学教育》.ppt
- New Member Ministry新会员部.ppt
- 砂糖橘生产实践及科学施肥技术讲座_图文.ppt
- Resonance - TITAN-PHYSICS - Wikispaces共振titan-physics - wiki空间.ppt
- 2012年《随堂优化训练》历史必修三 岳麓理科 第一单元 第4课 宋明理学 :精品课件.ppt
- BMW-5S店资料-垃圾分类培训.ppt
- 岗位分析与职位说明书编写【员工及安全管理】.ppt
- Data Analysis Summary - Cancer Diagnosis Program数据分析总结癌症诊断程序.ppt
- 2012《金版新学案》高三一轮(大纲版)物理(课件):第1章 力 物体的平衡第一章 章末大盘点.ppt
- [PPT]-信息安全综合实验.ppt
最近下载
- 计算机专业(基础综合)模拟试卷3(共456题).pdf VIP
- 项目编号szcg2007041645 项目名称2007年度深圳市储备土地管理.doc
- 离婚登记申请受理回执单民法典版(可直接打印).pdf VIP
- 人教五年级数学上册1.2.2 倍数是小数的实际问题和乘法验算 课时训练.doc VIP
- 光伏电站检修规程(行业标准).docx VIP
- (新版)中移动传输专业L1认证考试复习题库-下(多选题汇总).docx VIP
- 基于大概念的初中音乐单元整体教学设计探索.doc VIP
- 《企业经营数据分析》课件.ppt VIP
- 新闻评论教程(第三版)全套PPT课件.pptx VIP
- 劳务合同范本(厨师、餐饮服务)5篇.docx VIP
文档评论(0)