User Tools

Site Tools


View page as slide show

Structured Programming Concepts

Mithat Konar
July 21, 2018


  • What is it?
  • Why is it important?
  • Core concepts

What is it?

  • A way of thinking about how to create computer programs: a paradigm.
  • Developed in the 1950s to help create manageable computer programs.

Why is it important?

  • Theoretical reasons
  • Practical reasons

Theoretical reasons

  • It's is all you need to write any “provable function.”
  • Dominates theoretical thinking.

Practical reasons

  • Many popular programming languages are based on structured programming.
  • Influences languages built around other paradigms.
  • Thinking “structurally” helps solve problems so they are easy to program.
  • Professionals often use structured programming concepts to specify ways of solving problems.

Core concepts

  • Control flow
  • Block structure
  • Subroutines

Control flow

  • control flow: the order in which the things happen, the way a program “flows”.
  • Three kinds of control structures
    • sequence: statements are executed one after the other.
    • selection: choose among alternative courses of action, “making decisions.”
    • repetition: repeat a set of instructions, “looping”.


  • I need to leave my house for a couple days.
  • My friend has agreed to look after my cat Ash.
  • They need detailed instructions.

First try

Ash gets a cup of food every day.
Her water needs to be filled if it's running low.
She also needs to play fetch with her favorite toy.


“Ash gets a cup of food every day.”

open the bag of catfood on the counter
scoop out one cup of food
put the scoop of food into her food dish
reseal the bag of catfood


“Her water needs to be filled if it's running low.”

if the water level in the water dish is low
    fill a glass of water from the filtered water pitcher on the counter
    pour the glass of water into the water dish


“She also needs to play fetch with her favorite toy.”

toss  Ash's favorite toy
while Ash brings it back
    pat her on the head
    toss Ash's favorite toy

Code Examples


a = 5
b = 4
c = a * b
print("The value of c is", c)


if a > 60:
    print("Your score is", a)
    print("You passed the course!")    


n = 1
while n < 10:
    k = n + 1
    n = k
computer_basics/structured_programming_concepts_non-incremental.txt · Last modified: 2018/07/24 02:37 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki