How to solve problems in pascal

How to solve problems in pascal

Programming is a relatively young science. Nevertheless, the ability is required to be programmed from pupils as at school, and technical colleges. One of the most widespread languages at the moment is the programming language of the high Pascal level developed by Niklas Wirth 50 years ago. The solution of tasks in Pascal - occupation difficult, but fascinating.

It is required to you

  • Personal computer, Borland Pascal or Pascal ABC development environment, list of the main teams of language Pascal

Instruction

1. Establish the environment of execution of programs. Usually it is given in educational institution. Its installation will take a little time. It is better to specify the folder for saving pas files in one catalog with the Pascal environment. Then all your correct programs will be able precisely to work.

2. Having established the compilation environment, you can start the solution of tasks on pascal. First of all study the main teams of language: conditional operator if, cycles while and for, operator of giving (: =).

3. Study the main algorithms of programming: finding of the maximum and minimum element, number of negative/positive members of a matrix. It is important to be able to sort elements of the one-dimensional massif - to study sorting by a bubble method enough.

4. Having studied language bases, it is possible to solve any problem. Usually the solution of a task begins with the analysis of the input and output data. Look what data you have to output. Make the flowchart - the list of operations over input data which will be made by the compiler. Do not try to write down the flowchart in detail - write down only logic of future program.

5. Further start creation of the code of the program. Rewrite teams of Pascal and the known algorithms of a part of the flowchart. It is desirable to solve previously a problem on paper, and only then to write down the code on Wednesday of execution.

6. After you wrote down the code on Wednesday of Pascal, it is necessary to debug mistakes and to check operability of the program. It is quite simple to debug mistakes - the mistake is shown the compiler special illumination of the wrong line. Further test the child. Enter various data into the working program, estimate whether there corresponds weekend to necessary conditions. If yes - that you solved a problem on Pascal.

Author: «MirrorInfo» Dream Team


Print