Current location - Education and Training Encyclopedia - Graduation thesis - Pseudocode and VB
Pseudocode and VB
LZ should understand that pseudocode is not used to write programs.

For example, if you want to write a composition, VB, C and Delphi are like narratives, argumentations and expositions, which are finally presented on the composition paper; Pseudocode is just a draft.

Pseudo-code describes the algorithm with words and symbols between natural language and computer language. Like an article, written from top to bottom, each line (or lines) represents a basic operation. It does not use graphic symbols, so it is convenient to write, compact in format, easy to understand and easy to transition to computer language algorithms (that is, programs).

For example, the algorithm of "outputting the absolute value of x" can be expressed by pseudo code as follows:

If x is positive, then

Print x

other

Print -x

It is as easy to understand as English sentences and is widely used in western countries.

You can also use Chinese pseudocode. For example:

If x is positive

Output x

otherwise

Output -x

You can also use a mixture of Chinese and English, for example:

If x is positive.

Print x

other

Print -x

Then change it to VB code:

If x> is 0.

Print x

other

Print -x

If ... it will be over.