Professional Documents
Culture Documents
Group members:
Abhyudaya Man Singh
Rikesh Gautam
Pranay Govinda Amatya
This is to certify that content of this project entitled, “Vehicle Management System” is the bona
fide work submitted to the Department of Computer Science, Graded English Medium School
(GEMS) for consideration in partial fulfillment of the requirement of SEE, Nepal for the award
of a School Certificate.
The Original research work was carried out under my supervision in the academic year 2079.
Based on the declaration made by him/her/team, I recommend this project report for evaluation.
Remark: …………………………………………………………...................................................
Rikesh Gautam
2
Contents
Acknowledgment...........................................................................................................................1
Introduction................................................................................................................................... 2
Analysis.......................................................................................................................................... 3
Algorithm....................................................................................................................................... 4
Flowchart..................................................................................................................................... 14
Coding.......................................................................................................................................... 27
Output......................................................................................................................................... 97
Conclusion................................................................................................................................. 110
3
Acknowledgment
We would like to acknowledge and give our warmest thanks to our teacher Mr. Ibran
Ansari Sir who allowed us to carry out this project work. His guidance and advice helped us plan
and write our project. We also got to learn about various new commands thanks to him.
We would also like to thank our group members for working hard and completing the
project work on time. We would also like to thank them for helping us with different problems
We would also like to thank our parents for their continuous support and for providing
1
Introduction
The topic of the project work is “Vehicle Management System”. This program is based
on the menu-based program which can add, display, edit, search, delete and buy records. This
program shows the Name, Model, Company, Stock, and Price of the Vehicles. This program has
allowed us to flourish our knowledge in QBASIC and has given us completely new and useful
ideas in QBASIC. We have learned many other commands and statements that helped us
A data file that consists of data can be created in QBASIC to store data entered by the
user. According to the wish of the user, data can be added to the data file, and data from the
2
Analysis
Vehicle Management System is very important and applicable in real life. Along with
other sectors, computers have also entered the sector of buying and selling vehicles. So, Vehicle
Management Systems are used as they are easier, more accurate, and more reliant than
3
Algorithm
ADDING RECORDS
step 1: if variable num is not 0 then open "Veh.dat" file for input
step 2: while it is not end of file, read the following variables: sn,n$,m$,c$,s,p and assign value
of sn to num
DISPLAYING RECORDS
4
step 2: if page = 1 then go to step 3, if page = 2 then go to step 8 else print invalid and go to
step 1
step 5: print the headers, read the data and print them in different positions
step 11: read the data and print them in different positions if n is greater than 8
SEARCHING RECORDS
5
step 1: ask the symbol number to search (nsn)
6
step 5: read the data
SEARCH BY MODEL
7
step 9: if it is not end of file go to step 5 else go to step 9
SEARCH BY COMPANY
8
SEARCH BY PRICE
BUYING
step 2: ask user to enter the s.n of the vehicle they want to buy (bsn)
9
step 4: open "temp.dat" for output as 16
price(price)
step 15: WRITE sn, name$, model$, company$, stock, price in ouput file
10
step 20: if f=0 then go to step 21
EDITING
step 5: if esn=sn then go to step 6 else WRITE (11) sn, name$, model$, company$, stock, price
model(nmodel$),company(ncompany$),stock(nstock),price(price)
11
step 13: if f=0 then go to step 14 else print "records edited"
DELETING
step 6: if dsn<>sn then go to step 7 else WRITE (21), sn, d$, d$, d$, d$, 0
12
step 12: name the file "temp.dat" as "Veh.dat"
13
Flowchart
14
A
Ask user
what they
want to do
If add
record
B
If display
record
C
If edit
record
If delete
record
E
if search
record
F
if buy
vehicle
If quit
End
Else
Print
Invalid
15
B
Is num
<>0
Yes No
Input name$,
Is it the model$,
end of file company$,
stock and price
Write the
Yes No
values in
Veh.dat
num = num +
num = sn Ask user if
1
they want to
add more
records
B
No Yes
A
16
C
What page
to go to
1 2
r = 7, n = 0 r = 7, n = 0
Is it end of
Is it end of
file and n is
file and n is
not less than
less than 8
8
Yes No Yes No
17
D
Open "Veh.dat"
for input
Open "temp.dat"
for output
SN of
record to
edit (nsn)
Is it end
of file
Yes No
Read the
Close both files data from
"Veh.dat"
Remane Yes No
"temp.dat" as
"Veh.dat"
Write previous
f = f+ 1 data in
Is f = 0 "temp.dat"
Open
"temp.dat" for
output
SN of
record to
delete
(dsn)
Is it
end of
file
Yes No
Read the
Close both files data
from
"Veh.dat"
Delete
"Veh.dat"
Is esn
<> sn
Remane
"temp.dat" as
"Veh.dat" Yes No
Print
Print f = f+ 1
"Record
"Record
deleted
not
"
available"
A
19
F
SN H
Name I
Model J
Company K
L
Price
Print
Else
Invalid
20
H
Ask user SN
they want
to search
(nsn)
Open "Veh.dat"
for input
Print the
Headings
Is it end
of file
Yes No
Read the
Close the file data
Is nsn =
Is f 0?
sn
Yes No Yes No
Print
Print the
Record
records
not
found
r=r+2.9, f = f +
A
1a
21
I
Ask user
Name they
want to
search
(nname$)
Open "Veh.dat"
for input
Print the
Headings
Is it end
of file
Yes No
Read the
Close the file data
Is
Is f 0? nname$
= name$
Yes No Yes No
Print
Print the
Record not
records
found
22
A r=r+2.9, f = f + 1a
J
Ask user
Model they
want to
search
(nmodel$)
Open "Veh.dat"
for input
Print the
Headings
Is it end
of file
Yes No
Read the
Close the file data
Is
Is f 0? nmodel$
=
model$
Yes No Yes No
Print
Print the
Record
records
not found
23
A r=r+2.9, f = f + 1a
K
Ask user
Company they
want to
search
(ncompany$)
Print the
Headings
Is it end
of file
Yes No
Read the
Close the file data
Is
Is f 0? ncompan
y$ =
company
$
Yes No
Yes No
Print
Record
not found
Print the
records
24
A r=r+2.9, f = f + 1a
L
Ask user
upper and
lower price
limit (nup,
nlp)
Open "Veh.dat"
for input
Print the
Headings
Is it end
of file
Yes No
Read the
Close the file data
Is f 0? Is nlp <=
price AND
nup >= price
Yes No
Yes No
Print
Record
not found Print the
records
25
A
r=r+2.9, f = f + 1a
G
Ask user
the vehicle
to buy (bsn)
Open "Veh.dat"
for input
Open "temp.dat"
for ouput
Is it end
of file
Yes No
Read
the
data
Close both files
Is bsn
= sn
Yes No
Delete "Veh.dat"
Print
the data
Rename f=f+1
"temp.dat" as
"Veh.dat" Is
stock =
0
Is f =
0
Yes No
Write the
Print Confirm values in
Yes No Sorry, out "temp."
purchas
of stock e (y/n)
Print G
A
"Record Yes No
not
availabl Print
e" G
purchase
26 confirmed
stock =
stock -1
Coding
27
declare function load()
CLS
CALL welcome
CALL home
SUB home ()
CLS
SCREEN 12
COLOR 10
tlen = LEN(t$)
LOCATE 1, mid
PRINT t$
FOR k = 1 TO 80
PRINT "=";
28
NEXT k
choose:
DO
k$ = INKEY$
SELECT CASE k$
CASE "1"
SLEEP 1
PRINT load
pass:
CLS
29
LOCATE 1, mid
PRINT t$
LOCATE 10, 20
LOCATE 10, 31
INPUT "", p$
IF p$ = "iamadmin" THEN
CALL admin
ELSE
CLS
LOCATE 1, mid
PRINT t$
SLEEP 1
a=a+1
30
IF a = 5 THEN
LOCATE 12, (78 - LEN("Incorrect 5 times")) / 2: PRINT "Incorrect 5 times": LOCATE 13,
(78 - LEN("Press any key to return home")) / 2: PRINT "Press any key to return home"
SLEEP
CLS
CALL home
ELSE
GOTO pass
END IF
END IF
CASE "2"
SLEEP 1
PRINT load
CALL customer
CASE ELSE
31
GOTO choose
END SELECT
END SUB
SUB admin ()
admin2:
CLS
LOCATE 1, mid
PRINT t$
FOR k = 1 TO 80
PRINT "=";
NEXT k
32
PRINT "3. Search Vehicles Records"
choose:
DO
k$ = INKEY$
SELECT CASE k$
CASE "1"
SLEEP 1
33
CALL addVeh
GOTO admin2
CASE "2"
SLEEP 1
CALL display
GOTO admin2
CASE "3"
34
PRINT "x "
SLEEP 1
CALL search("admin")
CASE "4"
PRINT "x"
SLEEP 1
CALL edit
GOTO admin2
CASE "5"
35
PRINT "x "
SLEEP 1
CALL delete
GOTO admin2
CASE "6"
SLEEP 1
PRINT gobackask
IF quitask = 1 THEN
36
CLS
LOCATE 1, mid
PRINT t$
LOCATE 13, (78 - LEN("Thanks For Using This Program!")) / 2: PRINT "Thanks For Using
This Program!"
WHILE i <= 8
IF i MOD 2 = 0 THEN
COLOR 11
ELSE
COLOR 9
END IF
FOR k = 1 TO 30
NEXT k
FOR k = 8 TO 19
37
NEXT k
FOR k = 1 TO 30
NEXT k
i=i+1
SLEEP 1
WEND
GOTO admin2
END IF
CASE ELSE
GOTO choose
END SELECT
END SUB
SUB customer ()
customer2:
CLS
38
LOCATE 1, mid
PRINT t$
FOR k = 1 TO 80
PRINT "=";
NEXT k
choose:
DO
k$ = INKEY$
39
SELECT CASE k$
CASE "1"
SLEEP 1
CALL display
GOTO customer2
CASE "2"
SLEEP 1
CALL search("customer")
CASE "3"
40
LOCATE 7, 1: PRINT "x "
SLEEP 1
CALL buy
GOTO customer2
CASE "4"
SLEEP 1
PRINT gobackask
IF quitask = 1 THEN
CLS
LOCATE 1, mid
41
PRINT t$
LOCATE 13, (78 - LEN("Thanks For Using This Program!")) / 2: PRINT "Thanks For Using
This Program!"
WHILE i <= 8
IF i MOD 2 = 0 THEN
COLOR 11
ELSE
COLOR 9
END IF
FOR k = 1 TO 30
NEXT k
FOR k = 8 TO 19
NEXT k
FOR k = 1 TO 30
42
LOCATE 19, 8 + 2 * k: PRINT "[]";
NEXT k
i=i+1
SLEEP 1
WEND
GOTO customer2
END IF
CASE ELSE
GOTO choose
END SELECT
END SUB
SUB addVeh ()
43
num = sn
WEND
CLOSE #100
num = num + 1
END IF
c=0
DO
c=c+1
CLS
LOCATE 1, mid
PRINT t$
FOR k = 1 TO 80
PRINT "=";
NEXT k
44
INPUT "Vehicle Name: ", name$
num = num + 1
CLOSE #1
CLS
LOCATE 1, mid
PRINT t$
45
IF c = 1 THEN
ELSE
END IF
SLEEP 2
END SUB
SUB display ()
ask:
CLS
LOCATE 1, mid
PRINT t$
FOR k = 1 TO 80
PRINT "=";
NEXT k
46
INPUT "", page
PRINT load
IF page = 1 THEN
CLS
r=7
n=0
LOCATE 1, mid
PRINT t$
47
LINE (20, 90)-(615, 405), , B
LOCATE 5, 5
PRINT "SN"
LOCATE 5, 12
PRINT "Name"
LOCATE 5, 25
PRINT "Model"
LOCATE 5, 40
PRINT "Company"
LOCATE 5, 55
PRINT "Stock"
48
LINE (507.5, 50)-(615, 450), , B
LOCATE 5, 69
PRINT "Price$"
LOCATE r, 4
PRINT sn
LOCATE r, 10
PRINT LEFT$(name$, 9)
LOCATE r + 1, 10
ELSE
LOCATE r, 10
PRINT name$
END IF
49
LOCATE r, 21
LOCATE r + 1, 21
ELSE
LOCATE r + 1, 21
END IF
ELSE
LOCATE r, 21
PRINT model$
END IF
LOCATE r, 36
LOCATE r + 1, 36
50
PRINT "-" + RIGHT$(company$, LEN(company$) - 15)
ELSE
LOCATE r, 36
PRINT company$
END IF
LOCATE r, 55
PRINT stock
LOCATE r, 67
PRINT price
r = r + 2.9
n=n+1
WEND
CLOSE #2
CLS
r=7
51
LOCATE 1, mid
PRINT t$
LOCATE 5, 5
PRINT "SN"
LOCATE 5, 12
52
PRINT "Name"
LOCATE 5, 25
PRINT "Model"
LOCATE 5, 40
PRINT "Company"
LOCATE 5, 55
PRINT "Stock"
LOCATE 5, 69
PRINT "Price$"
IF sn > 8 THEN
LOCATE r, 4
53
PRINT sn
LOCATE r, 10
PRINT LEFT$(name$, 9)
LOCATE r + 1, 10
ELSE
LOCATE r, 10
PRINT name$
END IF
LOCATE r, 21
LOCATE r + 1, 21
ELSE
54
LOCATE r + 1, 21
END IF
ELSE
LOCATE r, 21
PRINT model$
END IF
LOCATE r, 36
LOCATE r + 1, 36
ELSE
LOCATE r, 36
PRINT company$
END IF
LOCATE r, 55
55
PRINT stock
LOCATE r, 67
PRINT price
c=c+1
r = r + 2.9
n=n+1
END IF
WEND
CLOSE #2
ELSE
PRINT "Invalid"
SLEEP 1
GOTO ask
END IF
SLEEP
CLS
LOCATE 1, mid
56
PRINT t$
COLOR 0
INPUT "", n$
COLOR 10
END SUB
search2:
CLS
LOCATE 1, mid
PRINT t$
FOR k = 1 TO 80
PRINT "=";
NEXT k
57
PRINT
ask:
DO
k$ = INKEY$
SELECT CASE k$
CASE "1"
58
PRINT "x "
SLEEP 1
CALL searchsn
GOTO search2
CASE "2"
SLEEP 1
CALL searchvn
GOTO search2
CASE "3"
59
PRINT "x "
SLEEP 1
CALL searchm
GOTO search2
CASE "4"
SLEEP 1
CALL searchc
GOTO search2
CASE "5"
60
LOCATE 6: PRINT "x "
SLEEP 1
CALL searchp
GOTO search2
CASE "b"
SLEEP 1
CALL admin
61
ELSEIF LCASE$(user$) = "customer" THEN
CALL customer
ELSE
CALL home
END IF
CASE ELSE
GOTO ask
END SELECT
END SUB
SUB edit ()
CLS
LOCATE 1, mid
PRINT t$
FOR k = 1 TO 80
PRINT "=";
NEXT k
62
PRINT
IF esn = sn THEN
f=f+1
63
ELSE
END IF
WEND
KILL "Veh.dat"
IF f = 0 THEN
LOCATE CSRLIN + 2, (78 - LEN("Record Not Found")) / 2: PRINT "Record Not Found"
SLEEP 1
ELSE
SLEEP 1
END IF
END SUB
SUB delete ()
d$ = "Deleted"
64
CLS
LOCATE 1, mid
PRINT t$
FOR k = 1 TO 80
PRINT "=";
NEXT k
ELSE
65
f=f+1
END IF
WEND
KILL "Veh.dat"
IF f = 0 THEN
LOCATE CSRLIN + 2, (78 - LEN("Record Not Found")) / 2: PRINT "Record Not Found"
SLEEP 1
ELSE
SLEEP 1
END IF
END SUB
SUB searchsn ()
CLS
66
LOCATE 1, mid
PRINT t$
PRINT load
CLS
r=7
n=0
LOCATE 1, mid
PRINT t$
67
LINE (20, 90)-(615, 315), , B
LOCATE 5, 5
PRINT "SN"
LOCATE 5, 12
PRINT "Name"
LOCATE 5, 25
PRINT "Model"
LOCATE 5, 40
PRINT "Company"
68
LOCATE 5, 55
PRINT "Stock"
LOCATE 5, 69
PRINT "Price$"
IF nsn = sn THEN
LOCATE r, 4: PRINT sn
r = r + 2.9
f=f+1
END IF
69
WEND
CLOSE #3
IF f = 0 THEN
CLS
LOCATE 1, mid
PRINT t$
FOR k = 1 TO 80
PRINT "=";
NEXT k
END IF
SLEEP
END SUB
SUB searchvn ()
70
CLS
LOCATE 1, mid
PRINT t$
PRINT load
CLS
r=7
n=0
LOCATE 1, mid
PRINT t$
71
LINE (20, 90)-(615, 270), , B
LOCATE 5, 5
PRINT "SN"
LOCATE 5, 12
PRINT "Name"
LOCATE 5, 25
PRINT "Model"
LOCATE 5, 40
PRINT "Company"
72
LINE (400, 50)-(507.5, 450), , B
LOCATE 5, 55
PRINT "Stock"
LOCATE 5, 69
PRINT "Price$"
LOCATE r, 4: PRINT sn
r = r + 2.9
f=f+1
73
END IF
WEND
CLOSE #4
IF f = 0 THEN
CLS
LOCATE 1, mid
PRINT t$
FOR k = 1 TO 80
PRINT "=";
NEXT k
END IF
SLEEP
END SUB
74
SUB searchm ()
CLS
LOCATE 1, mid
PRINT t$
PRINT load
CLS
r=7
n=0
LOCATE 1, mid
PRINT t$
75
LINE (20, 90)-(615, 225), , B
LOCATE 5, 5
PRINT "SN"
LOCATE 5, 12
PRINT "Name"
LOCATE 5, 25
PRINT "Model"
LOCATE 5, 40
76
PRINT "Company"
LOCATE 5, 55
PRINT "Stock"
LOCATE 5, 69
PRINT "Price$"
LOCATE r, 4: PRINT sn
r = r + 2.9
77
f=f+1
END IF
WEND
CLOSE #5
IF f = 0 THEN
CLS
LOCATE 1, mid
PRINT t$
FOR k = 1 TO 80
PRINT "=";
NEXT k
END IF
SLEEP
78
END SUB
SUB searchc ()
CLS
LOCATE 1, mid
PRINT t$
PRINT load
CLS
r=7
n=0
LOCATE 1, mid
PRINT t$
79
LINE (20, 90)-(615, 180), , B
LOCATE 5, 5
PRINT "SN"
LOCATE 5, 12
PRINT "Name"
LOCATE 5, 25
PRINT "Model"
80
LOCATE 5, 40
PRINT "Company"
LOCATE 5, 55
PRINT "Stock"
LOCATE 5, 69
PRINT "Price$"
LOCATE r, 4: PRINT sn
81
r = r + 2.9
f=f+1
END IF
WEND
CLOSE #6
IF f = 0 THEN
CLS
LOCATE 1, mid
PRINT t$
FOR k = 1 TO 80
PRINT "=";
NEXT k
END IF
82
SLEEP
END SUB
SUB searchp ()
CLS
LOCATE 1, mid
PRINT t$
FOR k = 1 TO 80
PRINT "=";
NEXT k
PRINT load
83
CLS
r=7
n=0
LOCATE 1, mid
PRINT t$
LOCATE 5, 5
84
PRINT "SN"
LOCATE 5, 12
PRINT "Name"
LOCATE 5, 25
PRINT "Model"
LOCATE 5, 40
PRINT "Company"
LOCATE 5, 55
PRINT "Stock"
LOCATE 5, 69
PRINT "Price$"
85
INPUT #7, sn, name$, model$, company$, stock, price
LOCATE r, 4: PRINT sn
r = r + 2.9
f=f+1
n=n+1
END IF
WEND
CLOSE #7
IF f = 0 THEN
CLS
LOCATE 1, mid
86
PRINT t$
FOR k = 1 TO 80
PRINT "=";
NEXT k
END IF
SLEEP
END SUB
SUB buy ()
buy2:
CLS
LOCATE 1, mid
PRINT t$
87
FOR k = 1 TO 80
PRINT "=";
NEXT k
IF bsn = sn THEN
f=f+1
88
PRINT
ELSE
CLS
LOCATE 1, mid
PRINT t$
FOR k = 1 TO 80
PRINT "=";
NEXT k
stock = stock - 1
89
ELSE
GOTO buy2
END IF
END IF
END IF
WEND
KILL "Veh.dat"
IF f = 0 THEN
CLS
LOCATE 1, mid
PRINT t$
FOR k = 1 TO 80
PRINT "=";
90
NEXT k
END IF
SLEEP
END SUB
SUB welcome ()
SCREEN 12
WHILE i <= 8
IF i MOD 2 = 0 THEN
COLOR 11
ELSE
COLOR 9
END IF
FOR k = 1 TO 30
91
LOCATE 8, 10 + 2 * k: PRINT "[]";
NEXT k
FOR k = 8 TO 19
NEXT k
FOR k = 1 TO 30
NEXT k
IF i MOD 2 = 0 THEN
c = 14
COLOR 10
ELSE
c = 10
COLOR 14
END IF
92
LINE (150, 175)-(400, 175), c
SLEEP 1
i=i+1
WEND
END SUB
FUNCTION load ()
93
CLS
LOCATE 1, mid
PRINT t$
c=0
DO WHILE c <> 1
SLEEP 1
CLS
SLEEP 1
CLS
SLEEP 1
CLS
94
LOCATE 1, mid: PRINT t$
SLEEP 1
CLS
SLEEP 1
CLS
SLEEP 1
CLS
c=c+1
LOOP
END FUNCTION
FUNCTION gobackask ()
95
CLS
LOCATE 1, mid
PRINT t$
q:
LOCATE 5, 39
quitask = 1
quitask = 0
ELSE
a$ = "Invalid Input"
GOTO q
END IF
96
END FUNCTION
Output
97
98
99
100
101
102
103
104
105
106
107
108
109
Conclusion
In this way, we were able to create a menu-driven program that can create a data file
and add records to it, search, edit and delete those records and it also has provision for the
Through this project, we learned about various new statements and commands. We also
learned to solve different problems that arose during the development of the program. This has
We also learned the importance of teamwork and hard work through this project along
with programming.
So, we would like once again to thank our teacher, Mr. Ibran Ansari sir for providing us
110