Pseudocode Programming Process

本文介绍了使用伪代码的指南,如用类英语语句精确描述操作、避免目标编程语言语法元素等。还阐述了使用这种风格伪代码的好处,如便于评审、支持迭代细化等。此外,给出了例程设计的步骤,包括检查先决条件、定义问题、编写伪代码等。

Guidelines for using pseudocode
1. Use English-like statements that precisely describe specific operations.
2. Avoid syntactic elements from the target programming language.
3. Write pseudocode at the level of intent, rather than how the approach will be implemnet in the target language.
4. Write pseudocode at a low enough level that generating code from it will nearly automatica.
Once the pseudocode is written, you build the code around it and the pseudoccode turns into programming-language comments.

Benefits you can expect from using this style of pseudocode
1. Pseudocode makes reviews easier.
2. Pseudocode supports the idea of iterative refinement.
You start with a high level design, refine the design to pseudocode, and then refine the pseudocode to source code.
3. Pseudocode makes changes easier.
A few lines of pseudocode are easier to change than a page of code.
4. Pseudocode minimizes commenting effort.
5. Pseudocode is easier to maintain than other forms of design documentation.
With other approaches, design is separated from the code, and when one changes, the two fall out of agreement.

Design the Routine
1. Check the prerequisties.
Check to be sure that the routine is actually called for, at the very least indirectly, by the project's requirements.
2. Define the problem the routine will solve.
       The information the routine will hide
       Input to the routine
       Output from the routine
       Precondition that are guaranteed to be true.
       Post condition that the routine guarantees will be true.
3. Name the routine
4. Decide how to test the routine.
5. Think about error handling.
6. Think about efficiency.
7. Research functionality available in the standard libraries.
8. Research the algorighms and data types.
9. Write the pseudocode.
10. Think about the data.
Definitions of key data types are useful to have when you design the logic of a routine.
11. Check the pseudocode.
12. Try a few ideas in pseudocode, and keep the best.
13. Turn the pseudocode into high-level comments.
14. Fill in the code below each comment.
15. Check whether code should be further factored.


已经博主授权,源码转载自 https://pan.quark.cn/s/a4b39357ea24 常见问题解答 网页打开速度慢或者打不开网页? 受到多种因素的影响,对于非会员用户我们无法提供最优质的服务。 如果您希望得到最棒的体验,请至大会员页面("右上角菜单 → 大会员")根据说明操作。 请注意:受制于国际网络的诸多不确定性,我们无法对任何服务的可靠性做出任何保证。 如果出现了网络连接相关的问题,我们建议您先等待一段时间,之后再重试。 如果您在重试后发现问题仍然存在,请联系我们,并说明网络问题持续的时间。 图片下载后无法找到? 打开"右上角菜单 → 更多 → 修改下载路径",在弹出的对话框中可以看到当前图片的保存路径。 此外,由于网络因素,在保存图片之后,等待屏幕下方出现"已保存到..."后,才能在本地找到图片。 如何更改图片保存的目录? 请参见"右上角菜单 → 更多 → 修改下载路径"。 翻页不方便? 在点进某个图片后,通过在图片上向左或向右滑动,即可翻页查看下一个作品。 如何保存原图/导出动图? 长按图片/动图,在弹出的菜单中选择保存/导出即可。 输入账号密码后出现"进行人机身份验证"? 此为pixiv登陆时的验证码,请按照要求点击方框或图片。 在pxvr中注册pixiv账号后,收到验证邮件,无法访问邮件中的验证链接? 请复制邮件中的链接,打开pxvr中的"右上角菜单 → 输入地址"进行访问。 能否自动将页面内容翻译为汉语? 很抱歉,pxvr暂不提供语言翻译服务。 图片下载类型是否可以选择? 能否批量下载/批量管理下载? 已支持批量下载多图作品中的所有原图:找到一个多图作品,进入详情页面后,点击图片进入多图浏览模式,长按任意一张图片即可看到批量下载选项。 关于上述其他功能,我们...
考虑局部遮阴的光伏PSO-MPPT控制模型(Simulink仿真实现)内容概要:本文介绍了基于Simulink仿真实现的考虑局部遮阴的光伏PSO-MPPT控制模型,旨在通过粒子群优化(PSO)算法解决光伏发电系统在局部阴影条件下最大功率点跟踪(MPPT)的效率问题。文档不仅提供了该模型的技术实现方法,还列举了大量相关的MATLAB/Simulink仿真资源,涵盖电力系统、智能优化算法、机器学习、路径规划、信号处理等多个科研方向,适用于复现高水平期刊论文和开展创新性研究。文中强调科研需逻辑缜密、善于借力,并提倡结合实际仿真与理论分析以提升研究深度。 适合人群:具备一定电力电子、自动控制或新能源背景,熟悉MATLAB/Simulink环境,从事光伏系统优化、智能算法应用或相关领域研究的研发人员及硕博研究生。 使用场景及目标:①研究局部遮阴下光伏系统MPPT控制策略的性能提升;②利用PSO等智能优化算法解决非线性、多峰值优化问题;③复现SCI/EI级别论文中的MPPT控制模型;④开展光伏系统建模与仿真教学或项目开发。 阅读建议:建议读者结合文档提供的网盘资源,下载完整代码与模型文件,按照目录顺序逐步学习,重点理解PSO算法在MPPT中的应用机制,并通过修改参数、对比实验等方式深入掌握仿真细节,提升工程实践与科研创新能力。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值