ATIKA SCHOOL
  • Home
    • Atika School Advanced Search
    • News and Opinions
    • Echo
    • Academic Environment
    • How its Done
    • SITEMAP
    • About Us? >
      • About Us
      • Learn more about us
  • 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 GRAMMAR #KCSE
        • CHOZI LA HERI - MWONGOZO
        • KIGOGO - MWONGOZO
        • KCSE Kiswahili
      • TECHNICALS >
        • KCSE BUSINESS STUDIES NOTES
        • 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
    • MASOMO VIDEOS
    • 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
        • TOP INSHA AND COMPOSITION QUESTIONS
        • CBC Kiswahili
        • FOCUS A365 SERIES K.C.P.E EXAMINATIONS FOR PRIMARY
        • Standard 8 (std) English Topical Questions
      • SYLLABUS >
        • Primary 8-4-4 based Syllabus, Objectives and Lessons
        • Primary Mathematics Syllabus
  • 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
  • PRODUCTS
    • All Categories
    • FREE DOCUMENTS
    • PRIMARY CBC BASED RESOURCES
    • PRIMARY 8-4-4 BASED RESOURCES >
      • STANDARD 8 RESOURCES
    • COLLEGE & VARSITY RESOURCES
    • HIGH SCHOOL RESOURCES
    • FREE NOVELS >
      • COURSE BOOKS
      • KCSE KISWAHILI SETBOOKS
    • Backed Up Files and Archives
  • EXAMINATIONS
    • PRIMARY EXAMS >
      • Assignments and Random Exams
      • 8-4-4 >
        • STANDARD 8 PAST PAPERS 8-4-4 BASED
      • CBC
    • TOP SCHOOLS EXAMINATIONS LATEST >
      • Assignments and Random Exams
    • KCPE >
      • KCPE PAST PAPERS AND ANSWERS
    • KCSE >
      • KCSE BY SUBJECT >
        • KCSE PAST PAPERS BY SUBJECT
        • Free KCSE Past Papers Mathematics
        • Free KCSE Biology Questions and Answers
      • KCSE BY YEAR >
        • KNEC KCSE PAST PAPERS, MARKING SCHEMES, QUESTIONS & ANSWERS
    • QUESTIONS & ANSWERS >
      • SECONDARY >
        • LANGUAGES >
          • ENGLISH POETRY QUESTIONS WITH ANSWERS FOR K.C.S.E CANDIDATES
        • TECHNICALS >
          • COMPUTER STUDIES >
            • COMPUTER STUDIES Q & A
            • kcse computer studies paper 2 AND 3 Questions & Answers
          • BUSINESS STUDIES QUESTIONS & ANSWERS
          • KCSE AGRICULTURE TOPICAL QUESTIONS
          • 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
          • C.R.E (CRE) QUESTION 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
  • HIGH INSTITUTIONS
    • EXAMINATIONS >
      • College and Varsity Past Papers online >
        • College and Varsity Past Papers online
    • TUTORIALS
  • PRICING
  • BLOGS
    • Contact
    • Help & Support
    • MPESA FORM
  • Search Free Documents (PDF)

ANALYSIS OF KCSE COMPUTER STUDIES TOPICAL QUESTIONS & REVISION KITS

This site is a creation of all possible KCSE computer studies questions and answers
Picture

Follow us now to receive the latest updates @schoolatika

The 'While Loop' Easy Explanation

28/8/2016

0 Comments

 

What is a While loop?

A while loop is a control flow statement that allows code to be executed repeatedly based on a given boolean condition. The while loop can be thought of as a repeating if statement.

The while construct consists of a block of code and a condition/expression. The condition/expression is evaluated, and if the condition/expression is true, the code within the block is executed. This repeats until the condition/expression becomes false. Because the while loop checks the condition/expression before the block is executed, the control structure is often also known as a pre-test loop.

What they do is simply do a test like an if-statement, but instead of running the code block once, they jump back to the "top" where the while is, and repeat. A while-loop runs until the expression is False.

What does the while loop do?

Picture
A "While" Loop is used to repeat a specific block of code an unknown number of times, until a condition is met. For example, if we want to ask a user for a number between 1 and 10, we don't know how many times the user may enter a larger number, so we keep asking "while the number is not between 1 and 10".
​
For example, say we want to know how many times a given number can be divided by 2 before it is less than or equal to 1. If we know a specific number, such as 32, we can say 5 times, but for a given symbolic variable "NUMBER" which represents any number in the world, how many times is not known a priori (before hand). In this case, we could use a while loop to determine that answer:
The "pseudocode" for such an algorithm is: while the number is bigger than one keep dividing it by two. additionally, keep a count of how many times we do the division.

Therefore, the while loop;
  1. Like all loops, "while loops" execute blocks of code over and over again.
  2. The advantage to a while loop is that it will go (repeat) as often as necessary to accomplish its goal.

Worked example

Here is a mathlab example that can find the factorials of 10. This means 10x9x8x7x6x5x4x3x2x1
​n = 10;
f = n;
while n > 1
    n = n-1;
    f = f*n;
end
disp(['n! = ' num2str(f)])
Solution
n! = 3628800
Pseudocode
​Let n be 10
f is equal to n
while n is greater than 1
the new value of n is the old value of n less 1
new value of f is a product of the old value of f and the new value of n
endwhile
print factorial
Flowchart Extract
Picture

0 Comments



Leave a Reply.

    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
    Applications Areas Of Ict
    Areas-where-computers-are-used
    Basic-computer-set-up-and-cabling
    Career Opportunities In Ict
    Classification Of Computers
    Classification-of-computers
    Computer-files
    Computer Systems
    Dashboard
    Database
    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
    Editing-and-formatting-a-word-document
    Electronic-data-processing-modes
    Elementary Programming Principles
    Errors-in-data-processing
    Evolution-of-computer-systems
    File-management-using-an-operating-system
    File-organization-methods
    Form 1
    Form 2
    Form 3
    Form 3 Mock Exams
    Form 4
    Hands On Skills
    Hardware
    Impact Of Ict On Society
    Information
    Input Devices
    Internet And Email
    Introduction To Networking And Data Communication
    Intro To Computers
    Levels-of-programming-languages
    Midterm-exams
    Mind-blowing-q-a
    Mocks
    Network-topology
    Operating Systems
    Output Devices
    Paper 1
    Parts-of-a-computer
    Processing-devices
    Processors
    Program-construction
    Program-control-structures
    Program-design
    Program-development
    Program-documentation
    Registers
    Revision-kits
    Secondary-storage-media
    Section A
    Section B
    Software
    Spreadsheets
    Stages Of System Development
    Storage Devices
    Symbolic-representation
    System-design
    System Development
    System-documentation
    Term-1
    The Computer Laboratory
    The-computer-laboratory
    The-cpu
    Types-of-networks
    User Interface
    Uses-of-computers
    Word Processors
    Worksheet-formatting

    Archives

    January 2025
    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

atika school app
Download our Android App

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

    Send Us a Message

    Max file size: 20MB
Submit
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, picsaf.com, OER Africa, Jemimus, andronicusmax, Christoph Scholz, cyanocorax, matsuyuki, Mark Hodson Photos, cathyse97, tompagenet, ToGa Wanderings, crstnksslr, machernucha, panpot, ePublicist
  • Home
    • Atika School Advanced Search
    • News and Opinions
    • Echo
    • Academic Environment
    • How its Done
    • SITEMAP
    • About Us? >
      • About Us
      • Learn more about us
  • 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 GRAMMAR #KCSE
        • CHOZI LA HERI - MWONGOZO
        • KIGOGO - MWONGOZO
        • KCSE Kiswahili
      • TECHNICALS >
        • KCSE BUSINESS STUDIES NOTES
        • 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
    • MASOMO VIDEOS
    • 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
        • TOP INSHA AND COMPOSITION QUESTIONS
        • CBC Kiswahili
        • FOCUS A365 SERIES K.C.P.E EXAMINATIONS FOR PRIMARY
        • Standard 8 (std) English Topical Questions
      • SYLLABUS >
        • Primary 8-4-4 based Syllabus, Objectives and Lessons
        • Primary Mathematics Syllabus
  • 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
  • PRODUCTS
    • All Categories
    • FREE DOCUMENTS
    • PRIMARY CBC BASED RESOURCES
    • PRIMARY 8-4-4 BASED RESOURCES >
      • STANDARD 8 RESOURCES
    • COLLEGE & VARSITY RESOURCES
    • HIGH SCHOOL RESOURCES
    • FREE NOVELS >
      • COURSE BOOKS
      • KCSE KISWAHILI SETBOOKS
    • Backed Up Files and Archives
  • EXAMINATIONS
    • PRIMARY EXAMS >
      • Assignments and Random Exams
      • 8-4-4 >
        • STANDARD 8 PAST PAPERS 8-4-4 BASED
      • CBC
    • TOP SCHOOLS EXAMINATIONS LATEST >
      • Assignments and Random Exams
    • KCPE >
      • KCPE PAST PAPERS AND ANSWERS
    • KCSE >
      • KCSE BY SUBJECT >
        • KCSE PAST PAPERS BY SUBJECT
        • Free KCSE Past Papers Mathematics
        • Free KCSE Biology Questions and Answers
      • KCSE BY YEAR >
        • KNEC KCSE PAST PAPERS, MARKING SCHEMES, QUESTIONS & ANSWERS
    • QUESTIONS & ANSWERS >
      • SECONDARY >
        • LANGUAGES >
          • ENGLISH POETRY QUESTIONS WITH ANSWERS FOR K.C.S.E CANDIDATES
        • TECHNICALS >
          • COMPUTER STUDIES >
            • COMPUTER STUDIES Q & A
            • kcse computer studies paper 2 AND 3 Questions & Answers
          • BUSINESS STUDIES QUESTIONS & ANSWERS
          • KCSE AGRICULTURE TOPICAL QUESTIONS
          • 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
          • C.R.E (CRE) QUESTION 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
  • HIGH INSTITUTIONS
    • EXAMINATIONS >
      • College and Varsity Past Papers online >
        • College and Varsity Past Papers online
    • TUTORIALS
  • PRICING
  • BLOGS
    • Contact
    • Help & Support
    • MPESA FORM
  • Search Free Documents (PDF)