top of page

L.C.P        Logic of Programs construction

The "complex" structures of programs :

Mixed complex structure :

A mixed complex structure data set is a set in which at the first subdivision level, several repetitive and alternative elementary structures are encountered.

Let's go back to our previous example and consider that we want to check if there is a difference between the total amount of orders and the amount of invoices for each customer.


Here is the F.L.S :

A little lexicon French ---> English !

 

Différence = difference !

             thank you for learning French!....

Go some courage, try to do the F.L.E, the hierarchical subdivision of the program and if you still need an organizational chart go for it.

A little advice now that you start to master, Get into the habit to number your logical sequences at the program level (from top to bottom and from left to right), as these will be your reference points.

You want to see the solution?

You got any good ? good job ..... now I'm sure you'd like me to ask you a little problem, here it is:

Where in this program would you put the instructions for "reading" a customer record, order and invoice ? (Assuming there is always at least 1 customer and 1 order and invoice per customer).

Note that to "read" a sequential file, there are as many "reads" as there are records in the file + 1 (the End of File (EOF)).

 you found ? Yes ? ..... So check out !

Indeed, when a logical sequence of the program is executed, it is necessary that the data that it is supposed to treat are available, otherwise there is a problem !
Let us take the example of the customer, at the beginning for one client (seq S020) we must have available his data, consequently the first "reading of the data relating to a customer must be done at the end of sequence S010 (Start program) and the others, Sequence S070 (end of a client) and if there is not EOF, the data for a new client will be available to execute the sequence S020 .
In the same way, the instruction for comparison and connection concerning the amounts of cdes and invoices must be the last instruction of the sequence INT2, since it is executed the same number of times and in the same place of the program as the other instructions Of this sequence.

These two small rules that can not be questioned allow (among others) to obtain perfectly structured programs.

We still have a complex structure to examine, the alternative complex structure.

Ancre 1
bottom of page