Programming Pattern Techniques
Programming Pattern Techniques
TECHNIQUES
Identify the
datatypes
PSEUDOCODE Functions
PSEUDOCODE
Functions
PSEUDOCODE
Functions
PSEUDOCODE Functions
PSEUDOCODE Operators
Read character by character from a string
FOR count1 TO LENGTH(string)
NextCharMID(string,count,1) String<-”ArabUnity”
Position Values→ 1 2 3 4 5 6 7 8 9
A r a b U n i t y
count
Count=1 Count=2 Count=3 Count=4 Count=5 Count=6 Count=7 Count=8 Count=9
Read data one by one from an integer array
FOR count1 TO SIZE
dataA[count]
Position Values→ A[1] A[2] A[3] A[4] A[5] A[6] A[7] A[8] A[9]
18 22 33 55 78 89 65 54 26
count
Count=1 Count=2 Count=3 Count=4 Count=5 Count=6 Count=7 Count=8 Count=9
Read data from a text file as line by line
WHILE NOT EOF(“sample.txt”)
READFILE “sample.txt”,FileData
EOF Status
EOF → TRUE
Case-1
Fixed Number of Characters
Extract substrings from the line of text
IF accno&’*’=LEFT(FileData,LENGTH(accno)+1)
Suppose accno=GB1234
THEN
LENGTH(accno)=6
FoundTRUE
ENDIF
Total=0+215
LENGTH(FileData) = 11 215
LENGTH(Filedata)-8 =3 Total=215
RIGHT(FileData,LENGTH(FileData)-8) TotalTotal+STRING_TO_NUM(RIGHT(FileData,LENGTH(FileData)-8))