Create a data file named "record.txt" to store all the records of your grade
REM to create data file named "attendance.txt" to store all the records of your section.
OPEN "Attendance.txt" FOR OUTPUT AS #1
CLS
PRINT "********************************************************************************"
SLEEP 1
PRINT "**************************INNOVATIVE ENGLISH SCHOOL*****************************"
PRINT "**************************Shankhamul,Kathmandu,Nepal****************************"
SLEEP 1
PRINT "********************************#4782412, 4782422*******************************"
PRINT "**********************************ATTENDANCE************************************"
SLEEP 1
PRINT "************************************Grade:"; "10************************************"
PRINT "***********************************SECTION:"; "A2***********************************"
PRINT "********************************************************************************"
SLEEP 1
TOP:
INPUT "Enter first name of your students:"; fname$
INPUT "Enter middle name of your students:"; mname$
INPUT "Enter last name of your students:"; lname$
INPUT "Enter student's Roll Number:"; roll
BACK:
INPUT "Enter student's SEX(Male/Female):"; sex$
S$ = UCASE$(sex$)
IF S$ = "MALE" OR S$ = "FEMALE" THEN
ELSE
PRINT "Please enter the correct SEX(Gender) of your Student"
GOTO BACK
END IF
KING:
INPUT "Enter the HOUSE of student(BLUE/GREEN/RED/YELLOW):"; house$
R$ = UCASE$(house$)
IF R$ = "RED" OR R$ = "GREEN" OR R$ = "BLUE" OR R$ = "YELLOW" THEN
ELSE
PRINT "Please enter the correct HOUSE representation of your Student"
GOTO KING
END IF
INPUT "ENter student's address:"; addr$
SLEEP 1
PRINT "********************************************************************************"
SLEEP 1
PRINT "*********************COPYRIGHT ©BY: Innovative Eng. School**********************"
SLEEP 1
PRINT "***********************Developed By:Prince Kumar Kushwaha***********************"
SLEEP 1
PRINT "********************************************************************************"
SLEEP 1
WRITE #1, fname$, mname$, lname$, roll, sex$, addr$, house$
INPUT "Do you want to add more data(Y/N)?:"; p$
IF p$ = "Y" OR p$ = "y" THEN GOTO TOP
SLEEP 1
PRINT "********************************************************************************"
CLOSE #1
END
REM to search and display the records with first name
OPEN "attendance.txt" FOR INPUT AS #1
CLS
INPUT "enter first name of student for data searching:"; n$
WHILE NOT EOF(1)
INPUT #1, fname$, mname$, lname$, roll, sex$, house$, DOB$, addr$
IF n$ = fname$ THEN
PRINT "First name is:"; fname$, "Middle name is:"; mname$, "Surname is:"; lname$, "Roll Number is:"; roll, "Student gender is:"; sex$
PRINT "Student belongs to:"; house$, "Students date of birth is:"; DOB$, "Address is:"; addr$
END IF
WEND
CLOSE
END
REM to search and display the records along with Roll Number
OPEN "attendance.txt" FOR INPUT AS #1
CLS
INPUT "enter roll number of student for data searching:"; r
WHILE NOT EOF(1)
INPUT #1, fname$, mname$, lname$, roll, sex$, house$, DOB$, add
IF r = roll THEN
PRINT "First name is:"; fname$, "Middle name is:"; mname$, "Surname is:"; lname$, "Roll Number is:"; roll, "Student gender is:"; sex$
PRINT "Student belongs to:"; house$, "Students date of birth is:"; DOB$, "Address is:"; addr$
END IF
WEND
CLOSE
END
REM to search and display the records along with addresss
OPEN "attendance.txt" FOR INPUT AS #1
CLS
INPUT "enter Address of student for data searching:"; a$
WHILE NOT EOF(1)
INPUT #1, fname$, mname$, lname$, roll, sex$, house$, DOB$, add
IF a$ = addr$ THEN
PRINT "First name is:"; fname$, "Middle name is:"; mname$, "Surname is:"; lname$, "Roll Number is:"; roll, "Student gender is:"; sex$
PRINT "Student belongs to:"; house$, "Students date of birth is:"; DOB$, "Address is:"; addr$
END IF
WEND
CLOSE
END
No comments: