Friday, August 21, 2015

6. Computer Programming with flowcharting Technique (page 6)



Example: problem 2
You are asked to makes program to print number 1 up to 100 with difference 3

Solution
First number which will be printed is number 1
End number which will be printed is number 100
Iteration formula X = X + 3
Determines initial value = initial number (= 1) in PRINT X formerly
Check is value printed >( 100)
So X(0) = 1 and X(last) > 100
Determine terminal value. Maximum terminal values 100 written X > 100

FIG.5
Solution
First number which will be printed is number 1
End number which will be printed is maximum number 100
Iteration formula X = X + 3
Determines initial value = initial number (1) lessened difference ( 3) = 1 - 3 = - 2.
So X(0) = - 2
Determines the terminal value. Maximum terminal value 100 written by X > 100
After in check that X has not > 100, hence done by printing (PRINT X)

FIG.6
When in RUN, result is written by number: 1, 4, 7, 10, - - - and so on
Record (saves = save) program by the name: "SOAL2" or " PROG002"

Description:
If kept by the name "SOAL1" or "PROG001" hence stripper program ("SOAL1") or "PROG001" will be vanished ( overlapped) by new program which the same name. These are often done by new participant. Program vanished cannot be called (LOAD) again.

Statement File Open "SOAL1" or File Open "PROG001" will present as your first program

At program BASICA command is LOAD "Soal1" or LOAD "PROG001"

Followers

Blog Archive