Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
Flowchart to program - learning to program with Well House

Drawing a flowchart is how many people understand a process; it's something that's been used in schools and textbooks for many generations, and it provides a graphic representation of choices and actions that most people find easy to follow.

For newcomers to programming, such as on my Learning to program in Python course early last week, writing their first loops and conditions can be daunting - and yet they'll very often be familiar with a flowchart.

But it turns out that a program with a conditional in it is no more than a flowchart converted to a textual representation. Rather than a diamond box, the word if is used, and that may be followed by the contents of the diamond box in brackets - the exact syntax used will depend on the language.

Below the diamond box on a flowchart, you'll typically have rectangular boxes side by side saying what to do if the condition is true ("yes"), and what to do if the condition is not true ("no"). In a program, you can't have two pieces of code side by side, so you'll write them one above the other and indicate somehow (it depends on the language) where one of the blocks ends and the other starts.

Let's take that graphic representaton from the flowchart and show you the structure in PHP or Perl:

  if (condition) {
    true action
  } else {
    false action
  }


and in Python:

  if condition:
    true action
  else:
    false action


Our next "learning to progam in ..." courses are scheduled as follows:

Learning to program in Ruby - from 22nd October 2012 [link]
Learning to program in PHP - from 4th November 2012 [link]
Learning to program in Python - from 3rd December 2012 [link]
Learning to program in Perl - from 10th December 2012 [link]

If you want to learn to program in Lua, Tcl, C or C++, we offer those courses too, though remaining availablity in 2012 is limited. A full schedule, showing all courses at least 6 months ahead, is available [here].

(written 2012-10-14, updated 2012-10-20)

 
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
Y103 - Python - Conditionals and Loops
  [299] What - no switch or case statement? - (2005-05-03)
  [353] Wimbledon Neck - (2005-06-20)
  [657] The ternary operator in Python - (2006-03-25)
  [668] Python - block insets help with documentation - (2006-04-04)
  [788] New - Conditional expressions in Python 2.5 - (2006-07-01)
  [835] Python - when to use the in operator - (2006-08-16)
  [909] Python is like a narrowboat - (2006-10-30)
  [1201] No switch in Python - (2007-05-23)
  [1477] Decisions - small ones, or big ones? - (2007-12-18)
  [1661] Equality, sameness and identity - Python - (2008-05-31)
  [1696] Saying NOT in Perl, PHP, Python, Lua ... - (2008-07-04)
  [2778] Learning to program in Python 2 ... and / or in Python 3 - (2010-05-24)
  [2899] Groupsave tickets - 3 or 4 train tickets for the price of 2 - (2010-08-02)
  [3083] Python - fresh examples from recent courses - (2010-12-11)
  [3200] How a for loop works Java, Perl and other languages - (2011-03-12)
  [3397] Does a for loop evaluate its end condition once, or on every iteration? - (2011-08-18)
  [3439] Python for loops - applying a temporary second name to the same object - (2011-09-14)
  [3558] Python or Lua - which should I use / learn? - (2011-12-21)
  [3620] Finding the total, average, minimum and maximum in a program - (2012-02-22)
  [3762] Learning to program - the if statement. Python. - (2012-06-12)
  [4092] Identity in Python - (2013-05-17)
  [4210] If elif elif elif - multiway selection in Python - (2013-11-16)
  [4322] Learning to Program - the conditional statement (if) - (2014-11-21)
  [4323] Learning to program - Loop statements such as while - (2014-11-22)
  [4402] Finding sum, minimum, maximum and average in Python (and Ruby) - (2015-01-19)
  [4541] Setting up and tearing down with the Python with keyword - (2015-10-16)
  [4545] Method, Class, Module, Package - how to they relate in Python? - (2015-10-17)
  [4713] Equality (in Python) - (2016-10-30)
  [4723] Conditional operators in Python - (2016-11-05)

Q904 - Object Orientation and General technical topics - Analysing a Programming Task
  [747] The Fag Packet Design Methodology - (2006-06-06)
  [1345] Perl and Shell coding standards / costs of an IT project - (2007-09-11)
  [1513] Perl, PHP or Python? No - Perl AND PHP AND Python! - (2008-01-20)
  [1607] Learning to program in Perl - (2008-04-11)
  [1850] Daisy the Cow and a Pint of Ginger Beer - (2008-10-21)
  [1853] Well structured coding in Perl - (2008-10-24)
  [2327] Planning! - (2009-08-08)
  [2715] Uploading an image, document or pdf via a browser (php) - (2010-04-10)
  [2834] Teaching examples in Perl - third and final part - (2010-06-27)
  [3329] Perl from basics - (2011-06-20)
  [3366] Specification, Design, Implementation, Testing and Documentation - stages of a (Java) programming project - (2011-07-21)
  [3461] From flowchart to program - code design for the newcomer - (2011-09-29)

Q100 - Object Orientation and General technical topics - Learning to Progam
  [116] The next generation of programmer - (2004-11-13)
  [1605] Learning and understanding scripting programming techniques - (2008-04-08)
  [1963] Best source to learn Java (or Perl or PHP or Python) - (2008-12-28)
  [1985] Learning to program as a part of your job - (2009-01-10)
  [2001] I have not programmed before, and need to learn - (2009-01-19)
  [2048] Learning to program in PHP, Python, Java or Lua ... - (2009-02-19)
  [2092] Tracking difficult bugs, the programmer / customer relationship - (2009-03-20)
  [2286] New to programming? It is natural (but needless) for you to be nervous - (2009-07-14)
  [2294] Can you learn to program in 4 days? - (2009-07-16)
  [2326] Learn a new programming language this summer. - (2009-08-06)
  [2504] Learning to program in ... - (2009-11-15)
  [2505] I almost put the bins out this morning - (2009-11-16)
  [2898] Programming Standards from the start! - (2010-08-02)
  [2973] Learning to program - where to start if you have never programmed before - (2010-09-28)
  [3120] Learning to write good programs in C and C++ - separating out repeated code - (2011-01-04)
  [3551] Some terms used in programming (Biased towards Python) - (2011-12-12)
  [4008] Reading and checking user inputs - first lessons - Ruby - (2013-02-17)
  [4318] Learning to Program - how we start to teach you at Well House Consultants - (2014-11-16)
  [4324] Learning to program - variables and constants - (2014-11-22)
  [4325] Learning to program - what are algorithms and design patterns? - (2014-11-22)
  [4326] Learning to program - comments, documentation and test code - (2014-11-22)
  [4337] Learning to program sample program - past its prime, but still useful - (2014-12-02)
  [4575] Learning not just what a program does, but how to design it in the first place. - (2015-11-06)

P204 - Perl - Conditionals and Loops
  [930] -> , >= and => in Perl - (2006-11-18)
  [1191] Smart English Output - via PHP and Perl ? : operator - (2007-05-18)
  [1468] Lexical v Arithemetic testing, Bash and Perl - (2007-12-11)
  [1727] Equality and looks like tests - Perl - (2008-07-29)
  [2351] Ternary operators alternatives - Perl and Lua lazy operators - (2009-08-12)
  [2550] Do not copy and paste code - there are much better ways - (2009-12-26)
  [2711] For loop - checked once, or evety time? Ruby v Perl comparison and contrast - (2010-04-07)
  [2832] Are you learning Perl? Some more examples for you! - (2010-06-27)
  [3004] Increment operators for counting - Perl, PHP, C and others - (2010-10-18)
  [4031] Showing what programming errors look like - web site pitfall - (2013-03-06)

H104 - PHP - Control Statements
  [340] Code and code maintainance efficiency - (2005-06-08)
  [406] Assignment, equality and identity in PHP - (2005-08-08)
  [421] Don't repeat code - use loops or functions - (2005-08-21)
  [863] Double and Triple equals operator in PHP - (2006-09-12)
  [962] Breaking a loop - Ruby and other languages - (2006-12-03)
  [1199] Testing for one of a list of values. - (2007-05-22)
  [1220] for loop - how it works (Perl, PHP, Java, C, etc) - (2007-06-06)
  [1825] Question Mark - Colon operator (Perl and PHP) - (2008-10-08)
  [2304] Extracting real data from an exported file in PHP or Perl - (2009-07-25)
  [2912] Predictions for the seagull population - (2010-08-09)
  [3914] While, for, foreach or something else to loop. - (2012-11-06)


Back to
A wet Saturday
Previous and next
or
Horse's mouth home
Forward to
An email marathon
Some other Articles
Father Christmas to be on train in Melksham
The course must go on - improvements to tutor travel plans, with immediate effect
Autumn scenes from Melksham
An email marathon
Flowchart to program - learning to program with Well House
A wet Saturday
Public Transport across Wiltshire - a new map
Distributed, Balanced and Clustered Load Sharing - the difference
The components of an Apache httpd / Tomcat / MySQL stack and what each does
Here comes Santa - on the train from Melksham to Swindon on 2nd December 2012
4759 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/mouth/3895_.html • PAGE BUILT: Sun Oct 11 16:07:41 2020 • BUILD SYSTEM: JelliaJamb