gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control system
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 72a5757)
raw | patch | inline | side by side (parent: 72a5757)
author | Doni Pracner <quinnuendo@gmail.com> | |
Sat, 15 Feb 2014 17:32:01 +0000 (18:32 +0100) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Sat, 15 Feb 2014 17:32:01 +0000 (18:32 +0100) |
kodovi/fajlovi/nizslog.MOD | [new file with mode: 0644] | patch | blob |
kodovi/fajlovi/studenti.txt | [new file with mode: 0644] | patch | blob |
kodovi/nizslog.MOD | [deleted file] | patch | blob | history |
kodovi/studenti.txt | [deleted file] | patch | blob | history |
diff --git a/kodovi/fajlovi/nizslog.MOD b/kodovi/fajlovi/nizslog.MOD
--- /dev/null
@@ -0,0 +1,122 @@
+MODULE nizslog;\r
+FROM InOut IMPORT WriteString, WriteLn, WriteCard,\r
+ ReadCard, ReadString;\r
+FROM FIO IMPORT File, Open, Create, Close, EOF,\r
+ RdItem, RdCard, WrStr, WrCard, WrLn;\r
+FROM Str IMPORT Compare;\r
+\r
+CONST\r
+ MaxStud = 100;\r
+TYPE\r
+ String = ARRAY[1..30] OF CHAR;\r
+ Student = RECORD\r
+ ime, prez: String;\r
+ god: CARDINAL;\r
+ END;\r
+ Studenti = ARRAY[1..MaxStud] OF Student;\r
+\r
+PROCEDURE UcitajF(fajl:String;\r
+ VAR spisak: Studenti; VAR n:CARDINAL);\r
+VAR\r
+ f:File;\r
+BEGIN\r
+ n:=0;\r
+ f:= Open(fajl);\r
+ EOF := FALSE;\r
+ WHILE NOT EOF DO\r
+ INC(n);\r
+ RdItem(f, spisak[n].prez);\r
+ RdItem(f, spisak[n].ime);\r
+ spisak[n].god := RdCard(f);\r
+ END;\r
+ Close(f);\r
+END UcitajF;\r
+\r
+PROCEDURE Ispisi(spisak:Studenti; n:CARDINAL);\r
+VAR\r
+ i: CARDINAL;\r
+BEGIN\r
+ FOR i:=1 TO n DO\r
+ WriteString(spisak[i].prez);\r
+ WriteString(" ");\r
+ WriteString(spisak[i].ime);\r
+ WriteString(" ");\r
+ WriteCard(spisak[i].god,1);\r
+ WriteLn;\r
+ END;\r
+END Ispisi;\r
+\r
+PROCEDURE IspisiF(fajl:String;\r
+ spisak:Studenti; n:CARDINAL);\r
+VAR\r
+ f:File;\r
+ i: CARDINAL;\r
+BEGIN\r
+ IF (n>0) AND (n<=MaxStud) THEN\r
+ f:=Create(fajl);\r
+ (* pravimo takav fajl da ne\r
+ postoji zadnji prazan red *)\r
+ FOR i:=1 TO n-1 DO\r
+ WrStr(f,spisak[i].prez);\r
+ WrStr(f," ");\r
+ WrStr(f,spisak[i].ime);\r
+ WrStr(f," ");\r
+ WrCard(f,spisak[i].god,1);\r
+ WrLn(f);\r
+ END;\r
+ WrStr(f,spisak[n].prez);\r
+ WrStr(f," ");\r
+ WrStr(f,spisak[n].ime);\r
+ WrStr(f," ");\r
+ WrCard(f,spisak[n].god,1);\r
+ Close(f);\r
+ END;\r
+END IspisiF;\r
+\r
+PROCEDURE NoviStudent(VAR spisak:Studenti; VAR n:CARDINAL);\r
+VAR\r
+ stud,temp:Student;\r
+ i:CARDINAL;\r
+ dodaj:BOOLEAN;\r
+BEGIN\r
+ IF n<MaxStud THEN\r
+ WriteString("Prezime novog studenta?");\r
+ ReadString(stud.prez);\r
+ WriteString("Ime novog studenta?");\r
+ ReadString(stud.ime);\r
+ WriteString("God. rodj. novog studenta?");\r
+ ReadCard(stud.god);\r
+ (* proverimo da li vec postoji *)\r
+ i:=1;\r
+ dodaj := TRUE;\r
+ WHILE (i<=n) AND dodaj DO\r
+ temp := spisak[i];\r
+ IF (temp.god = stud.god) &\r
+ (Compare(temp.prez,stud.prez)=0) &\r
+ (Compare(temp.ime,stud.ime)=0) THEN\r
+ dodaj:=FALSE;\r
+ END;\r
+ INC(i);\r
+ END;\r
+ IF dodaj THEN\r
+ INC(n);\r
+ spisak[n]:=stud;\r
+ ELSE\r
+ WriteString("podaci vec postoje!");\r
+ END;\r
+ ELSE\r
+ WriteString("popunjen kapacitet!");\r
+ END;\r
+END NoviStudent;\r
+\r
+VAR\r
+ spisak : Studenti;\r
+ fajl:String;\r
+ n:CARDINAL;\r
+BEGIN\r
+ fajl:="studenti.txt";\r
+ UcitajF(fajl, spisak, n);\r
+ Ispisi(spisak, n);\r
+ NoviStudent(spisak,n);\r
+ IspisiF(fajl, spisak, n);\r
+END nizslog.
\ No newline at end of file
diff --git a/kodovi/fajlovi/studenti.txt b/kodovi/fajlovi/studenti.txt
--- /dev/null
@@ -0,0 +1,6 @@
+Prezime Ime 1980\r
+Dva Tri 4\r
+a b 2\r
+alfa beta 3\r
+4 4 0\r
+ha hhha 13
\ No newline at end of file
diff --git a/kodovi/nizslog.MOD b/kodovi/nizslog.MOD
--- a/kodovi/nizslog.MOD
+++ /dev/null
@@ -1,122 +0,0 @@
-MODULE nizslog;\r
-FROM InOut IMPORT WriteString, WriteLn, WriteCard,\r
- ReadCard, ReadString;\r
-FROM FIO IMPORT File, Open, Create, Close, EOF,\r
- RdItem, RdCard, WrStr, WrCard, WrLn;\r
-FROM Str IMPORT Compare;\r
-\r
-CONST\r
- MaxStud = 100;\r
-TYPE\r
- String = ARRAY[1..30] OF CHAR;\r
- Student = RECORD\r
- ime, prez: String;\r
- god: CARDINAL;\r
- END;\r
- Studenti = ARRAY[1..MaxStud] OF Student;\r
-\r
-PROCEDURE UcitajF(fajl:String;\r
- VAR spisak: Studenti; VAR n:CARDINAL);\r
-VAR\r
- f:File;\r
-BEGIN\r
- n:=0;\r
- f:= Open(fajl);\r
- EOF := FALSE;\r
- WHILE NOT EOF DO\r
- INC(n);\r
- RdItem(f, spisak[n].prez);\r
- RdItem(f, spisak[n].ime);\r
- spisak[n].god := RdCard(f);\r
- END;\r
- Close(f);\r
-END UcitajF;\r
-\r
-PROCEDURE Ispisi(spisak:Studenti; n:CARDINAL);\r
-VAR\r
- i: CARDINAL;\r
-BEGIN\r
- FOR i:=1 TO n DO\r
- WriteString(spisak[i].prez);\r
- WriteString(" ");\r
- WriteString(spisak[i].ime);\r
- WriteString(" ");\r
- WriteCard(spisak[i].god,1);\r
- WriteLn;\r
- END;\r
-END Ispisi;\r
-\r
-PROCEDURE IspisiF(fajl:String;\r
- spisak:Studenti; n:CARDINAL);\r
-VAR\r
- f:File;\r
- i: CARDINAL;\r
-BEGIN\r
- IF (n>0) AND (n<=MaxStud) THEN\r
- f:=Create(fajl);\r
- (* pravimo takav fajl da ne\r
- postoji zadnji prazan red *)\r
- FOR i:=1 TO n-1 DO\r
- WrStr(f,spisak[i].prez);\r
- WrStr(f," ");\r
- WrStr(f,spisak[i].ime);\r
- WrStr(f," ");\r
- WrCard(f,spisak[i].god,1);\r
- WrLn(f);\r
- END;\r
- WrStr(f,spisak[n].prez);\r
- WrStr(f," ");\r
- WrStr(f,spisak[n].ime);\r
- WrStr(f," ");\r
- WrCard(f,spisak[n].god,1);\r
- Close(f);\r
- END;\r
-END IspisiF;\r
-\r
-PROCEDURE NoviStudent(VAR spisak:Studenti; VAR n:CARDINAL);\r
-VAR\r
- stud,temp:Student;\r
- i:CARDINAL;\r
- dodaj:BOOLEAN;\r
-BEGIN\r
- IF n<MaxStud THEN\r
- WriteString("Prezime novog studenta?");\r
- ReadString(stud.prez);\r
- WriteString("Ime novog studenta?");\r
- ReadString(stud.ime);\r
- WriteString("God. rodj. novog studenta?");\r
- ReadCard(stud.god);\r
- (* proverimo da li vec postoji *)\r
- i:=1;\r
- dodaj := TRUE;\r
- WHILE (i<=n) AND dodaj DO\r
- temp := spisak[i];\r
- IF (temp.god = stud.god) &\r
- (Compare(temp.prez,stud.prez)=0) &\r
- (Compare(temp.ime,stud.ime)=0) THEN\r
- dodaj:=FALSE;\r
- END;\r
- INC(i);\r
- END;\r
- IF dodaj THEN\r
- INC(n);\r
- spisak[n]:=stud;\r
- ELSE\r
- WriteString("podaci vec postoje!");\r
- END;\r
- ELSE\r
- WriteString("popunjen kapacitet!");\r
- END;\r
-END NoviStudent;\r
-\r
-VAR\r
- spisak : Studenti;\r
- fajl:String;\r
- n:CARDINAL;\r
-BEGIN\r
- fajl:="studenti.txt";\r
- UcitajF(fajl, spisak, n);\r
- Ispisi(spisak, n);\r
- NoviStudent(spisak,n);\r
- IspisiF(fajl, spisak, n);\r
-END nizslog.
\ No newline at end of file
diff --git a/kodovi/studenti.txt b/kodovi/studenti.txt
--- a/kodovi/studenti.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Prezime Ime 1980\r
-Dva Tri 4\r
-a b 2\r
-alfa beta 3\r
-4 4 0\r
-ha hhha 13
\ No newline at end of file