Friday, August 21, 2015

5. Computer Programming with flowcharting Technique (page 5)



5. Flowchart: Compiles flowchart
A. Without data , Data formulated in program
B. data INPUT. Data in input when execution
C. READ data. Data and program is written together by one files.
D. FILING SYSTEM. Data is recorded separated from program .

5.1 A Without data
Example Of The problem of 1
You are asked to makes program to print number 1 up to 100 with difference 1

Solution The problem of 1
First number which will be printed is number 1
End number which will be printed is maximum 100
Iteration formula X = X + 1

5.1.1. Determines initial value
Initial number (1) lessened difference (1) = 1 - 1 = 0.
So X(0) = 0

5.1.2. Determines terminal value.
Maximum terminal value 100 written by X > 100
FIG. 4
Description

Every start process is started with Start at Terminal symbol
Command ( statement) written in uppercase.

Number 10
Terminal symbol , starts computing process
CLS abbreviation from CLear Screen = cleans [screen]
Statement governed the just for language BASICA
At other programming language governed the others statement

Line number 15
Governs to print article PROG001

Number 20
Preparation symbol (to write initial value)
Initial Value X = 0 (Determined by programmer: X(0) = 0 )

Number 30
Processing symbol ( to write formula )
Iteration formula is written at processing phonetic symbol.

Number 40
Decision symbol ( to take choice )
Statement always IF - - - followed THEN - - - IF X > 100 THEN 60
If statement correctness (Yes) (X value bigger than number 100) hence process is continued towards number process 60
Otherwise (NO) (value X is not more big from number 100) hence process is continued by number process 50
Important to remember that line number for wrong condition (NO) must always is prioritized (the number is smaller) from condition of correctness ( Yes)

Number 50
Data input-output phonetic symbol
PRINT X: governs to print value X in vertical (from the top downward).
For example: 1
2
3
4
5
6
7

PRINT X; governs to print value X nearby.
For example: 1 2 3 4 5 6 7
PRINT X, is governing to print value X in 5 column for every line
For example
1 2 3 4 5
6 7 8 9 10
11 12 etc.

Number 55
GOTO 30 is command for continuing to number process 30

Number 60
Symbol terminal : END terminates computing process

When program is executed, hence will be written number 1 2 3 4 - - - 100
Executes = implements ( RUN ) program

5.2. Program record ( Save )
Save program by the name "SOAL1" ( set solid) or "PROG001"

Doesn't write name " THE PROBLEM OF 1" or " PROG 001" ( there are spaces), because will be refused by computer on trespassing programming language order BASICA

Additional description:
Line number 10, 20, 30 and so on can be eliminated at this program
Writing of the line number better is done to facilitate studies program making,
This line number can be written with number 1, 2, 3 or 100, 200, 300 and so. But shall not be filled number set of 1, 2, 3 , because if required by inset, hence number inserted to in the form of fraction, for example number 2½ . At number tens of can be inserted number 31, 32, 35, 39 and so. Writing of this line number doesn't influence computing process.

Description: If using software Basica,
PRINT X will print number 1 up to 100 successive downward(in one column)
PRINT X; prints successive of righteous (at a line)
PRINT X, prints at a line with distance 1 column (maximum of 5 column)
PRINT TAB(1);TAB(3);TAB(5);TAB(7); prints in column 1, 3 , 5, and 7

Followers

Blog Archive