SlideShare a Scribd company logo
1 of 14
Algorithms Sheet 2
Identifying Control Structures
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
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
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
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
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
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
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
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
3.
  Identify the
control structure
  other than
   sequence
  used in the
   following
  algorithms:
3.
  Identify the
control structure
  other than
   sequence
  used in the
   following
  algorithms:
3.
  Identify the
control structure
  other than
   sequence
  used in the
   following
  algorithms:
3.
  Identify the
control structure
  other than
   sequence
  used in the
   following
  algorithms:
Remember
You need to know how to apply
this information, so see me for
 further help if you think it is
       necessary for you.

More Related Content

What's hot

Python iteration
Python iterationPython iteration
Python iteration
dietbuddha
 
computer notes - Data Structures - 17
computer notes - Data Structures - 17computer notes - Data Structures - 17
computer notes - Data Structures - 17
ecomputernotes
 

What's hot (13)

Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statement
 
Python iteration
Python iterationPython iteration
Python iteration
 
Notes on assignment in r
Notes on assignment in rNotes on assignment in r
Notes on assignment in r
 
Control Structures in Python
Control Structures in PythonControl Structures in Python
Control Structures in Python
 
Control structure C++
Control structure C++Control structure C++
Control structure C++
 
Control statements
Control statementsControl statements
Control statements
 
T
TT
T
 
Loops in Python
Loops in PythonLoops in Python
Loops in Python
 
Stacks
StacksStacks
Stacks
 
Python programming : Control statements
Python programming : Control statementsPython programming : Control statements
Python programming : Control statements
 
Stack_Application_Infix_Prefix.pptx
Stack_Application_Infix_Prefix.pptxStack_Application_Infix_Prefix.pptx
Stack_Application_Infix_Prefix.pptx
 
Control statements anil
Control statements anilControl statements anil
Control statements anil
 
computer notes - Data Structures - 17
computer notes - Data Structures - 17computer notes - Data Structures - 17
computer notes - Data Structures - 17
 

Viewers also liked

Organising and dss steps in designing a spreadsheet solution
Organising and dss   steps in designing a spreadsheet solutionOrganising and dss   steps in designing a spreadsheet solution
Organising and dss steps in designing a spreadsheet solution
Liam Dunphy
 
Pseudocode-Flowchart
Pseudocode-FlowchartPseudocode-Flowchart
Pseudocode-Flowchart
lotlot
 
Pseudocode flowcharts
Pseudocode flowchartsPseudocode flowcharts
Pseudocode flowcharts
nicky_walters
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
luhkahreth
 

Viewers also liked (19)

Training presentation outlook 2007 manage your mailbox 3-move or copy message...
Training presentation outlook 2007 manage your mailbox 3-move or copy message...Training presentation outlook 2007 manage your mailbox 3-move or copy message...
Training presentation outlook 2007 manage your mailbox 3-move or copy message...
 
Mm expertise
Mm expertiseMm expertise
Mm expertise
 
Programming Languages
Programming LanguagesProgramming Languages
Programming Languages
 
Break and continue statement in C
Break and continue statement in CBreak and continue statement in C
Break and continue statement in C
 
C lecture 4 nested loops and jumping statements slideshare
C lecture 4 nested loops and jumping statements slideshareC lecture 4 nested loops and jumping statements slideshare
C lecture 4 nested loops and jumping statements slideshare
 
Organising and dss steps in designing a spreadsheet solution
Organising and dss   steps in designing a spreadsheet solutionOrganising and dss   steps in designing a spreadsheet solution
Organising and dss steps in designing a spreadsheet solution
 
Meta Languages
Meta LanguagesMeta Languages
Meta Languages
 
Iteration
IterationIteration
Iteration
 
Butterfly Struggles - An inspirational life lesson
Butterfly Struggles - An inspirational life lessonButterfly Struggles - An inspirational life lesson
Butterfly Struggles - An inspirational life lesson
 
Loops Basics
Loops BasicsLoops Basics
Loops Basics
 
Pseudocode-Flowchart
Pseudocode-FlowchartPseudocode-Flowchart
Pseudocode-Flowchart
 
Loops in C
Loops in CLoops in C
Loops in C
 
Algorithms
AlgorithmsAlgorithms
Algorithms
 
Flowchart pseudocode-examples
Flowchart pseudocode-examplesFlowchart pseudocode-examples
Flowchart pseudocode-examples
 
Pseudocode flowcharts
Pseudocode flowchartsPseudocode flowcharts
Pseudocode flowcharts
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
 
Introduction to flowchart
Introduction to flowchartIntroduction to flowchart
Introduction to flowchart
 
Industrial process control
Industrial process controlIndustrial process control
Industrial process control
 

Similar to Algorithms2

Cisco labs practical1
Cisco labs practical1Cisco labs practical1
Cisco labs practical1
Tai Lam
 
Unit 3 principles of programming language
Unit 3 principles of programming languageUnit 3 principles of programming language
Unit 3 principles of programming language
Vasavi College of Engg
 
detail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdfdetail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdf
ssuserf86fba
 

Similar to Algorithms2 (20)

PM1
PM1PM1
PM1
 
theory of programming languages by shikra
theory of programming languages by shikratheory of programming languages by shikra
theory of programming languages by shikra
 
Flow of control c++
Flow of control c++Flow of control c++
Flow of control c++
 
Cisco labs practical1
Cisco labs practical1Cisco labs practical1
Cisco labs practical1
 
control statements of clangauge (ii unit)
control statements of clangauge (ii unit)control statements of clangauge (ii unit)
control statements of clangauge (ii unit)
 
Lect 3-4 Zaheer Abbas
Lect 3-4 Zaheer AbbasLect 3-4 Zaheer Abbas
Lect 3-4 Zaheer Abbas
 
Flow control in computer
Flow control in computerFlow control in computer
Flow control in computer
 
Object oriented programming system with C++
Object oriented programming system with C++Object oriented programming system with C++
Object oriented programming system with C++
 
Unit 3 principles of programming language
Unit 3 principles of programming languageUnit 3 principles of programming language
Unit 3 principles of programming language
 
Debugger & Profiler in NetBeans
Debugger & Profiler in NetBeansDebugger & Profiler in NetBeans
Debugger & Profiler in NetBeans
 
Tutorial PM.pptx
Tutorial PM.pptxTutorial PM.pptx
Tutorial PM.pptx
 
C++ chapter 4
C++ chapter 4C++ chapter 4
C++ chapter 4
 
C prograaming basic
C prograaming basicC prograaming basic
C prograaming basic
 
C++ rajan
C++ rajanC++ rajan
C++ rajan
 
Python for Machine Learning
Python for Machine LearningPython for Machine Learning
Python for Machine Learning
 
detail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdfdetail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdf
 
Algorithm Flowchart Manual ALGORITHM FLOWCHART MANUAL For STUDENTS
Algorithm   Flowchart Manual ALGORITHM   FLOWCHART MANUAL For STUDENTSAlgorithm   Flowchart Manual ALGORITHM   FLOWCHART MANUAL For STUDENTS
Algorithm Flowchart Manual ALGORITHM FLOWCHART MANUAL For STUDENTS
 
Algorithm manual
Algorithm manualAlgorithm manual
Algorithm manual
 
Cgc2
Cgc2Cgc2
Cgc2
 
Intake 38 2
Intake 38 2Intake 38 2
Intake 38 2
 

More from Liam Dunphy

More from Liam Dunphy (11)

Tm hills scarytasla-ming
Tm hills scarytasla-mingTm hills scarytasla-ming
Tm hills scarytasla-ming
 
Creative learning spaces
Creative learning spacesCreative learning spaces
Creative learning spaces
 
#ccGlobal for cesimeet
#ccGlobal for cesimeet#ccGlobal for cesimeet
#ccGlobal for cesimeet
 
Tm sydney north - collaboration
Tm sydney north - collaborationTm sydney north - collaboration
Tm sydney north - collaboration
 
Training presentation outlook 2007 manage your mailbox 2-understand your choi...
Training presentation outlook 2007 manage your mailbox 2-understand your choi...Training presentation outlook 2007 manage your mailbox 2-understand your choi...
Training presentation outlook 2007 manage your mailbox 2-understand your choi...
 
Representational Tools
Representational ToolsRepresentational Tools
Representational Tools
 
System Data Modelling Tools
System Data Modelling ToolsSystem Data Modelling Tools
System Data Modelling Tools
 
Communications Systems
Communications SystemsCommunications Systems
Communications Systems
 
Ipt Syllabus Changes Communications Systems
Ipt Syllabus Changes   Communications SystemsIpt Syllabus Changes   Communications Systems
Ipt Syllabus Changes Communications Systems
 
Ipt Syllabus Changes
Ipt Syllabus ChangesIpt Syllabus Changes
Ipt Syllabus Changes
 
Ipt Syllabus Changes Project Management
Ipt Syllabus Changes   Project ManagementIpt Syllabus Changes   Project Management
Ipt Syllabus Changes Project Management
 

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 

Recently uploaded (20)

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 

Algorithms2

  • 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) 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. 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. 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. 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. 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. 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. 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. 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. 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.