Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Algorithms2

Algorithms in pseudocode and flowcharts as in the NSW BOS SDD syllabus. Test scenario.

  • Be the first to comment

  • Be the first to like this

Algorithms2

  1. 1. Algorithms Sheet 2 Identifying Control Structures
  2. 2. 1. Match the terms sequence, binary selection, multiway selection and iteration to the descriptions that follow: (a) a decision taken in an algorithm which can go either of two ways binary selection (b) decision taken in an algorithm which allows decision more than two choices more than two multiway selection
  3. 3. 1. Match the terms sequence, binary selection, multiway selection and iteration to the descriptions that follow: decision (a) a decision taken in the processing done by an ATM to either withdraw, deposit or check account balance, depending on the key pressed more than two multiway selection (d) a loop in a process which repeats the same repeats instructions a number of times iteration
  4. 4. 1. Match the terms sequence, binary selection, multiway selection and iteration to the descriptions that follow: always (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 and over again and only stops when the count over again, reaches zero iteration
  5. 5. 2. Identify two of the control structures used in each of the following algorithms (a) Count = 0 sequence REPEAT iteration/repetition DoTheLoop Add 1 to Count sequence UNTIL Count = 5
  6. 6. 2. Identify two of the control structures used in each of the following algorithms (b) WHILE Count <= 5 iteration/repetition Add 1 to Count sequence DoTheLoop END WHILE
  7. 7. 2. Identify two of the control structures used in each of the following algorithms (c) Get NextVideo sequence IF category = ‘X’ selection (binary) THEN print ‘You cannot watch this!’ ELSE DoBorrowProcess Print details END IF
  8. 8. 2. Identify two of the control structures used in each of the following algorithms (d) REPEAT iteration/repetition Enter Number sequence IF Number > highest selection THEN set highest to Number END IF UNTIL no more Numbers
  9. 9. 2. Identify two of the control structures used in each of the following algorithms (e) WHILE more input iteration/repetition Select input selection (multiway) CASE 1 DoWithdrawals CASE 2 DoDeposits CASE 3 DoAccountBalance CASE other DoErrorProcess END select Get input sequence END WHILE
  10. 10. 3. Identify the control structure other than sequence used in the following algorithms:
  11. 11. 3. Identify the control structure other than sequence used in the following algorithms:
  12. 12. 3. Identify the control structure other than sequence used in the following algorithms:
  13. 13. 3. Identify the control structure other than sequence used in the following algorithms:
  14. 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.

×