ATIKA SCHOOL
  • Home
    • JOBS IN KENYA AND ABROAD FOR KENYANS AND BEYOND
    • How its Done
    • KNEC Portal
    • Atika School Advanced Search
    • News and Opinions
    • Academic Environment
    • SITEMAP
    • About Us? >
      • About Us
      • Learn more about us
  • OUR PRODUCTS
    • All Categories >
      • Category
      • FREE NOVELS >
        • COURSE BOOKS
        • KCSE KISWAHILI SETBOOKS
        • Backed Up Files and Archives
        • FREE DOCUMENTS
        • PRIMARY 8-4-4 BASED RESOURCES
        • STANDARD 8 RESOURCES
        • HIGH SCHOOL RESOURCES >
          • Biology Paper 3 Exams
          • Secondary Examinations
        • PRIMARY CBC BASED RESOURCES
        • COLLEGE & VARSITY RESOURCES
    • PRIMARY RESOURCES CBC
    • PRIMARY RESOURCES 8-4-4
    • SECONDARY RESOURCES
    • NOTES & TUTORIALS
    • COLLEGE RESOURCES
    • NOVELS and OTHER BOOKS
  • EXAMINATIONS
    • PRIMARY EXAMS >
      • Primary Assignments and Random Exams
      • CBC
      • 8-4-4
      • STANDARD 8 PAST PAPERS 8-4-4 BASED
    • MOCKS AND JOINT EXAMS >
      • FORM 1 QUESTION PAPERS, ANSWERS AND MARKING SCHEMES COLLECTIONS
      • FORM 2 QUESTION PAPERS, ANSWERS AND MARKING SCHEMES COLLECTIONS
      • FORM 3 EXAMINATIONS, QUESTION PAPERS AND ANSWERS
      • MOCKS PAST EXAMS BY REGION
    • KCPE >
      • KCPE BY YEAR >
        • KCPE 2020 RESULTS, REPORTS, QUESTIONS AND ANSWERS
        • KCPE PAST PAPERS 2019 REPORTS, RESULTS, QUESTIONS AND ANSWERS
      • KCPE PAST PAPERS PER SUBJECT
      • KCPE PAST PAPERS AND ANSWERS
      • KCPE MATHEMATICS TOPICAL QUESTIONS FROM 1989 TO LAST YEAR
    • KCSE >
      • KCSE BY YEAR >
        • KNEC KCSE PAST PAPERS, MARKING SCHEMES, QUESTIONS & ANSWERS
      • KCSE BY SUBJECT >
        • KCSE PAST PAPERS BY SUBJECT
        • Free KCSE Past Papers Mathematics
        • Free KCSE Biology Questions and Answers
    • QUESTIONS & ANSWERS >
      • SECONDARY >
        • LANGUAGES >
          • A DOLL'S HOUSE BY HENRIK IBSEN RESOURCES
        • TECHNICALS >
          • COMPUTER STUDIES >
            • COMPUTER STUDIES Q & A
            • kcse computer studies paper 2 AND 3 Questions & Answers
          • BUSINESS STUDIES QUESTIONS & ANSWERS
          • KCSE AGRICULTURE TOPICAL QUESTIONS AND ANSWERS
          • KCSE HOME SCIENCE DIRECT QUESTIONS AND ANSWERS
        • SCIENCES >
          • KCSE Mathematics Topical Questions
          • KCSE Biology Topical Questions and Answers
          • CHEMISTRY TOPICAL QUESTIONS AND ANSWERS
          • KCSE Physics Topical Questions
          • KCSE physics Practical Sample Quiz
        • HUMANITIES >
          • ISLAMIC RELIGIOUS EDUCATION (IRE) QUESTIONS AND ANSWERS
          • KCSE History Topical Questions and Answers
          • GEOGRAPHY TOPICAL QUESTIONS AND ANSWERS
      • PRIMARY >
        • Standard 4-8 Mathematics Topical Questions from Mocks and KCPE
        • Std 6 Mathematics Notes
  • TUTORIALS
    • SECONDARY >
      • SCIENCES >
        • FOCUS MATHEMATICS TUTORIALS AND EXAMS FREE
        • KCSE BIOLOGY NOTES
        • FREE KCSE CHEMISTRY NOTES
        • KCSE PHYSICS NOTES, AUDIOVISUALS AND MORE
      • LANGUAGES >
        • ENGLISH >
          • English KCSE Set Books
          • ENGLISH POETRY QUESTIONS WITH ANSWERS FOR K.C.S.E CANDIDATES
          • ENGLISH GRAMMAR #KCSE
        • CHOZI LA HERI - MWONGOZO
        • KIGOGO - MWONGOZO
        • USHAIRI MASWALI NA MAJIBU
        • MASWALI NA MAJIBU YA TUMBO LISILOSHIBA
        • KCSE Kiswahili Fasihi
      • TECHNICALS >
        • HOME SCIENCE NOTES
        • KCSE BUSINESS STUDIES NOTES
        • COMPUTER STUDIES NOTES LATEST
        • kcse Computer Studies Notes
        • KCSE AGRICULTURE NOTES, SYLLABUS, QUESTIONS, ANSWERS, SCHEMES OF WORK AND OTHERS
      • HUMANITIES >
        • KCSE History Notes Form 1 to 4
        • FREE KCSE CRE NOTES
        • KCSE GEOGRAPHY NOTES
        • IRE NOTES, AUDIOVISUAL, QUESTIONS AND ANSWERS
    • PRIMARY >
      • NOTES >
        • KISWAHILI
        • SOCIAL STUDIES >
          • STANDARD 4: SOCIAL STUDIES
        • SCIENCE
        • ENGLISH >
          • KCPE and Primary Level Compositions
        • MATHEMATICS >
          • KCPE Mathematics Notes
      • EXAMINATIONS >
        • DecaTurbo Online Series Examinations
        • CBC Kiswahili
        • FOCUS A365 SERIES K.C.P.E EXAMINATIONS FOR PRIMARY
        • Standard 8 (std) English Topical Questions
    • Other Supportive Documents >
      • Free Schemes of Work
      • SYLLABUS >
        • Primary 8-4-4 based Syllabus, Objectives and Lessons
        • Primary Mathematics Syllabus
      • MASOMO VIDEOS
  • CURRICULUM
    • NEW CURRICULUM DESIGNS >
      • PRIMARY >
        • PRE PRIMARY ONE CURRICULUM WITH SYLLABUS
        • PRE PRIMARY TWO CURRICULUM WITH SYLLABUS
      • SECONDARY >
        • KNEC KCSE SYLLABUS AND COURSE OUTLINES
      • COLLEGE >
        • Regulations for the TIVET Craft and Diploma Business Examinations
  • HIGH INSTITUTIONS
    • EXAMINATIONS >
      • College and Varsity Past Papers online >
        • College and Varsity Past Papers online
    • TUTORIALS
  • CUSTOMER CARE
    • PRICING
    • Contact
    • Help & Support
    • DONATE
    • MPESA FORM
  • BLOGS
    • ENGLISH - EKEGUSII DICTIONARY
  • MEMBERSHIP RESOURCES
    • Assignments and Random Exams
    • TERM 3 2021 PRIMARY PAST REVISION PAPERS
    • SECONDARY EXAMINATIONS
    • Search Free Documents (PDF)
  • Archived Pages
    • C.R.E (CRE) QUESTION AND ANSWERS
    • TOP SECONDARY EXAMS ALL SUBJECTS

Follow us now to receive the latest updates @schoolatika

Program Control Structures

30/4/2022

0 Comments

 

Program Control Structures

program control structures are blocks of statements that determine how statements are to be executed, in structured programming languages, there are three control structures namely; sequence, selection and iteration (looping)

​Sequence

In this structure, the computer reads instructions from a program file starting from the first top line and proceeding downwards one -by -one to the end. This is called sequential programming execution i.e.
SEQUENCE CONTROL STRUCTURE

​Selection

In selection control, execution of statements depends on a condition which is either a true or false
There are four types of selection controls. Namely:
  • IF.....THEN
  • IF.....THEN.....ELSE
  • NESTED IF
  • CASE SECTION
IF....THEN
The IF....THEN selection is used if only one option is available. All other options are ignored
Format:
IF <condition> THEN
    Statements;
ENDIF
IF....THEN....ELSE
This type of selection is suitable where there are two available options
General Format
IF <condition> THEN
    Statements;
ELSE
    Statements;
EndIF
Nested IF Selection
This type of selection is used where two or more options have to be considered to make a selection.
General Format
IF <condition> THEN
            statements
    ELSE
    IF <condition> THEN
            statements
    ELSE
        IF<condition> THEN
            Statements
    ELSE
            Statements
        ENDIF
    ENDIF
ENDIF
CASE Construct
This is an alternative to the Nested IF especially where there are several options to choose from. Its preferred because it reduces the many lines of code. However, the boolean expression for the case selection can only be expressed using integers and alphabetic characters only. The General format should be
CASE integer OF or
CASE Char OF
Example:
Case x of
label 1: statement 1
label 2: statement 2
label 3: statement 3
.
.
.
label n: statement n-1
Else
statement
Endcase
READ MORE

​Iteration (looping)

Iteration is also referred to as looping or repetition.  Its designed to execute the same block of code again and again until a certain condition is fulfilled.
The three main looping controls are:-
  • The WHILE Loop
  • The REPEAT....UNTIL Loop
  • The FOR Loop
The WHILE Loop
The "WHILE" loop is used if a condition has to be met before the statements within the loop are executed.
General Format
WHILE condition DO
    statement
ENDWHILE
The REPEAT....UNTIL loop
The REPEAT....UNTIL loop allows the statements within it to be executed at least once since the condition is tested at the end of the loop.
General Format
REPEAT
statements
UNTIL <condition>
The FOR Loop
The FOR loop is used in circumstances where the execution of the chosen statements has to be repeated a predetermined number of times.
General Format
//pseudocode for 'FOR" loop that counts from the lower limit
FOR loop variable = lower limit to upper limit DO
statements
ENDFOR
READ MORE




Print Friendly and PDF



0 Comments
Print Friendly and PDF



Leave a Reply.

    COMPUTER STUDIES QUESTIONS AND ANSWERS

    Categories

    All
    1998
    1999
    2000
    2001
    2002
    2003
    2004
    2005
    2006
    2007
    2008
    2009
    2010
    2011
    2012
    2013
    2014
    2015
    2016
    2017
    2018
    2019
    2020
    Analogue And Digital Systems
    Applications Areas Of Ict
    Areas-where-computers-are-used
    Auxiliary Storage Devices
    Basic-computer-set-up-and-cabling
    Binary Addition
    Binary Subtraction
    Career Opportunities In ICT
    Classification Of Computers
    Classification-of-computers
    Coaxial Cables
    COMPACT DISK
    COMPLETE PAPERS
    Computer Crimes
    Computer-files
    Computer Memory
    Computer Software
    Computer Systems
    COMPUTER VIRUS
    Dashboard
    Database
    Data Collection
    Data Communication
    Data-integrity
    Data Processing
    Data Representation In A Computer
    Data Security And Controls
    Definition And Development Of Algorithm
    Definition-of-a-computer
    Desktop Publisher
    Development-of-computers
    DTP
    DVD
    Editing-and-formatting-a-word-document
    Electronic Data Processing Modes
    Elementary Programming Principles
    Errors-in-data-processing
    Evolution-of-computer-systems
    Fibre Optic Cables
    File Management Using An Operating System
    File-organization-methods
    Flowchart
    Form 1 Level
    Form 2 Level
    Form 3 Level
    Form 3 Mock Exams
    Form 4 Level
    Hands On Skills
    HARDCOPY OUTPUT DEVICES
    Hardware
    Impact Of Ict On Society
    IMPACT PRINTERS
    Information
    Input Devices
    Internet And Email
    Introduction To Computers
    Introduction To Networking And Data Communication
    ISP
    Levels-of-programming-languages
    Midterm-exams
    Mind-blowing-q-a
    Mocks
    Network-topology
    NON-IMPACT PRINTERS
    Octal
    Operating Systems
    Output Devices
    Paper 1
    Parts-of-a-computer
    PRINTERS
    Processing-devices
    Processors
    Program-construction
    Program-control-structures
    Program-design
    Program-development
    Program-documentation
    Protocols
    Registers
    Review Questions
    Revision-kits
    Secondary Storage Media
    Section A
    Section B
    Security Threats And Control Measures
    Software
    Spreadsheets
    Stages Of System Development
    Storage Devices
    Symbolic-representation
    System-design
    System Development
    System-documentation
    Term-1
    The Computer Laboratory
    The-cpu
    The Keyboard
    Types Of Computer Files
    Types-of-networks
    User Interface
    Uses-of-computers
    Word Processors
    Worksheet-formatting

    Archives

    December 2024
    April 2022
    January 2022
    December 2021
    November 2021
    July 2021
    March 2021
    February 2021
    January 2021
    December 2020
    October 2020
    April 2020
    February 2020
    October 2019
    August 2019
    July 2019
    April 2019
    March 2019
    November 2018
    August 2018
    July 2018
    December 2017
    November 2017
    October 2017
    July 2017
    August 2016
    June 2016
    January 2016
    December 2015
    November 2015

    RSS Feed

Print Friendly and PDF

Primary Resources
  • K.C.P.E Past Papers
  • ​Pri - Primary 1 Level
  • Pri  - Primary 2 Level
  • Grade 1
  • Grade 2
  • Grade 3
  • Grade 4
  • Standard 5
  • Standard 6
  • Standard 7
  • Standard 8
  • English
  • Kiswahili
  • Social Studies
  • Science
  • Mathematics
  • Kenya Sign Language
  • I.R.E
  • ​H.R.E
  • Notes
  • Termly Questions
  • Mocks
  • K.C.P.E Past Papers
College Resources
  • E.C.D.E
  • P.T.E
  • D.T.E
  • Technical Diploma
  • Technical Certificate
  • Business Diploma
  • Business Certificate
  • Higher Diploma
  • K.A.S.N.E.B Resources
  • K.M.T.C Resources
  • Varsity Resources
Secondary Resources
  • K.C.S.E Past Papers
  • Form 1
  • Form 2
  • Form 3
  • Form 4
  • Term 1
  • Term 2
  • Term 3
  • English
  • Geography
  • History
  • C.R.E
  • I.R.E
  • ​H.R.E
  • Home Science
  • Computer Studies
  • Business Studies
  • Agriculture
  • Chemistry
  • Biology
  • Physics
  • Mathematics ALT A
  • Mathematics ALT B
  • Kiswahili
  • French
  • Germany
  • Arabic
  • Aviation
  • Art & Design
  • Drawing & Design
  • Building & Construction
  • Metal Works
  • Wood Work
  • Music
  • Kenya Sign Language
  • Electricity
Other Useful Links
  • Academic Environment
  • How its Done
  • News and Opinions
  • Manyam Franchise Support
  • About
  • SITEMAP
  • FOCUS A365 SERIES
  • Membership Details (KCPE/KCSE)
  • Secondary Mocks
  • SYLLABUS
Contact Us
Manyam Franchise
P.O Box 1189 - 40200 Kisii
Tel: 0728 450 424
Tel: 0738 619 279
Tel: 0763 450 425
E-mail - sales@manyamfranchise.com
Photos used under Creative Commons from wwarby, JoshMacDonald, Visual Content, wuestenigel, Homini:), Wonderlane, Mike Licht, NotionsCapital.com, The Official CTBTO Photostream, Nabor Garrido, picsaf.com, OER Africa, Jemimus, andronicusmax, Christoph Scholz, cyanocorax, matsuyuki, Mark Hodson Photos, cathyse97, tompagenet, ToGa Wanderings, crstnksslr, machernucha, panpot, ePublicist
  • Home
    • JOBS IN KENYA AND ABROAD FOR KENYANS AND BEYOND
    • How its Done
    • KNEC Portal
    • Atika School Advanced Search
    • News and Opinions
    • Academic Environment
    • SITEMAP
    • About Us? >
      • About Us
      • Learn more about us
  • OUR PRODUCTS
    • All Categories >
      • Category
      • FREE NOVELS >
        • COURSE BOOKS
        • KCSE KISWAHILI SETBOOKS
        • Backed Up Files and Archives
        • FREE DOCUMENTS
        • PRIMARY 8-4-4 BASED RESOURCES
        • STANDARD 8 RESOURCES
        • HIGH SCHOOL RESOURCES >
          • Biology Paper 3 Exams
          • Secondary Examinations
        • PRIMARY CBC BASED RESOURCES
        • COLLEGE & VARSITY RESOURCES
    • PRIMARY RESOURCES CBC
    • PRIMARY RESOURCES 8-4-4
    • SECONDARY RESOURCES
    • NOTES & TUTORIALS
    • COLLEGE RESOURCES
    • NOVELS and OTHER BOOKS
  • EXAMINATIONS
    • PRIMARY EXAMS >
      • Primary Assignments and Random Exams
      • CBC
      • 8-4-4
      • STANDARD 8 PAST PAPERS 8-4-4 BASED
    • MOCKS AND JOINT EXAMS >
      • FORM 1 QUESTION PAPERS, ANSWERS AND MARKING SCHEMES COLLECTIONS
      • FORM 2 QUESTION PAPERS, ANSWERS AND MARKING SCHEMES COLLECTIONS
      • FORM 3 EXAMINATIONS, QUESTION PAPERS AND ANSWERS
      • MOCKS PAST EXAMS BY REGION
    • KCPE >
      • KCPE BY YEAR >
        • KCPE 2020 RESULTS, REPORTS, QUESTIONS AND ANSWERS
        • KCPE PAST PAPERS 2019 REPORTS, RESULTS, QUESTIONS AND ANSWERS
      • KCPE PAST PAPERS PER SUBJECT
      • KCPE PAST PAPERS AND ANSWERS
      • KCPE MATHEMATICS TOPICAL QUESTIONS FROM 1989 TO LAST YEAR
    • KCSE >
      • KCSE BY YEAR >
        • KNEC KCSE PAST PAPERS, MARKING SCHEMES, QUESTIONS & ANSWERS
      • KCSE BY SUBJECT >
        • KCSE PAST PAPERS BY SUBJECT
        • Free KCSE Past Papers Mathematics
        • Free KCSE Biology Questions and Answers
    • QUESTIONS & ANSWERS >
      • SECONDARY >
        • LANGUAGES >
          • A DOLL'S HOUSE BY HENRIK IBSEN RESOURCES
        • TECHNICALS >
          • COMPUTER STUDIES >
            • COMPUTER STUDIES Q & A
            • kcse computer studies paper 2 AND 3 Questions & Answers
          • BUSINESS STUDIES QUESTIONS & ANSWERS
          • KCSE AGRICULTURE TOPICAL QUESTIONS AND ANSWERS
          • KCSE HOME SCIENCE DIRECT QUESTIONS AND ANSWERS
        • SCIENCES >
          • KCSE Mathematics Topical Questions
          • KCSE Biology Topical Questions and Answers
          • CHEMISTRY TOPICAL QUESTIONS AND ANSWERS
          • KCSE Physics Topical Questions
          • KCSE physics Practical Sample Quiz
        • HUMANITIES >
          • ISLAMIC RELIGIOUS EDUCATION (IRE) QUESTIONS AND ANSWERS
          • KCSE History Topical Questions and Answers
          • GEOGRAPHY TOPICAL QUESTIONS AND ANSWERS
      • PRIMARY >
        • Standard 4-8 Mathematics Topical Questions from Mocks and KCPE
        • Std 6 Mathematics Notes
  • TUTORIALS
    • SECONDARY >
      • SCIENCES >
        • FOCUS MATHEMATICS TUTORIALS AND EXAMS FREE
        • KCSE BIOLOGY NOTES
        • FREE KCSE CHEMISTRY NOTES
        • KCSE PHYSICS NOTES, AUDIOVISUALS AND MORE
      • LANGUAGES >
        • ENGLISH >
          • English KCSE Set Books
          • ENGLISH POETRY QUESTIONS WITH ANSWERS FOR K.C.S.E CANDIDATES
          • ENGLISH GRAMMAR #KCSE
        • CHOZI LA HERI - MWONGOZO
        • KIGOGO - MWONGOZO
        • USHAIRI MASWALI NA MAJIBU
        • MASWALI NA MAJIBU YA TUMBO LISILOSHIBA
        • KCSE Kiswahili Fasihi
      • TECHNICALS >
        • HOME SCIENCE NOTES
        • KCSE BUSINESS STUDIES NOTES
        • COMPUTER STUDIES NOTES LATEST
        • kcse Computer Studies Notes
        • KCSE AGRICULTURE NOTES, SYLLABUS, QUESTIONS, ANSWERS, SCHEMES OF WORK AND OTHERS
      • HUMANITIES >
        • KCSE History Notes Form 1 to 4
        • FREE KCSE CRE NOTES
        • KCSE GEOGRAPHY NOTES
        • IRE NOTES, AUDIOVISUAL, QUESTIONS AND ANSWERS
    • PRIMARY >
      • NOTES >
        • KISWAHILI
        • SOCIAL STUDIES >
          • STANDARD 4: SOCIAL STUDIES
        • SCIENCE
        • ENGLISH >
          • KCPE and Primary Level Compositions
        • MATHEMATICS >
          • KCPE Mathematics Notes
      • EXAMINATIONS >
        • DecaTurbo Online Series Examinations
        • CBC Kiswahili
        • FOCUS A365 SERIES K.C.P.E EXAMINATIONS FOR PRIMARY
        • Standard 8 (std) English Topical Questions
    • Other Supportive Documents >
      • Free Schemes of Work
      • SYLLABUS >
        • Primary 8-4-4 based Syllabus, Objectives and Lessons
        • Primary Mathematics Syllabus
      • MASOMO VIDEOS
  • CURRICULUM
    • NEW CURRICULUM DESIGNS >
      • PRIMARY >
        • PRE PRIMARY ONE CURRICULUM WITH SYLLABUS
        • PRE PRIMARY TWO CURRICULUM WITH SYLLABUS
      • SECONDARY >
        • KNEC KCSE SYLLABUS AND COURSE OUTLINES
      • COLLEGE >
        • Regulations for the TIVET Craft and Diploma Business Examinations
  • HIGH INSTITUTIONS
    • EXAMINATIONS >
      • College and Varsity Past Papers online >
        • College and Varsity Past Papers online
    • TUTORIALS
  • CUSTOMER CARE
    • PRICING
    • Contact
    • Help & Support
    • DONATE
    • MPESA FORM
  • BLOGS
    • ENGLISH - EKEGUSII DICTIONARY
  • MEMBERSHIP RESOURCES
    • Assignments and Random Exams
    • TERM 3 2021 PRIMARY PAST REVISION PAPERS
    • SECONDARY EXAMINATIONS
    • Search Free Documents (PDF)
  • Archived Pages
    • C.R.E (CRE) QUESTION AND ANSWERS
    • TOP SECONDARY EXAMS ALL SUBJECTS