[an error occurred while processing the directive]
RSS
Логотип
Баннер в шапке 1
Баннер в шапке 2
2010/05/24 17:31:56

Solving of tasks on a computer

Solving of tasks on a computer - one of types of creative tasks on classes, offsets, examinations and the Olympic Games in information science and programming.

Content

Stages of solving of tasks on a computer

The main stages of solving of tasks on a computer:

  1. Problem definition
  2. Determination of methods of the solution
  3. Drawing up algorithms
  4. Writing of the computer programs
  5. Debugging of programs on a computer
  6. Obtaining results on a computer

Problem definition

Problem definition - exact and accurate determination of required results and original conditions in tasks.

Results are correct if they meet the requirements of assigned tasks.

Results are wrong if they contradict the delivered requirements.

Tasks can be private (specific) and generalized (mass).

Determination of methods of the solution

The method of the solution is the general method of the solution of some class of tasks.

Solution method - correct if it yields the correct results.

Solution method - wrong if it yields the wrong results.

Method - the sequence of actions leading to obtaining results.

Solution method - correct if it yields the correct results for any initial data of an assigned task.

Drawing up algorithms

Algorithmization is a drawing up algorithms for solving of tasks on a computer. For solving of tasks on a computer exact problem definition with accurate selection required and initial is initial.

The algorithm is productive if its accomplishment leads to obtaining results.

The algorithm is correct if it yields the correct results for any legal initial data.

The algorithm contains errors if for it yields the wrong results or does not yield results in general for some legal initial data.

Writing and debugging of programs on a computer

Programming - writing of the computer programs can is made by three methods:

  1. writing of the program proceeding from statements of the problem. (traditional method)
  2. coding of programs for detailed algorithms of solving of tasks on a computer
  3. joint algorithm elaboration and programs (structured design)

The program contains errors if its accomplishment on a computer leads to receiving failures, failures or obtaining not the correct results.

Errors in algorithms programs - one of the most serious problems in information science and professional programming.

Debugging of programs - search and error correction in programs on a computer. As the number of errors is unknown, also duration of debugging of programs on a computer is unknown.

The lack of errors in programs is checked by their testing for a computer. Testing can reveal errors, but cannot guarantee lack of errors in programs. (Dijkstra)

Testing of programs for a computer

Testing of programs is a verification process of programs on a computer by tests. Tests are sets of test initial data with the list correct to results.

Obtaining the wrong results, failures or failures speaks about existence of errors in programs. Testing can show existence of errors in programs on a computer

The test set is structurally complete if on this test set each alternative, each sequence and each cycle one or several times is executed.

Testing cannot guarantee lack of errors in programs. Only the exhaustive analysis of correctness of algorithms and programs can give guarantees of lack of errors.

The analysis and correctness proofs of algorithms and programs it is possible and it is necessary to carry out after structurally complete testing of programs for a computer.

Analysis of correctness of algorithms

Examples of the analysis of correctness of algorithms and programs in the BASIC and Pascal languages are given in books by Dijkstra and textbooks by information science of Kaiming.

All examples are given with problem definitions, algorithms, specifications, texts of programs on the BASIC and correctness proofs of programs.

Literature

  1. Kaiming V.A. Informatika. The textbook for students. M, INFRA-M, 1998-2009.
  2. Kaiming V.A. Informatika. The textbook for school students. M, Progress, 2009.
  3. Kaiming V.A. Informatika. A benefit to examinations. M, RIOR, 2008.
  4. Kaiming V. A. Bases of evidential programming. M, MIEM, 1987.
  5. Kaiming V. A. Methods of development of programs in languages of the high level. M, MIEM, 1985.
  6. Kaiming V. A., Piterkin V.M. Fundamentals of information science and VT. The textbook for students. M.,MIEM. 1985.

Internet sources