Thursday, October 1, 2009

38. Computer Programming with flowcharting Technique (page 38)

free counters




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 program By 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 program Data 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.

37. Computer Programming with flowcharting Technique (page 37)

free counters


8. ELEMENTARY FLOWCHART

8.1. EXAMPLE: Problem 12
From data which you there have been asked makes program to calculate
a. the many data
b. number of all data
c. the biggest data
d. smallest data
e. mean (AVERAGE)

8.2. Solution
This calculation process done applies mathematics formula by following way of writing of program that is:
Multiplication ( * ), division ( / ), quantifying ( + ), reduction ( - ), exponent rank ( ^ ), and gives parenthesis ( ) at part of calculation in order not to invite miscounting.

8.3. Logic:
Data read, when pot is clean data ( EOF), print output

8.4. Programming stages and steps:
8.4.1. Elementary flowchart picture
8.4.2. Writes name of variable

N = variable for the many data
N Initial Value = 0
TOTAL = variable for amounts of all data
MAX = variable for the biggest data
MIN = variable for smallest data
AVG = variable for mean (Average)

8.4.3. Determines variable data input
The biggest data lapped over out of three digits, hence addition berry of end data ( EOF = End Of File) that is number 999 ( the biggest number for three digits )

8.4.4. Writes mathematics formula required
8.4.5. Print output when data has finished
Fig.34

8.4.6. Program Listing
You would easily write the listing program.
Having making Program Listing writes data which will be processed.
Its way writes the data at the next line number for example.
180 DATA 38, 45, 20, 90, 27, 66, 49, 99
Then in SAVE by PROG057

8.4.7. Description:
And the biggest value is alterable smallest, in consequence there must be name of variable for the biggest data of temporary ( MAX) and smallest of temporary ( MIN)
At read of first data (value N=1) hence data value filled in as initial price for MAX and MIN.
At read of data hereinafter, data read ( A) compared to MAX and MIN. If A>MAX hence value A replaces value MAX stripper.
Then when A < MIN hence value A replaces value MIN stripper.
Thereby computing process will do update ( renewal) continuous value until pot is clean data
Value MAKS and last MIN printed as the biggest data ( MAX) and smallest ( MIN) from all data.
Numeral 999 that is end data is not processed. That function just for pointing to data boundary which must be processed. All data written behind data 99 will not be processed.

Information
Brainware: worker IT ( Information Technology)
Firstly is called as Data Entry Operator assigned enters / records data. With brief practice one can becomes Data Entry Operator
The next called as Computer Operators working it is operating / implements computer A computer operators must master Microsoft Office ( minimum) ( MsWord, Exel, PowerPoint and others)
(Nowadays Computer Operator and Data Entry Operator are the same profession)
A programmer must have programming logic and masters at least one programming languages for example Pascal, C, VB, Delphi, Java and so.
System Analyst is the next storey. A System Analyst receives making order of program from vendor that is company / individual of who is asking for designing program. Program which will be made must as according to order and according to programming logic path. In consequence between System Analyst and vendor agreement there must be that is then is poured in the form of System Design that is System Flowchart. From system design Programmer makes Program Design which is in the form of flowchart called as Program Flowchart. Hereinafter problems at this book made at this rate.

36. Computer Programming with flowcharting Technique (page 36)

free counters


7.6. Application

7.6.1. Siren
SOUND (A,B) to make sound.
A = frequency variable by minimizing 100 and maximum 30000 Hertz
B = variable duration minimum 01 and maximum 1000 seconds

7.6.1.1 Tone Program 1
10 CLS
15 PRINT “PROG051”
20 FOR A = 100 TO 10000 STEP 10
30 SOUND A,1
40 NEXT A

7.6.1.2 Tone Program 2
10 CLS
15 PRINT “PROG052”
20 FOR B = 100 TO 10000 STEP 10
30 SOUND (B,5)
40 NEXT B

7.6.1.3 Tone Program 3
10 CLS
15 PRINT “PROG053”
20 FOR C = 1 TO 100
30 SOUND (1000,C)
40 NEXT C

7.6.1.4 Tone Program 4
10 CLS
15 PRINT “PROG054”
20 FOR D = 1 TO 100 STEP 50
30 SOUND (1000,D)
40 NEXT D

35. Computer Programming with flowcharting Technique (page 35)

free counters


34. Computer Programming with flowcharting Technique (page 34)

free counters


33. Computer Programming with flowcharting Technique (page 33)

free counters


32. Computer Programming with flowcharting Technique (page 32)

free counters


31. Computer Programming with flowcharting Technique (page 31)

free counters


30. Computer Programming with flowcharting Technique (page 30)

free counters



FIG.33

29. Computer Programming with flowcharting Technique (page 29)

free counters



28. Computer Programming with flowcharting Technique (page 28)

free counters


7.3. Looping in the loop
Problem example
Print number 2 to 10 step 3, every number printed followed by article * counted number is printed by that. The process is repeated 4 times
Output :
2 * * 5 * * * * * 8 * * * * * * * *
2 * * 5 * * * * * 8 * * * * * * * *
2 * * 5 * * * * * 8 * * * * * * * *
2 * * 5 * * * * * 8 * * * * * * * *


Program Listing
10 CLS
15 PRINT “PROG038”
20 A$ = “*” : K = 0 : B = 0 : C = 0
30 C = C + 1
40 IF C > 4 THEN 160
50 K = - 1
60 K = K + 3
70 IF K > 10 THEN 140
80 PRINT K ;
90 B = 0
100 B = B + 1
110 IF B > K THEN 60
120 PRINT A$;
130 GOTO 100
140 PRINT
150 GOTO 30
160 END

Description:
Statement PRINT at line 70 is that line move display.

27. Computer Programming with flowcharting Technique (page 27)

free counters





26. Computer Programming with flowcharting Technique (page 26)

free counters



FIG.28

Sunday, September 6, 2009

24. Computer Programming with flowcharting Technique (page 24)

free counters



FIG.26
7.1.6. f. WHILE . . . WEND
1F1.
10 CLS
15 PRINT “PROG022”
20 X = 1
30 WHILE X < = 100
40 PRINT X;
50 X = X + 1
60 WEND
70 END

1F2.
10 CLS
15 PRINT “PROG023”
20 X = ( 1 – 1 )
30 WHILE X < 100
40 X = X + 1
50 PRINT X;
60 WEND
70 END

Note:
( PRINT X); backward and (PRINT X) ; in front )
If You change line number 40 and 50
40 X = X + 1
50 PRINT X;
change
40 PRINT X;
50 X = X + 1
Output:
2 3 4 . . . . 100 101 0 1 2 3 4 . . . . 100

23. Computer Programming with flowcharting Technique (page 23)

free counters



FIG.25
7.1.5. e. DO [statement block] . . . LOOP [ (UNTIL) condition ]
1E1.
10 CLS
15 PRINT “PROG020”
20 X = 1
30 DO
40 PRINT X;
50 X = X + 1
60 LOOP UNTIL X > 100
70 END

1E2.
10 CLS
15 PRINT “PROG021”
20 X = ( 1 – 1 )
30 DO
40 X = X + 1
50 PRINT X;
60 LOOP UNTIL X = 100
70 END

22. Computer Programming with flowcharting Technique (page 22)

free counters



FIG.24
7.1.4. d. DO [statement block] . . . LOOP [ (WHILE) condition ]
1D1
10 CLS
15 PRINT “PROG017”
20 X = 1
30 DO
40 PRINT X;
50 X = X + 1
60 LOOP WHILE X < = 100
70 END

1D2.
10 CLS
15 PRINT “PROG018”
20 X = ( 1 – 1 )
30 DO
40 X = X + 1
50 PRINT X;
60 LOOP WHILE X < 100
70 END

21. Computer Programming with flowcharting Technique (page 21)

free counters



FIG.23
7.1.3. c. DO [ (UNTIL) condition ] [statement block] . . . LOOP
1C.1.3
10 CLS
15 PRINT “PROG016”
20 X = 1
30 DO UNTIL X > 100
40 PRINT X;
50 X = X + 1
60 LOOP
70 END

1C.2.
10 CLS
15 PRINT “PROG017”
20 X = ( 1 – 1 )
30 DO UNTIL X = 100
40 X = X + 1
50 PRINT X;
60 LOOP
70 END

20. Computer Programming with flowcharting Technique (page 20)

free counters



FIG.22

19. Computer Programming with flowcharting Technique (page 19)

free counters



FIG.21
Writing differs from command goto but the output is same

7.1.1. a. FOR - - - NEXT - - - STEP
10 CLS
15 PRINT “PROG013”
20 X = 1
30 FOR X = 1 TO 100 STEP 1
35 PRINT X;
40 NEXT X
50 END

18. Computer Programming with flowcharting Technique (page 18)

free counters



FIG.20

17. Computer Programming with flowcharting Technique (page 17)

free counters


7. Command loopingBeside using command GOTO
Looping can be done with statement
a. FOR - - - NEXT - - STEP
b. DO [ (WHILE) condition ] [statement block] . . . LOOP
c. DO [ (UNTIL) condition ] [statement block] . . . LOOP
d. DO [statement block] . . . LOOP [ (WHILE) condition ]
e. DO [statement block] . . . LOOP [ (UNTIL) condition ]
f. WHILE . . . WEND

For example :
7.1. Single LoopingPrint number 1 to 100 successive ( step 1)
( Output : 1 2 3 4 5 . . . . . 100 )
PROG012
With GOTO statement

FIG.19

16. Computer Programming with flowcharting Technique (page 16)

free counters



Problem 11 You are asked to makes program to print article NEW YORK 10 times then town METROPOLITAN counted 3 times.
The process is repeated 5 times

Solution
To print 10 times is given by iteration constrain 10 times with Counter A
To print 3 times is given by iteration constrain 3 times with Counter B
To repeat the process 5 times is determined with Counter C

Logic:
Does iteration 10 times to print word " NEW YORK"
Does iteration counted 3 times to print word " town METROPOLITAN"
Does iteration counted 5 times to redo the process.

Programming stages and steps: Determines string variable to say NEW YORK and town METROPOLITAN
Process looping with iteration 10 times for counter and word NEW YORK

Description Every completed printing 10 times word " NEW YORK" , counter A in zero isn't it ( A = 0)
( line number 100 )
So also completed printing 3 times word " town METROPOLITAN" counter B also in zero isn't it ( line number 140 ). This process alike in filling gasoline station. Having filling gasoline in each vehicle, counter in zero isn't it to start calculates gasoline litre at the next vehicle.

At problem 11 is counter zero A = 0 and B = movable 0 at line after number 50 for example 51 A = 0 and 52 B = 0 . Result of its is being equal.

FIG.18

Output
First iteration
NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK town METROPOLITAN town METROPOLITAN town METROPOLITAN
Second iteration
NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK town METROPOLITAN town METROPOLITAN town METROPOLITAN
etc until 10th iteration.

Followers