You are on page 1of 9

qwertyuiopasdfghjklzxcvbnmqwertyui

opasdfghjklzxcvbnmqwertyuiopasdfgh
jklzxcvbnmqwertyuiopasdfghjklzxcvb
nmqwertyuiopasdfghjklzxcvbnmqwer
COMPUTER PROJECT

tyuiopasdfghjklzxcvbnmqwertyuiopas
Evaluation System of Students

12/24/2021

dfghjklzxcvbnmqwertyuiopasdfghjklzx
Roselyn Tapol
Gr. X'A'
18

cvbnmqwertyuiopasdfghjklzxcvbnmq
wertyuiopasdfghjklzxcvbnmqwertyuio
pasdfghjklzxcvbnmqwertyuiopasdfghj
klzxcvbnmqwertyuiopasdfghjklzxcvbn
mqwertyuiopasdfghjklzxcvbnmqwerty
uiopasdfghjklzxcvbnmqwertyuiopasdf
ghjklzxcvbnmqwertyuiopasdfghjklzxc
vbnmqwertyuiopasdfghjklzxcvbnmrty
uiopasdfghjklzxcvbnmqwertyuiopasdf
ghjklzxcvbnmqwertyuiopasdfghjklzxc
REM To develop a menu driven program with full modularity to accomplish the
mentioned tasks

REM to create a new data file, add more record, delete unnecessary records, edit,
display ledger with either total and percentage or with grade

CLS

above:

PRINT "Enter 1 to create a sequential access data file"

PRINT "Enter 2 to add new records"

PRINT "Enter 3 to delete unnecessary records"

PRINT "Enter 4 to edit"

PRINT "Enter 5 to display ledger with total and percentage"

PRINT "Enter 6 to display ledger with grade"

PRINT "Enter 7 to exit"

PRINT

PRINT

INPUT "What would you like to do?"; in

IF in = 1 THEN CALL create

IF in = 2 THEN CALL add

IF in = 3 THEN CALL delete

IF in = 4 THEN CALL edit

IF in = 5 THEN CALL disledtotper

IF in = 6 THEN CALL disledgrade


INPUT "Do you want to access modularity again(Y/N)"; yn$

IF UCASE$(yn$) = "Y" THEN GOTO above

END

SUB create

INPUT "Enter the file name"; f$

OPEN f$ FOR OUTPUT AS #1

top:

INPUT "Enter student's name"; s$

INPUT "Enter marks of English"; eng

INPUT "Enter marks of Nepali"; nep

INPUT "Enter marks of Science"; sci

INPUT "Enter marks of Mathematics"; mat

INPUT "Enter marks of Social Studies"; soc

WRITE #1, s$, eng, nep, sci, mat, soc

INPUT "Do you want to continue (Y/N)"; yn$

IF LCASE$(yn$) = "y" THEN GOTO top

CLOSE #1

END SUB

SUB add

INPUT "Enter the name of data file in which you want to add records"; f$

OPEN f$ FOR APPEND AS #1


top:

INPUT "Enter student's name"; s$

INPUT "Enter marks of English"; eng

INPUT "Enter marks of Nepali"; nep

INPUT "Enter marks of Science"; sci

INPUT "Enter marks of Mathematics"; mat

INPUT "Enter marks of Social Studies"; soc

WRITE #1, s$, eng, nep, sci, mat, soc

INPUT "Do you want to continue (Y/N)"; yn$

IF LCASE$(yn$) = "y" THEN GOTO top

CLOSE #1

END SUB

SUB delete

INPUT "Enter the name of data file in which you want to delete unnecessary records";
f$

OPEN f$ FOR INPUT AS #1

OPEN "Temp.txt" FOR OUTPUT AS #2

PRINT "Name", "English", "Nepali", "Science", "Maths", "Social Studies"

WHILE NOT EOF(1)

INPUT #1, s$, eng, nep, sci, mat, soc

PRINT s$, eng, nep, sci, mat, soc

INPUT "Do you want to delete the record (Y/N)"; yn$


IF LCASE$(yn$) <> "y" THEN WRITE #2, s$, eng, nep, sci, mat, soc

WEND

CLOSE #1, #2

KILL f$

NAME "Temp.txt" AS f$

END SUB

SUB edit

INPUT "Enter the name of data file in which you want to edit"; f$

OPEN f$ FOR INPUT AS #1

OPEN "Temp.txt" FOR OUTPUT AS #2

PRINT "Name", "English", "Nepali", "Science", "Maths", "Social Studies"

WHILE NOT EOF(1)

INPUT #1, s$, eng, nep, sci, mat, soc

PRINT s$, eng, nep, sci, mat, soc

INPUT "Do you want to edit the record (Y/N)"; yn$

IF LCASE$(yn$) = "y" THEN

INPUT "Enter new student's name"; s$

INPUT "Enter new marks of english"; eng

INPUT "Enter new marks of Nepali"; nep

INPUT "Enter new marks of Science"; sci

INPUT "Enter new marks of Maths"; mat

INPUT "Enter new marks of Social Studies"; soc


WRITE #2, s$, eng, nep, sci, mat, soc

END IF

WEND

CLOSE #1, #2

KILL f$

NAME "Temp.txt" AS f$

END SUB

SUB disledtotper

INPUT "Enter the name of data file whose ledger you want to display"; f$

OPEN f$ FOR INPUT AS #1

PRINT "Name", "English", "Nepali", "Science", "Maths", "Social Studies"

WHILE NOT EOF(1)

INPUT #1, s$, eng, nep, sci, mat, soc

PRINT s$, eng, nep, sci, mat, soc

total = eng + nep + sci + mat + soc

PRINT "The total marks is "; total; " and the total percentage is "; total / 5

WEND

CLOSE #1

END SUB

SUB disledgrade

INPUT "Enter the name of data file whose ledger you want to display"; f$
OPEN f$ FOR INPUT AS #1

PRINT "Name", "English", "Nepali", "Science", "Maths", "Social Studies"

WHILE NOT EOF(1)

INPUT #1, s$, eng, nep, sci, mat, soc

IF eng < 30 THEN eng$ = "E"

IF eng < 39.99 AND eng > 30 THEN eng$ = "D"

IF eng < 49.99 AND eng > 40 THEN eng$ = "C"

IF eng < 59.99 AND eng > 50 THEN eng$ = "C+"

IF eng < 69.99 AND eng > 60 THEN eng$ = "B"

IF eng < 79.99 AND eng > 70 THEN eng$ = "B+"

IF eng < 89.99 AND eng > 80 THEN eng$ = "A"

IF eng > 90 THEN eng$ = "A+"

IF nep < 30 THEN nep$ = "E"

IF nep < 39.99 AND nep > 30 THEN nep$ = "D"

IF nep < 49.99 AND nep > 40 THEN nep$ = "C"

IF nep < 59.99 AND nep > 50 THEN nep$ = "C+"

IF nep < 69.99 AND nep > 60 THEN nep$ = "B"

IF nep < 79.99 AND nep > 70 THEN nep$ = "B+"

IF nep < 89.99 AND nep > 80 THEN nep$ = "A"

IF nep > 90 THEN nep$ = "A+"

IF sci < 30 THEN sci$ = "E"


IF sci < 39.99 AND sci > 30 THEN sci$ = "D"

IF sci < 49.99 AND sci > 40 THEN sci$ = "C"

IF sci < 59.99 AND sci > 50 THEN sci$ = "C+"

IF sci < 69.99 AND sci > 60 THEN sci$ = "B"

IF sci < 79.99 AND sci > 70 THEN sci$ = "B+"

IF sci < 89.99 AND sci > 80 THEN sci$ = "A"

IF sci > 90 THEN sci$ = "A+"

IF mat < 30 THEN mat$ = "E"

IF mat < 39.99 AND mat > 30 THEN mat$ = "D"

IF mat < 49.99 AND mat > 40 THEN mat$ = "C"

IF mat < 59.99 AND mat > 50 THEN mat$ = "C+"

IF mat < 69.99 AND mat > 60 THEN mat$ = "B"

IF mat < 79.99 AND mat > 70 THEN mat$ = "B+"

IF mat < 89.99 AND mat > 80 THEN mat$ = "A"

IF mat > 90 THEN mat$ = "A+"

IF soc < 30 THEN soc$ = "E"

IF soc < 39.99 AND soc > 30 THEN soc$ = "D"

IF soc < 49.99 AND soc > 40 THEN soc$ = "C"

IF soc < 59.99 AND soc > 50 THEN soc$ = "C+"

IF soc < 69.99 AND soc > 60 THEN soc$ = "B"

IF soc < 79.99 AND soc > 70 THEN soc$ = "B+"


IF soc < 89.99 AND soc > 80 THEN soc$ = "A"

IF soc > 90 THEN soc$ = "A+"

PRINT s$, eng$, nep$, sci$, mat$, soc$

WEND

CLOSE #1

END SUB

You might also like