A description of what a computer should do is a special case of an algorithm. In this special case, the algorithm is, before programming can begin, presented in a flowchart. Besides do this, do that, and so on, such a flowchart can contain certain structures. For example if a certain operation shall be done several times, then the flowchart specifies that the operation shall be done in a loop. Although structures are a big deal in informatics, there are in fact only two of them: the loop (with different sub-types) and the switch. The latter of these makes the execution of a certain operation dependent on a condition. Boolean variables come in handy here.
The answer to the question whether a certain condition is given is stored as the value TRUE (or not given as the value FALSE) in a Boolean variable. Every switch begins with checking whether a certain condition is given, which means checking whether a certain Boolean variable contains the value TRUE. If it contains the value FALSE, then this often is a dead end. This is especially true for avoiding errors. A computer program shall not end prematurely or behave unpredictable due to an error. So before accessing a certain disk or accessing a certain file, checks should be performed on whether the disk or the file exist at all. Many more checks of this type must be performed to the purpose to avoid errors.
A simple sub-type of the loop is the counted loop, which repeats a certain operation or set of operations for a given number of times. But in most cases isn’t known beforehand how often the operations must be repeated. Hence loops must continue either until a certain condition gets fulfilled or while a certain condition continues to be fulfilled. This again is stored in a Boolean variable, which must be checked either at the beginning or at the end of the loop.
Boolean variables really are essential for computer programs. This makes the dual number system so useful. Computer scientists sometimes change to number systems based on the number eight or based on the number sixteen. The number eight is represented as 10 in the octal system and as 1000 in the dual system. The number sixteen is represented as 10000 in the dual system. Eight and sixteen are round lots in the dual number system, so the octal system and the hexadecimal system serve as abbreviations for the notation in the dual number system. This doesn’t lessen the meaning, which the dual number system has because of Boolean variables and Boolean algebra.
2 thoughts on “Jack Pot’s Computer Literacy Lessons: Flowcharts and Program Structures”