Sunday, September 6, 2009

12. Computer Programming with flowcharting Technique (page 12)

free counters


Problem 7
You are requested to make a program sort the number of the largest to the smaller number is determined when the number of three-INPUT is not the same magnitude.

Solutions
Eg the number of K, L and M
Logic:
The first is the largest, followed by a smaller number and the last is the smallest.
Programming steps:
compare K with L, and the winner compare with M, the winner is the first order
Losers compare with others who also lost for a second.
The remaining sequence is the last (the smallest)

FIG.14


Sequence logic is logic that is very difficult when data amounts which will be sorted quite a lot.

DATA TEST: Sees example before all

Output

For two data A and B is obtained by 2 output that is A,B and B,A = 2 ! = 1 x 2 = 2

For three data K,L,M is obtained by 3 ! ( factorial) = 1 x 2 x 3 = 6 output that is:

( K,L,M ), ( K,M,L ), ( L,K,M ), ( L,M,K ), ( M,K,L ) and ( M,L,K )

For four data P,Q,R,S will be got output 4 ! = 1x2x3x4 = 24 output

That way further.

Sequence four data is not done here because its flowchart is too big.

At computing process, there is tens of data sequence program which has been found. Till now the expert still looking for quickest program to sort data in gross.

Followers