Friday, August 21, 2015

38. Computer Programming with flowcharting Technique (page 38)


9. The problem in programming logics consists of three parts
A. Problem with the data is in one file with the program
B. Problem with the data separated from program
C. The problem of the application of system accountancy,

A. Problem with the data is in one file with the programBy READ DATA processing, that is Extract Processing.
Data filtered before done by computing process (summarize).
Summarize, consisted of:
i. Single Control Break: Process is done based on the same key-field
ii. Multiple Control Break: Process is done based on the same key-field MAYOR and some the same key-field MINOR.
iii. Double Check.Process is done to having double record in the same key-field

B. Problem with the data separated from programData is written in a file, and program is written in the other file.
It is done by Filing System with OPEN FILE statement.
There are five computing process:
a. Sort Processing consisted of: i. Bubble Sort ii. Insert Sort
b. Look Up Table Processing
c. Match Data Processing
d. Data Update Processing
e. Merge Data Processing

C. The problem of the application of system accountancy.Input data is processed by several programs
Output from the first process to be processed into output by the second program.
Later this output becomes the input to the next program. And so on.

10. The EXTRACT theoryExtract mean filtering.
There are some criteria certain of which must be passed every data.
For example this five kinds of criteria
When criteria firstly are fulfilled, direct data is processed.
When doesn't fulfill clauses, there are still four other criteria of which must be passed to process computing.
Example:
There is a student.For example his/her name is " A" , is one of the five son/daughter. When we wish to know about this student,hence we need to prepare four criteria for this student which is:
1. The First son/daughter, if not, distribute to criteria 2.
2. Second, if not, distribute to criteria 3
3. Third, if not, distribute to criteria 4
4. Fourth, if not also, not necessarily asked no more, he/she must be the Fifth son/daughter
So if criteria there are 5, test is done by 4 times. ( 5 - 1 = 4 )
If (there are) any 3 criterion, enough 2 times test only. ( 3 - 1 = 2 )
If 2 criterion, enough once test only. ( 2 - 1 = 1 )

Example of problem 13 ( extract )
PROG060
By one class rooms there are 10 students. If it is known that maximum consisted of having 7 sister/brother.
Calculate
a. Number of students which have 1 brother / sister
b. Number of students which have 2 brother / sister and so on.
Record Input:
Name of student: 20 digits alpha numeric
Code:1 digit numeric
Record Output:
Name of student: 20 digits alpha numeric
Code:1 digit numeric
By the end of print process:Calculate Total number of student which having bother/sister 1,2,3 etc.
Fig.35

LISTING PROGRAM PROG06010 CLS
20 PRINT “PROG060”
30 INPUT “Year process : “;YEAR
40 T1 = 0
41 T2 = 0
42 T3 = 0
43 T4 = 0
44 T5 = 0
45 T6 = 0
46 T7 = 0
50 READ A$,B
60 IF A$ = “*“ THEN 210
70 IF B = 1 THEN 150
80 IF B = 2 THEN 160
90 IF B = 3 THEN 170
100 IF B = 4 THEN 180
110 IF B = 5 THEN 190
120 IF B = 6 THEN 200
130 T7 = T7 + 1
140 PRINT A$ , B
145 GOTO 50
150 T1 = T1 + 1
155 GOTO 140
160 T1 = T1 + 1
165 GOTO 140
170 T1 = T1 + 1
175 GOTO 140
180 T1 = T1 + 1
185 GOTO 140
190 T1 = T1 + 1
195 GOTO 140
200 T1 = T1 + 1
205 GOTO 140
210 PRINT “TOTAL 1 = “ ; T1
220 PRINT “TOTAL 2 = “ ; T2
230 PRINT “TOTAL 3 = “ ; T3
240 PRINT “TOTAL 4 = “ ; T4
250 PRINT “TOTAL 5 = “ ; T5
260 PRINT “TOTAL 6 = “ ; T6
270 PRINT “TOTAL 7 = “ ; T7
280 END
290 DATA RONO ASTRO , 3
300 DATA EYANG PUTRI , 1
310 DATA WIRYO SOEMARTO , 2
320 DATA SUPINAH , 1
330 DATA ROESTAMADJI , 2
340 DATA SOEPADMI KANTI , 5
350 DATA SUKEMI HANDINI , 6
360 DATA KAMSIYAH , 2
370 DATA ROESMINTONO , 7
380 DATA MOEDJIATI , 5
390 DATA * ,0

Output
PROG060
Year process : 2009
RONO ASTRO , 3
EYANG PUTRI , 1
WIRYO SOEMARTO , 2
SUPINAH , 7
ROESTAMAJI , 2
SOEPADMI KANTI , 5
SUKEMI HANDINI , 6
KAMSIYAH , 2
ROESMINTONO , 7
MOEDJIATI , 2
“TOTAL 1 = “ ; 1
“TOTAL 2 = “ ; 4
“TOTAL 3 = “ ; 1
“TOTAL 4 = “ ; 0
“TOTAL 5 = “ ; 1
“TOTAL 6 = “ ; 1
“TOTAL 7 = “ ; 2

Note:
Data are written in the last program listing.
Data name and code is separate by comma.
The last data is data substitute which is * for non numeric data which is data $(string).
And 0 for numeric data.

Followers

Blog Archive