Responsive image
Responsive image

A  PROJECT WORK  IN QBASIC

 


ON
SLC RESULT PROCESSING SYSTEM
Submitted By:                              Roll No.
……….         .……..
……….         ………..

Submitted To:
……………..
Computer Department

Submission Date

 
PREFACE
This project work is done on the topic QBASIC under the guidance of our computer teacher, Mr……………... Doing this type of project work was a complete new experience for me as I have never done this type of project work in my school days. I have learnt many other new things besides our course related topic while doing this project work, like: copying and pasting the QBASIC program in the MS.Word. This was completely new for me and through this project; I have learnt to do it.

 This project is based on the menu driven program which has the facility to add new records, view records, modify records and delete records. This program displays the name, address and marks of the students. This program also has helped me to flourish my knowledge that I have in QBASIC and also has given me new ideas related to QBASIC.

 Finally, I would once again thank my teacher for giving us this project work and hope that our teacher would appreciate our hard work and hopefully it contains all the requirements.

Background of the Project
A data file that consists of data can be created in QBASIC in order to store data input by the user. So the user doesn’t need to enter the same data repeatedly. This project work is titled as “A Project Work In QBASIC on Result Processing of SLC Examination”. This project has a data file which stores name, roll number, marks of students, total, percent and division. This program has the facilities to add more records, search records, modify records and delete records. This program displays the name, roll number, total, percentage and division as the final output.

Aims and Objectives:

The aims and objectives of the project are as follows:

  • To provide concept of modular programming.
  • To handle large database properly.
  • To reduce manual errors.
  • To reduce the involvement of personal while preparing students record.
  • To search record or information conviently.

 

Structure of Program

  • Structure of Data File:

The “record.dat” data file is used in this project work. This “record.dat” data file contains fields like name, roll no, marks, total, percentage and division.

  • Algorithms:

Algorithm for Main Menu
Step 1: Start
Step 2: Declare required variables and procedure
Step 3: Display Main Menu having options:

  • Add Record
  • View Record
  • Search Record
  • Edit Record
  • Delete Record
  • Exit

Step 4: Stop

Flow Chart

 Flow Chart for Main Menu

Algorithm for Adding Records

Step 1: Start

Step 2: Declare variables

Step 3: Create a data file named “record.dat” in Append mode

Step 4: Get n (name of the student), r (roll no)   and M1, m2, m3, m4, m5, m6, m7, m8 (marks)  

Step 5: Store all the values of variables in the data File

Step 6: Does a user want to add more record?
[If “yes” then repeat step 3, 4, 5]
[If “no” then end]

           Step 7: Stop  

 Flowchart For adding Records:

                             
 Algorithm For Viewing Records

Step 1: Start

Step 2: Declare variables

Step 3: Open “record.dat” in input mode

Step 4: Retrieve data from the file and store them In n, r, m1, m2, m3, m4, m5, m6, m7, m8

Step 5: Display those data

Step 6: Is all records retrieved?
[If “yes” then end]
[If “no” then repeat steps 4 and 5]

Step 7: Stop  

 Flowchart for viewing Records:

 Algorithm for Searching Record:
Step 1: Start
Step 2: Declare variables
Step 3: Open the data in INPUT mode
Step 4: Do you want to search by name?
[Choice= name: go to step 5]
[Choice=phone number: go to step 9] 
Step 5: Read name (name to be search)
Step 6: Read n, p, tel,m1,m2,m3,m4,m5,m6,m7,m8       
Step 7: Is n=name?
[Yes: Display n, p, m1,m2,m3,m4,m5,m6
M7,m8,tel t, c]
Step 8: Is all records retrieved?
Step 12: Is all records retrieved?
[If No: Go to step 4]
Step 13: Is found=0?
[If yes: Display message as record not
Found]
Step 14: Stop

Flowchart for searching Record:

Algorithm for Editing Records:
Step 1: Start
Step 2: Declare variables
Step 3: Open “record.dat” in Input mode
Step 4: Open “marks.dat” in Output mode
Step 5: Read name
Step 6: Read n, r, t, p, d
Step 7: Is name=n?
[Yes: Accept n, p, m1,m2,m3,m4,m5,m6,m7,
M8 and Store them in “marks.dat”]
[No: store n, p,m1,m2,m3,m4,m5,m6,m7,
M8 in “record.dat”]
Step 8: Is all the record retrieved?
[No: Repeat step 7 and 8]
Step 9: Delete “record.dat”
Step 10: Change name of “marks.dat” to “record.dat”
Step 12: Stop

Flowchart for editing Record:
             

Algorithm for Deleting Record:
Step 1: Start

Step 2: Declare variable

Step 3: Open “record.dat” file in Input Mode

Step 4: Create “marks.dat” in Append mode

Step 5: Read name

Step 6: Read n, r,m1,m2,m3,m4,m5,m6,m7,m8

Step 8: Is name=n?
[No: Store values in “marks.dat” file]

Step 9: Are all records retrieved?
[No: Repeat step 7 and 8]

Step 10: Delete “record.dat”

Step 11: Change name “marks.dat” file as “record.dat”

Step 12: Stop

Flowchart for Deleting Record:

Program Coding

DECLARE SUB addRec ()
DECLARE SUB displayRec ()
DECLARE SUB searchRec ()
DECLARE SUB editRec ()
DECLARE SUB deleteRec ()
DO
CLS
PRINT
PRINT
PRINT
PRINT
PRINT , , "RESULT PROCESSING OF SLC EXAMINATION"
PRINT
PRINT , "1.Add Record"
PRINT
PRINT , "2.Display Record"
PRINT
PRINT , "3.Search Record"
PRINT
PRINT , "4.Edit Record"
PRINT
PRINT , "5.Delete Record"
PRINT
PRINT , "6.Exit"
PRINT
INPUT "enter your choice(1/2/3/4/5/6)"; ch
SELECT CASE ch
                  CASE 1
                                    CALL addRec
                  CASE 2
                                    CALL displayRec
                  CASE 3
                                    CALL searchRec
                  CASE 4
                                    CALL editRec
                  CASE 5
                                    CALL deleteRec
                  CASE 6
                  PRINT
                  PRINT "THANK YOU FOR USING THE PROGRAM :D"
                  EXIT DO
END SELECT
PRINT
PRINT "Press any key to continue"
a$ = INPUT$(1)
LOOP
END

SUB addRec
CLS
OPEN “record.dat” FOR APPEND AS #1
DO
                  INPUT “Enter students name”;n$
                  INPUT “Enter students rollno”;r
                  INPUT “Enter marks obtained in english”;m1
                  INPUT “Enter marks obtained in nepali”;m2
                  INPUT “Enter marks obtained in science”;m3
                  INPUT “Enter marks obtained in social studies”;m4
                  INPUT “Enter marks obtained in compulsory math”;m5
                  INPUT “Enter marks obtained in A. math”;m6
                  INPUT “Enter marks obtained in EPH”;m7
                  INPUT “Enter marks obtained in Computer”;m8
                  WRITE #1, n$,r,m1,m2,m3,m4,m5,m6,m7,m8
                  INPUT “Do you need more records(y/n)”;ch$
LOOP WHILE UCASE$(ch$)= “Y”
CLOSE
END SUB

SUB deleteRec
CLS
OPEN "record.dat" FOR INPUT AS #1
OPEN "marks.dat" FOR APPEND AS #2
f = 0
PRINT
INPUT "enter whose record you want to delete"; d$
DO UNTIL EOF(1)
                  INPUT #1, n$, r, m1, m2, m3, m4, m5, m6, m7, m8
                  IF n$ = d$ THEN
                                    f = f + 1
                  ELSE
                                    WRITE #2, n$, r, m1, m2, m3, m4, m5, m6, m7, m8
                  END IF
LOOP
CLOSE
KILL "record.dat"
NAME "marks.dat" AS "record.dat"
IF f = 0 THEN
                  PRINT "Record not found"
ELSE
                  PRINT "Record successfully deleted"
END IF
END SUB

SUB displayRec
CLS
OPEN “record.dat” FOR INPUT AS #1
PRINT “Name”;TAB(16); “RN”;TAB(20); “Eng”;TAB(24); “Nep”;TAB(28); “Sci”;TAB(32); “SOC”;TAB(36); “Cmath”;TAB(40); “A.math”;TAB(44); “EPH”;TAB(53); “Computer”;TAB(60); “Total”;TAB(70); “Percentage”
DO WHILE NOT EOF(1)
                  INPUT #1, , n$,r,m1,m2,m3,m4,m5,m6,m7,m8
                  t=m1+m2+m3+m4+m5+m6+m7+m8
                  P=t/8
                  PRINT  n$;TAB(16);r;TAB(20);m1;TAB(24);m2;TAB(28);m3;TAB(32);m4;TAB(36);m5;TAB(40); m6;TAB(44);m7;TAB(53);m8;TAB(60);t;TAB(70);p
LOOP
CLOSE
END SUB

SUB editRec
CLS
OPEN "marks.dat" FOR OUTPUT AS #1
OPEN "record.dat" FOR INPUT AS #2
f = 0
PRINT
INPUT "enter whose data to be edited"; e$
DO UNTIL EOF(2)
                  INPUT #2, n$, r, m1, m2, m3, m4, m5, m6, m7, m8
                  IF UCASE$(n$) = UCASE$(e$) THEN
                  PRINT n$, r, m1, m2, m3, m4, m5, m6, m7, m8
                  f = f + 1
                  PRINT "Name :"; n$
                  INPUT "do you want you modify(Y/N)"; ch$
                  IF UCASE$(ch$) = "Y" THEN
                   INPUT "Enter new name"; n$
                  END IF
                  PRINT "Roll No"; r
                  INPUT "do you want to change roll no(Y/N):"; ch$
                  IF UCASE$(ch$) = "Y" THEN
                   INPUT "enter roll no"; r
                  END IF
                  PRINT "Mark in english"; m1
                  INPUT "do you want to modify(Y/N)"; ch$
                  IF UCASE$(ch$) = "Y" THEN
                  INPUT "enter new marks in english"; m1
                  END IF
                  PRINT "marks in Nepali"; m2
                  INPUT "do you want to modify(Y/N)"; ch$
                   IF UCASE$(ch$) = "Y" THEN
                  INPUT "enter new marks in nepali"; m2
                  END IF
                  PRINT "marks in science"; m3
                  INPUT "do you want to modify(Y/N)"; ch$
                   IF UCASE$(ch$) = "Y" THEN
                  INPUT "enter new marks in Science"; m3
                   END IF
                  PRINT "marks in social studies"; m4
                   INPUT "do you want to modify(Y/N)"; ch$
                  IF UCASE$(ch$) = "Y" THEN
                  INPUT "enter new marks in Social Studies"; m4
                   END IF
                   PRINT "marks in c.maths"; m5
                   INPUT "do you want to modify(Y/N)"; ch$
                   IF UCASE$(ch$) = "Y" THEN
                  INPUT "enter new marks in C.Maths"; m5
                   END IF
                   PRINT "marks in a.maths"; m6
                  INPUT "do you want to modify(Y/N)"; ch$
                   IF UCASE$(ch$) = "Y" THEN
                  INPUT "enter new marks in A.Maths"; m6
                   END IF
                   PRINT "marks in EPH"; m7
                  INPUT "do you want to modify(Y/N)"; ch$
                   IF UCASE$(ch$) = "Y" THEN
                   INPUT "enter new marks in EPH"; m7
                   END IF
                   PRINT "marks in Computer"; m8
                  INPUT "do you want to modify(Y/N)"; ch$
                   IF UCASE$(ch$) = "Y" THEN
                   INPUT "enter new marks in Computer"; m8
                   END IF
                   WRITE #1, n$, r, m1, m2, m3, m4, m5, m6, m7, m8
                  END IF
LOOP
CLOSE
KILL "record.dat"
NAME "marks.dat" AS "record.dat"
IF f = 0 THEN
                  PRINT "Sorry, Record not found"
ELSE
                   PRINT "Record is Successfully Edited :) "
END IF
END SUB

SUB searchRec
CLS
OPEN “record.dat” FOR INPUT AS #1
Found=0
INPUT “Enter Student name to be searched ”;nam$
PRINT “Name”;TAB(16); “RN”;TAB(20); “Eng”;TAB(24); “Nep”;TAB(28); “Sci”;TAB(32); “SOC”;TAB(36); “Cmath”;TAB(40); “A.math”;TAB(44); “EPH”;TAB(53); “Computer”;TAB(60); “Total”;TAB(70); “Percentage”
DO WHILE NOT EOF(1)
                  INPUT #1, , n$,r,m1,m2,m3,m4,m5,m6,m7,m8
                  IF UCASE$(n$)=UCASE$(nam$) THEN
                                    PRINT  n$;TAB(16);r;TAB(20);m1;TAB(24);m2;TAB(28);m3;TAB(32);m4;TAB(36);m5;TAB(40); m6;TAB(44);m7;TAB(53);m8;TAB(60);t;TAB(70);p
                                    Found=1
                  END IF
LOOP
IF Found=0 THEN
                  PRINT “Record does not Exist! TRY AGAIN!!!!!!!!!!!”
ENDIF
CLOSE
END SUB



Post Your Comment Here