stanford,computer,language,国外,英文,原版,教材,计算机,编程
更新时间:2023-04-10 04:28:01 阅读量: 实用文档 文档下载
Case Study Format (p19)
1) Problem Specification
– amount of money (positive integer only) in a bank account. than zero) to be withdrawn.
– in the account, by more than $50, the program is to display a message that the transaction is refused, and the – equal to the amount in the account, the transaction is – in the account, by up to $50, the program is to accept the transaction and display the new balance, with a warning that the account is overdrawn. 1. Problem specification
2. Analysis
3. Design
4. Test plan
5. Implementation
6. Testing
A program is required which will ask the user for the It will then ask for the amount of money (integers greater If the amount to be withdrawn is greater than the amount unchanged balance is displayed.
If the amount of money to be withdrawn is less than or accepted and the new balance in the account is displayed. If the amount to be withdrawn is greater than the amount
2) Analysis
Overdraft_Limit : constant Integer := -50;Zero : constant Integer := 0;
Balance 3) Design
? outputs, we can now list the steps necessary to solve the problem ? – >= zero
– >= -50 and < 0
– or < -50 ? ? Data Requirements and Formulas – Problem Constant –Problem inputs --balance on account
Withdrawal --amount to withdraw from account –Problem outputs Resulting_Balance --Balance after withdrawal – Formulas or relations Resulting balance = Balance – withdrawal
Having listed the problem inputs and The Algorithm --First try:
1. Get balance and withdrawal
2. Calculate resulting balance
3. Is new balance
3) Design
? then
new balance between zero and overdraft limit
else
4) Test Plan
The Algorithm --Refinement:
1. Get balance and withdrawal
1. Get balance
2. Get withdrawal
2. Calculate resulting balance
1. New balance = old balance – withdrawal
3. If new balance is >= zero 1. Indicate transaction accepted
else if 2. Indicate overdraft is used
3. Indicate transaction rejected
? Cases that need to be tested are: – Balance = -40
? Withdrawal = 5, 10, 11
– Balance = 0
? Withdrawal = 5, 50, 51
– Balance = 20
? Withdrawal = 20, 70, 71
String Operations
? Assignment
Alphabet := “abcdefghijklmnopqrstuvwxyz”
Response := Alphabet;
? Concatenation (&)
Alphabet(1..3) & Alphabet(26..26)
Put(Item => “The alphabet is “ &
Alphabet & “.”);
Sub-strings
? Inpidual character: specify position – alphabet(10) 'j'
alphabet(17) 'q'
? Slice: specify range of positions
– alphabet(20..23) "tuvw"
alphabet(4..9) "defghi" ? Assign to compatible slice
– response(1..4) := "FRED";
response "FREDefghijklmnopqrstuvwxyz"
正在阅读:
stanford,computer,language,国外,英文,原版,教材,计算机,编程04-10
那一刻,我真幸福作文800字07-14
2015年新课标全国二卷英语高考题 含答题卡(可用于考试)及答案07-22
A-a-01:一手房屋贷款申请表07-19
物理化学第二章作业及答案06-09
2012年造价工程师《建设工程计价与控制》真题及答案解析11-06
竹屋 - 图文10-01
浙江大学远程教育 7次在线妇科护理学作业04-22
- 教学能力大赛决赛获奖-教学实施报告-(完整图文版)
- 互联网+数据中心行业分析报告
- 2017上海杨浦区高三一模数学试题及答案
- 招商部差旅接待管理制度(4-25)
- 学生游玩安全注意事项
- 学生信息管理系统(文档模板供参考)
- 叉车门架有限元分析及系统设计
- 2014帮助残疾人志愿者服务情况记录
- 叶绿体中色素的提取和分离实验
- 中国食物成分表2020年最新权威完整改进版
- 推动国土资源领域生态文明建设
- 给水管道冲洗和消毒记录
- 计算机软件专业自我评价
- 高中数学必修1-5知识点归纳
- 2018-2022年中国第五代移动通信技术(5G)产业深度分析及发展前景研究报告发展趋势(目录)
- 生产车间巡查制度
- 2018版中国光热发电行业深度研究报告目录
- (通用)2019年中考数学总复习 第一章 第四节 数的开方与二次根式课件
- 2017_2018学年高中语文第二单元第4课说数课件粤教版
- 上市新药Lumateperone(卢美哌隆)合成检索总结报告
- 英文
- 原版
- stanford
- computer
- language
- 国外
- 教材
- 编程
- 计算机
- 会计基础章节练习题及答案
- 商业银行全面风险管理办法
- Depositional-architecture-of-growth-fault-related-wave-domin
- 特色团支部申报材料
- 小学奥数二元一次方程组
- 主播连麦的5个技巧和16个惩罚游戏
- 2022年石家庄经济学院会计学综合之中级财务会计复试仿真模拟三套
- 计算机三级网络技术最新历年笔试真题(2005--2012.03)及答案
- 基于.NET 的网上书店管理系统设计与实现
- 广西师范大学2013年考研专业课产品目录
- 九年级数学上册第一二章测试题
- 玫瑰香氛 打造粉色魅惑
- 网络安全教育宣传活动方案
- 百世快递业务员劳动合同
- 防火墙与入侵检测期末复习题
- 定西市落实草原生态保护补助奖励政策实施计划方案及对策
- 周星工程公司诉复审委、第三人应用材料(中国)有限公司专利行政
- 2022-2022年中国水性漆行业市场发展战略分析及投资前景专项预测
- 用路由器连接两台电脑如何设置上网图解
- 2014年甘肃10000名下基层考试、三支一扶考试、进村进社考试公共