1 / 9

第六节 银行密码系统

第六节 银行密码系统. 任务.   要求同学模拟设计一个银行密码系统,密码输入正确才能进入银行系统,允许输错密码,但是只有 3 次错误机会,一旦错误次数达到 3 次,系统将提示并吞卡。. 问题分析.   根据任务说明,可以发现问题的关键在 2 个方面: 对输入的密码进行正误判断。(可以用分支结构实现) 统计输错密码的次数。(可以用循环结构实现). 流程图的表示.   参考书本第十二节内容中的算法流程图来完成“银行密码系统”的流程图描述。. 流程图的表示. 流程图的表示. 算法的实现.

sanam
Download Presentation

第六节 银行密码系统

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 第六节 银行密码系统

  2. 任务   要求同学模拟设计一个银行密码系统,密码输入正确才能进入银行系统,允许输错密码,但是只有3次错误机会,一旦错误次数达到3次,系统将提示并吞卡。

  3. 问题分析 •   根据任务说明,可以发现问题的关键在2个方面: • 对输入的密码进行正误判断。(可以用分支结构实现) • 统计输错密码的次数。(可以用循环结构实现)

  4. 流程图的表示   参考书本第十二节内容中的算法流程图来完成“银行密码系统”的流程图描述。

  5. 流程图的表示

  6. 流程图的表示

  7. 算法的实现   参考书本第十二节内容中的程序代码来编写出“银行密码系统”的程序代码,并调试运行。

  8. 算法的实现 Dim i As Integer Dim n As String Private Sub Form_Load() 填写语句 Do 填写语句 If 填写语句 Then 填写语句 End Else 填写语句 填写语句 End If Loop While 填写语句 填写语句 End End Sub

  9. 课堂小结   通过解决“银行密码系统”这个问题初步掌握综合运用分支结构和循环结构算法以及程序实现的方法 。

More Related