Algorithms

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Algorithms - Presentation Transcript

    1. Algorithms Sheet 2 Identifying Control Structures
    2. 1. Match the terms sequence , binary selection , multiway selection and iteration to the descriptions that follow:
      • a decision taken in an algorithm which can go either of two ways
      • binary selection
      • (b) decision taken in an algorithm which allows more than two choices
      • multiway selection
      decision two decision more than two
    3. 1. Match the terms sequence , binary selection , multiway selection and iteration to the descriptions that follow:
      • a decision taken in the processing done by an ATM to either withdraw, deposit or check account balance, depending on the key pressed
      • multiway selection
      • (d) a loop in a process which repeats the same instructions a number of times
      • iteration
      decision more than two repeats
    4. 1. Match the terms sequence , binary selection , multiway selection and iteration to the descriptions that follow:
      • (e) a part of a program where we always add 1 to a counter and then print
      • sequence
      • (f) a portion of a program that is done over and over again, and only stops when the count reaches zero
      • iteration
      always over and over again
    5. 2. Identify two of the control structures used in each of the following algorithms
      • (a)
      • Count = 0
      • REPEAT
      • DoTheLoop
      • Add 1 to Count
      • UNTIL Count = 5
      • sequence
      • iteration/repetition
      • sequence
    6. 2. Identify two of the control structures used in each of the following algorithms
      • (b)
      • WHILE Count <= 5
      • Add 1 to Count
      • DoTheLoop
      • END WHILE
      • iteration/repetition
      • sequence
    7. 2. Identify two of the control structures used in each of the following algorithms
      • (c)
      • Get NextVideo
      • IF category = ‘X’
      • THEN print ‘You cannot watch this!’
      • ELSE DoBorrowProcess
      • Print details
      • END IF
      • sequence
      • selection (binary)
    8. 2. Identify two of the control structures used in each of the following algorithms
      • (d)
      • REPEAT
      • Enter Number
      • IF Number > highest
      • THEN set highest to Number
      • END IF
      • UNTIL no more Numbers
      • iteration/repetition
      • sequence
      • selection
    9. 2. Identify two of the control structures used in each of the following algorithms
      • (e)
      • WHILE more input
      • Select input
      • CASE 1
      • DoWithdrawals
      • CASE 2
      • DoDeposits
      • CASE 3
      • DoAccountBalance
      • CASE other
      • DoErrorProcess
      • END select
      • Get input
      • END WHILE
      • iteration/repetition
      • selection (multiway)
      • sequence
    10. 3. Identify the control structure other than sequence used in the following algorithms:
    11. 3. Identify the control structure other than sequence used in the following algorithms:
    12. 3. Identify the control structure other than sequence used in the following algorithms:
    13. 3. Identify the control structure other than sequence used in the following algorithms:
    14. Remember
      • You need to know how to apply this information, so see me for further help if you think it is necessary for you.
    SlideShare Zeitgeist 2009

    + ldunphyldunphy Nominate

    custom

    270 views, 0 favs, 0 embeds more stats

    Explantion of algorithms with examples

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 270
      • 270 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 12
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories