1 / 7

DO IT NOW

DO IT NOW. The array can contain up to 10 rounds. Why does the until loop only run 9 times? Why does the program run even if I have not completed the quiz? What kind of error is this? How do I correct the error?. i = 1 total = 0 REPEAT total = total + round(i) i = i + 1 UNTIL i =10.

oro
Download Presentation

DO IT NOW

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. DO IT NOW The array can contain up to 10 rounds. Why does the until loop only run 9 times? Why does the program run even if I have not completed the quiz? What kind of error is this? How do I correct the error? • i = 1 • total = 0 • REPEAT • total = total + round(i) • i = i + 1 • UNTIL i=10

  2. DO IT NOW Why does the until loop only run 9 times? Because i will equal 10 at the end of the 9th time it loops, which will mean the program will stop before it gets the chance to run 10 times. Why does the program run even if I have not completed the quiz? Because there is no clause to tell it to stop if round(i)=0 What kind of error is this? Logic error , as the program runs but does not do what the programmer intended How do I correct the error? Change the last line of code to UINTIL i>10 or round(i)=0

  3. Learning AIM Prepare for the mid term exam

  4. Learning objectives Identify three areas that you need to revise for the exam Watch revision videos for the areas you have identified Complete the tests after each video to test your understanding

  5. cambridgegcsecomputing.org 10aSURFIR@arkwilliamparker.org Start by selecting COURSE from the tabs We have covered the following sections: Computing Hardware Representation of data in computer systems Programming (apart from the section on machine code)

  6. cambridgegcsecomputing.org Once you have identified the relevant section, find the video(s) you need to watch – complete the test section after each video If you complete any on the worksheets print them off and bring them to me for marking

  7. Learning outcomes By the end of this lesson you will be able to ....

More Related