[go: up one dir, main page]

0% found this document useful (0 votes)
8 views3 pages

Using Function

Uploaded by

tharrnaymin1438
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

Using Function

Uploaded by

tharrnaymin1438
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Group[1:15] Name[1:15] Score[1:15][1:6]

1 G1 1 xxxx 1 20
2 G1 2 xxxx 2 15
3 G3 3 xxxx 3 23
4 G2 4 xxxx 4 18
5 G2 5 xxxx 5 22
6 G1 6 xxxx 6 35
7 G3 7 xxxx 7 33
8 G2 8 xxxx 8 40
9 G3 9 xxxx 9 24
10 G3 10 xxxx 10 32
11 G3 11 xxxx 11 34
12 G2 12 xxxx 12 21
13 G2 13 xxxx 13 25
14 G1 14 xxxx 14 19
15 G2 15 xxxx 15 17

FUNCTION EachMax(Score[],a)
Max0
FOR j1 TO 7
IF Score[a,j]> Max THEN
Max< Score[a,j]
ENDIF
NEXT j
RETUR Max

ENDFUNCTION

==

MaxOnAll0
MaxPos0
FOR k1 TO 15
Temp EachMax(Score[],k)
IF Temp> MaxOnAll THEN
MaxOnAllTemp
MaxPosk
ENDIF
NEXT k
OUTPUT “Maximum score”, MaxOnAll
OUTPUT “Name is”,Name[MaxPos]
OUTPUT “Group”,Group[MaxPos]
===
G1Max0, G1Pos0
G2Max0, G2Pos0
G3Max0, G3Pos0

FOR k1 TO 15
Temp EachMax(Score[],k)
IF Group[k]=G1 THEN
IF Temp> G1Max THEN
G1MaxTemp
G1Pos k
ENDIF
ELSE Group[k]=G2
IF Temp> G2Max THEN
G2MaxTemp
G2Pos k
ENDIF
ELSE
IF Temp> G3Max THEN
G3MaxTemp
G3Pos k
ENDIF
ENDIF
NEXT k
OUTPUT “Group 1 max”, G1Max, “Name is”, Name[G1Pos]
OUTPUT “Group 2 max”, G2Max, “Name is”, Name[G2Pos]
OUTPUT “Group 3 max”, G3Max, “Name is”, Name[G3Pos]

DECLARE st : STRING
OUTPUT “Enter text”

INPUT st

OPEN “Myfile.txt” FOR WRITE


WRITE “Myfile.txt”,st
CLOSE “Myfile.txt
==
DECLARE st : STRING
OPEN “Myfile.txt” FOR READ
READ “Myfile.txt”, st
CLOSE “Myfile.txt”

FileName”Myfile.txt”

OPEN FileName FOR READ


READ FileName, st
CLOSE FileName

You might also like