欢迎来到麦多课文档分享! | 帮助中心 海量文档,免费浏览,给你所需,享你所想!
麦多课文档分享
全部分类
  • 标准规范>
  • 教学课件>
  • 考试资料>
  • 办公文档>
  • 学术论文>
  • 行业资料>
  • 易语言源码>
  • ImageVerifierCode 换一换
    首页 麦多课文档分享 > 资源分类 > PPT文档下载
    分享到微信 分享到微博 分享到QQ空间

    ALGORITHMS FLOWCHARTING II.ppt

    • 资源ID:378183       资源大小:124KB        全文页数:20页
    • 资源格式: PPT        下载积分:2000积分
    快捷下载 游客一键下载
    账号登录下载
    微信登录下载
    二维码
    微信扫一扫登录
    下载资源需要2000积分(如需开发票,请勿充值!)
    邮箱/手机:
    温馨提示:
    如需开发票,请勿充值!快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如需开发票,请勿充值!如填写123,账号就是123,密码也是123。
    支付方式: 支付宝扫码支付    微信扫码支付   
    验证码:   换一换

    加入VIP,交流精品资源
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    ALGORITHMS FLOWCHARTING II.ppt

    1、ALGORITHMS & FLOWCHARTING II,LOOPS,Computers are particularly well suited to applications in which operations are repeated many times. If the same task is repeated over and over again a loop can be used to reduce program size and complexity,Example 8: Write an algorithm and draw a flowchart to calcu

    2、late 24 .,Algorithm: Step 1: Base 2 Step 2: Product Base Step 3: Product Product * Base Step 4: Product Product * Base Step 5: Product Product * Base Step 6: Print Product,Flowchart,Question: What happens if you want to calculate 2 to the power of 1000? Answer: Use a LOOP (repeated execution of the

    3、same set of instructions),Example 9: Write an algorithm and draw a flowchart to calculate 24 using a loop approach? Verify your result by a trace table.,Algorithm:,Step 1: Base 2 Step 2: Power 4 Step 3: Product Base Step 4: Counter 1 Step 5: While Counter PowerRepeat Step 5 through step 7 Step 6: Pr

    4、oduct Product * Base Step 7: Counter Counter +1 Step 8: Print Product,TRACING,Example 10: Write down an algorithm and draw a flowchart to find and print the largest of three numbers. Read numbers one by one. Verify your result by a trace table. (Use 5, 7, 3 as the numbers read),Algorithm,Step 1: Inp

    5、ut N1 Step 2: Max N1 Step 3: Input N2 Step 4: If (N2Max) thenMax = N2endif Step 5: Input N3 Step 6: If (N3Max) then Max = N3endif Step 7: Print “The largest number is:”,Max,Flowchart & Tracing,N1 N2 N3 Max N2Max N3Max Step1: 5 ? ? ? ? ? Step 2: 5 ? ? 5 ? ? Step 3: 5 7 ? 5 T ? Step 4: 5 7 ? 7 T ? Ste

    6、p 5: 5 7 3 7 F F Step 6: 5 7 3 7 F F Step 8: Print Largest Number is 7,Example 11: Write down an algorithm and draw a flowchart to find and print the largest of N (N can be any number) numbers. Read numbers one by one. Verify your result by a trace table. (Assume N to be 5 and the following set to b

    7、e the numbers 1 4 2 6 8 ),Algorithm:,Step 1: Input N Step 2: Input Current Step 3: Max Current Step 4: Counter 1 Step 5: While (Counter Max) thenMax Next endif Step 9: Print Max,Tracing,Prob. 1. Write an algorithm and draw a flowchart to print the square of all numbers from LOW to HIGH. Test with LO

    8、W=1 and HIGH=10. Prob. 2. Write an algorithm and draw a flowchart to print the SUM of numbers from LOW to HIGH. Test with LOW=3 and HIGH=9. Prob. 3. Write an algorithm and draw a flowchart to print the SUM of numbers from LOW to HIGH. Test with LOW=3 and HIGH=9. Prob. 4. Write an algorithm and draw

    9、a flowchart to print all numbers between LOW and HIGH that are divisible by NUMBER. Prob. 5. Write an algorithm and draw a flowchart to print all the prime numbers between LOW and HIGH. Test with LOW=1 and HIGH=100.,Prob. 6. Write an algorithm and draw a flowchart to count and print all numbers from

    10、 LOW to HIGH by steps of STEP. Test with LOW=0 and HIGH=100.Prob. 7. Write an algorithm and draw a flowchart to count and print all numbers from HIGH to LOW by steps of STEP. Test with HIGH=100 and LOW=0.Prob. 8. Write an algorithm and draw a flowchart to print the multiplication table for 6s. i.e.

    11、- 1 6 = 6- 2 6 = 12 - 12 6 = 72,Prob. 9. Write an algorithm and draw a flowchart to print the complete multiplication table for 1s. through 12s. - 1 1 = 1, 1 2 = 2, 1 12 = 12 - 2 1 = 2, 2 2 = 4, 2 12 = 24 - 12 1 = 12, 12 2 = 24, 12 12 = 144Prob. 10. Write an algorithm and draw a flowchart to arrange

    12、 N values read from the input in ascending order. Prob. 11. Write an algorithm and draw a flowchart that will find and print the product of 3 numbers.,Prob. 12. Write an algorithm and draw a flowchart that will find and print The factorial of NUMBER is FACTORIAL. Test the flowchart for NUMBER=5.Prob. 13. Write an algorithm and draw a flowchart that will find and print the number of vowels in a given set of characters and print there number of occurrences.,


    注意事项

    本文(ALGORITHMS FLOWCHARTING II.ppt)为本站会员(deputyduring120)主动上传,麦多课文档分享仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知麦多课文档分享(点击联系客服),我们立即给予删除!




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1 

    收起
    展开