Project Work Based On Qbasic: Telephone Directory

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 69
At a glance
Powered by AI
The project describes a telephone directory program created in QBASIC that allows users to add, display, modify, delete and search contact records.

The purpose of the project is for the student to learn and apply concepts of modular programming and sequential data file management by creating a telephone directory program in QBASIC.

The project covers concepts of modular programming, sequential data file management, file handling, algorithms, flowcharts and coding in QBASIC.

Project Work

Based On QBASIC
Telephone Directory

[This is a project work based on high level


language QBASIC. In this project there is a
simple program made by a student of class
10A about telephone directory. The features
of the program are that it lets the user to add,
display, modify, delete and search for records.]

Arunima Higher Secondary


School
Department Of Computer
Boudha, Kumarigal
Submitted By:
Bishal Heuju
1/1/2010

Submitted To:
Ram K. Thapa

PREFACE
In today's world of science and technology computer has become
an integral part of everyone's life. Human life is more static existence with the
change in time and new discoveries in computer science. Advanced information,
processing technologies, global communication and internet have forced us to
remain wary of changes taking place in the world today.
They have a wide range in both the commercial and noncommercial fields it is used in engineering, industry, medicine, space, research,
education, banking, traveling, communication and industries. It can solve
problems using high technology including both sophisticated computer hardware
and software, high performance computing on heterogeneous way.
The last few decades of twentieth century have witnessed the
radical changes taking place, both in our lifestyle and computer technology
concomitantly. Rapid update in computer technology and development of new
versions of software has driven the world into new technical era. However, the
new versions of software have basically two distinct advantages. They are user
friendly and posses more facilities.
Qbasic is a high level computer program developed by
Microsoft Corporation. In 1985, Microsoft released their own versions of BASIC
called QBASIC with their MS-DOS.5.0 operating system in two files QBASIC.EXE
and QBASIC.HLP. Since then, PC also runs own copies. QBASIC environment
includes a full system syntax checking, multi-file and multi-window editing, full
debugging facilities, pull down menus syntax-checking editor and a power full
menu structures that can be driven through either by keyboard or a mouse. We
can edit, run, debug and return the program without switching programs in it.
My project is about Telephone Directory. It is provided with
various kinds of facilities such as adding, displaying, modifying, deleting and
searching the records. I have mentioned the aims and objectives of this project
work, its background, problems that have arise while making the program and
finally the output to show how the project looks like. I have also mentioned some
analyzing techniques like flowcharts and algorithm as well as the code source of
the program.

Thank You!!!
- Bishal Heuju

7
1

CONTENTS
Chapter Topic
Page
1.

Background of the project


4

2.

Aims and objectives


4

3.

Needs and assessment


5

4.

Problems during the project


5

5.

Analyzing the program


5

6.

Algorithm

7.

Flowchart
18

8.

Coding the solution


54

9.

Output using dummy


65

10. Conclusion
71

7
1

BACKGROUND OF THE PROJECT


A project is a set of activities that involve definite and well-defined
objectives with essential tasks to be performed to achieve the desired output. It
requires proper utilization of available resources makes us achieve our goal
within a specific frame of time.
This project work is based on modular programming and sequential
data file management. Modular programming is an approach in which the
program is divided into separate independent units, called modules to perform
specific task. Whereas the sequential data file management means a file that
must be accessed in a sequential order, staring at the beginning of the data
block and proceeding in order until and end-of-data marker is encouraged of the
required number of items has been read.
The prepared program made by me is called as "The Telephone
Directory" which is programmed to store the records including the name, phone
no., address and e-mail of many different peoples. The user using this program
can add as many records as he wants continuously. She/he can store the required
name, phone no., address and e-mail of different people. This program displays
the stored records in a systematic way. The user can display all records with
name, phone no., address and e-mails. This program also gives the user the
access to display thousands of records continuously.
This program also gives access to edit the stored records. She/he
can input the name to edit and can edit the name, phone no., address and e-mail
of the person. This program allows the user to edit thousands of records
continuously. Further it gives the facility to delete the stored records and search
for the required records.

7
1

AIMS AND OBJECTIVES


Every project has got its own aim to focus. The project without fixed
aim and definite objectives is worthless. Our objective decides our result. The
work done without fixed objective is only loss of time as we can't get good result
from it. Considering this fact I had made some aims and objectives of my project
work. These aims and objectives are listed below:
To provide a faster, better and reliable management to peoples records.
To create a technical outfield in all our work.
To prepare an easy system to handle our records.
To provide easy environment to create, display, erase, edit and search our
records.
To get knowledge about modular approach of programming and sequential
data file management system.
To develop concept about programming. This will help us in the
development of our creativity in a practical way.
To introduce the use of computer in every single work to provide a better
result.

NEEDS AND ASSESSMENT


Many things are required for good result of any work we do. Things
like assessment of the work and other different needs are required. To make
better project it should be planned and designed well. All the needs that I
required for the completion of this project are as follows:
Proper knowledge about Modular concept and File management system.
Proper guidance from the teachers to handle the program.
Guidance from the people who know well about computer programming.
Co-ordination and help from different friends.
Understanding the concept of flowchart and algorithm.
Sample project given in the book Innovative Computer Science, Book 10.

PROBLEMS DURING PROJECT


Nothing is perfect. Similarly the program that I have made is also
not so much perfect. I had to work really hard to make this program. While
making the program many problems arise. After some real hard work I managed
to solve the problems. The problems are as follows:
Designing the outline of the project was difficult.
Sub procedure went wrong.
Data modification was wrong.
The co-ordination while creating lines went wrong. So it consumed a lot of
time to correct it.

7
1

ANALYZING THE PROGRAM


It is concerned with the analysis of the component parts of a unit to
understand, describe and explain the particular phenomenon. As a researching
student, we must know the analysis in social and practical sciences.
A project must have definite objectives essential tasks to be
performed to achieve the desired output, proper utilization of available
resources, and proper analysis of the problem.
The population of the world is increasing day by day. Different
people have their own identity. There will be a very vast number of people. In
this condition the records about them are difficult to manage. Therefore, I have
developed a program for the management of their records. Since, there will be
more records of different people, the hand written items are nor organized and
systematic. Many problems are to be faced if the item record system is not
computerized.
The major problems of manual system are:The hand written item records are time consuming.
Records may be misplaced due to mishandling.
Difficulty due to constant work and expenditure.
Requires a lot of space to maintain different phone books containing
information about different people which cause high stationary cost. If
single page is lost there might be a great loss.
Requires a lot of papers to write the peoples records. We can't modify or
erase the records in proper way we like.
Computerizing the item record is not an easy task. First we have to
note the problems with the present manual system. After that we should think
about the advantages of computerized system. For the better program we have
to think about many facilities that can be provided by the program. The more
facility we provide, the more efficient and effective the program will be and same
facilities are provided by this program. They are as follows:We can add as many records as we like.
We can display the stored records in different format.
We can make changes or edit the stored record as we like.
We can delete as many records as we like.
We can search for the required record.
Since, it is a menu based program we can do any specific task from the
provided menu.
By focusing to provide these facilities first algorithm is made. Then
by the help of that algorithm, flowchart is made. And at last the program is
completed. The prepared program should be checked properly before putting the
program into practice.
Although the computerized system gives many facilities they have
similar disadvantages. They are as follows:People need at least simple knowledge about the computer.
Proper maintenance is required to run the program.
7
1

Excessive expenditure is required for changing a manual program into


computerized one.

ALGORITHM:
Entrance:
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:

DECLARE SUB DISPLAY ()


DECLARE SUB MENU ()
DECLARE SUB SEARCH ()
DECLARE SUB DELETE ()
DECLARE SUB MODIFY ()
DECLARE SUB ADD1 ()
DECLARE SUB LOAD ()
DECLARE SUB CREDIT ()
CLS
SCREEN 9
PRINT "Press any key to continue"
continue$ = INPUT$(1)
COLOR 2, 8: LOCATE 12, 24: PRINT "LOADING"
FOR A = 32 TO 35
LOCATE 12, A: PRINT "."
NEXT A
COLOR 10: LINE (200, 200)-(340, 220), , B
LOCATE 14, 24: PRINT "PLEASE WAIT"
A = 201
FOR B = 1 TO 70
COLOR 2: LINE (A, 201)-(A, 218)
A=A+2
FOR C = 1 TO 100000
NEXT C
NEXT B
CALL MENU
END

28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:

SUB ADD1
WHILE NOT UCASE$(choice$) = "N"
OPEN "bishal.dat" FOR APPEND AS #1
CLS
SCREEN 9
COLOR 2, 8
FOR A = 15 TO 602
LINE (15, 16)-(602, 16), 13, BF
LINE (20, 21)-(597, 21), 13, BF
NEXT
FOR B = 1 TO 1000000
NEXT
PLAY "l32o2cdegab"
FOR A = 15 TO 602
LINE (15, 300)-(602, 300), 13, BF

Add:
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step

7
1

Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step

43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:

LINE (20, 295)-(597, 295), 13, BF


NEXT
FOR B = 1 TO 1000000
NEXT
PLAY ">cdefgab"
LINE (14, 16)-(14, 300), 13, BF
LINE (19, 21)-(19, 295), 13, BF
PLAY "l32o2>cdefgab"
LINE (602, 16)-(602, 300), 13, BF
LINE (597, 21)-(597, 295), 13, BF
PLAY ">cdefgab"

Step 54: LOCATE 4, 20: PRINT "Inserting the information"


Step 55: LOCATE 6, 5: INPUT "Code number"; npcode
Step 56: OPEN "bishal.dat" FOR INPUT AS #3
Step 57: WHILE NOT EOF(3)
Step 58:
INPUT #3, pcode
Step 59:
IF npcode = pcode THEN
Step 60:
BEEP
Step 61:
LOCATE 7, 7: PRINT "Code already exists"
Step 62:
LOCATE 8, 7: PRINT "Record not added"
Step 63:
CLOSE #3
Step 64:
GOTO last99
Step 65:
END IF
Step 66: WEND
Step 67: CLOSE #3
Step 68: pcode = npcode
Step 69: LOCATE 7, 5: INPUT "Full name "; pname$
Step 70: LOCATE 8, 5: INPUT "Telephone "; tel$
Step 71: LOCATE 9, 5: INPUT "Address "; add$
Step 72: LOCATE 10, 5: INPUT "E-mail "; email$
Step 73: WRITE #1, pcode, pname$, tel$, add$, email$
Step 74: last99:
Step 75: CLOSE #1
Step 76: LOCATE 15, 5: INPUT "Do you want to add more record(y/n)";
choice$
Step 77: WEND
Step 78: CALL MENU
Step 79: END SUB

Credit:
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step

80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:

SUB CREDIT
CLS
DO
COLOR F
F=F+1
IF F > 14 THEN F = 1
I$ = INKEY$
LOCATE 7, 25: PRINT "Thanks For Choosing My Program"
LOCATE 8, 25: PRINT "Copyright (c) 2009"
LOCATE 10, 25: PRINT "By Bishal Heuju"
LOOP WHILE I$ = ""
LOCATE 13, 30

7
1

Step
Step
Step
Step
Step
Step
Step

92:
93:
94:
95:
96:
97:
98:

A$ = "Exiting...."
FOR B = 2 TO LEN(A$) + 1
FOR C = 1 TO 1000000: NEXT C
COLOR B: PRINT MID$(A$, B - 1, 1);
NEXT B
PLAY "o3 L8 E D+ E D+ E o2 B o3 D C L2 o2 A"
END SUB

Delete:
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step

99: SUB DELETE


100:top:
101:CLS
102:SCREEN 9
103:COLOR 2, 8
104:FOR A = 15 TO 602
105:LINE (15, 16)-(602, 16), 13, BF
106:LINE (20, 21)-(597, 21), 13, BF
107:NEXT
108:FOR B = 1 TO 1000000
109:NEXT
110:PLAY "l32o2cdegab"
111:FOR A = 15 TO 602
112:LINE (15, 300)-(602, 300), 13, BF
113:LINE (20, 295)-(597, 295), 13, BF
114:NEXT
115:FOR B = 1 TO 1000000
116:NEXT
117:PLAY ">cdefgab"
118:LINE (14, 16)-(14, 300), 13, BF
119:LINE (19, 21)-(19, 295), 13, BF
120:PLAY "l32o2>cdefgab"
121:LINE (602, 16)-(602, 300), 13, BF
122:LINE (597, 21)-(597, 295), 13, BF
123:PLAY ">cdefgab"
124:OPEN "bishal.dat" FOR INPUT AS #1
125:OPEN "temp.dat" FOR OUTPUT AS #2
126:tem = 0
127:top55:
128:LOCATE 3, 5: PRINT "What do you want to delete records by?"
129:LOCATE 4, 5: PRINT "1. Code No."
130:LOCATE 5, 5: PRINT "2. Name"
131:LOCATE 6, 5: PRINT "3. Telephone"
132:LOCATE 7, 5: PRINT "4. Address"
133:LOCATE 8, 5: PRINT "5. E-mail"
134:LOCATE 9, 5: INPUT "Enter your choice"; ch
135:SELECT CASE ch
136:CASE 1
137:
LOCATE 11, 5: INPUT "Enter the code no."; ncode
138:
WHILE NOT EOF(1)
139:
INPUT #1, pcode, pname$, tel$, add$, email$
140:
IF ncode = pcode THEN
141:
LOCATE 12, 5: PRINT "Record is deleted"
142:
LOCATE 13, 5: PRINT TIME$

7
1

Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step

143:
tem = 1
144:
PRINT
145:
ELSE
146:
WRITE #2, pcode, pname$, tel$, add$, email$
147:
END IF
148:
WEND
149:CASE 2
150:
LOCATE 11, 5: INPUT "Enter the name"; nname$
151:
WHILE NOT EOF(1)
152:
INPUT #1, pcode, pname$, tel$, add$, email$
153:
IF nname$ = pname$ THEN
154:
LOCATE 12, 5: PRINT "Record is deleted"
155:
LOCATE 13, 5: PRINT TIME$
156:
tem = 1
157:
PRINT
158:
ELSE
159:
WRITE #2, pcode, pname$, tel$, add$, email$
160:
END IF
161:
WEND
162:CASE 3
163:
LOCATE 11, 5: INPUT "Enter the telephone"; ntel$
164:
WHILE NOT EOF(1)
165:
INPUT #1, pcode, pname$, tel$, add$, email$
166:
IF ntel$ = tel$ THEN
167:
LOCATE 12, 5: PRINT "Record is deleted"
168:
LOCATE 13, 5: PRINT TIME$
169:
tem = 1
170:
PRINT
171:
ELSE
172:
WRITE #2, pcode, pname$, tel$, add$, email$
173:
END IF
174:
WEND
175:CASE 4
176:
LOCATE 11, 5: INPUT "Enter the address"; nadd$
177:
WHILE NOT EOF(1)
178:
INPUT #1, pcode, pname$, tel$, add$, email$
179:
IF nadd$ = add$ THEN
180:
LOCATE 12, 5: PRINT "Record is deleted"
181:
LOCATE 13, 5: PRINT TIME$
182:
tem = 1
183:
PRINT
184:
ELSE
185:
WRITE #2, pcode, pname$, tel$, add$, email$
186:
END IF
187:
WEND
188:CASE 5
189:
LOCATE 11, 5: INPUT "Enter the email"; nemail$
190:
WHILE NOT EOF(1)
191:
INPUT #1, pcode, pname$, tel$, add$, email$
192:
IF nemail$ = email$ THEN
193:
LOCATE 12, 5: PRINT "Record is deleted"
194:
LOCATE 13, 5: PRINT TIME$
195:
tem = 1
196:
PRINT
197:
ELSE
7
1

Step 198:
WRITE #2, pcode, pname$, tel$, add$, email$
Step 199:
END IF
Step 200:
WEND
Step 201:CASE ELSE
Step 202:
LOCATE 19, 5: PRINT "Invalid input"
Step 203:
new$ = INPUT$(1)
Step 204:
GOTO top55
Step 205:END SELECT
Step 206:IF tem = 0 THEN
Step 207:BEEP
Step 208:LOCATE 20, 5: PRINT "Record not found"
Step 209:END IF
Step 210:CLOSE #1
Step 211:CLOSE #2
Step 212:KILL "bishal.dat"
Step 213:NAME "temp.dat" AS "bishal.dat"
Step 214:LOCATE 24, 5: INPUT "Do you want to delete more records (y/n)";
del$
Step 215:y/n)"; del$
Step 216:IF UCASE$(del$) = "Y" THEN GOTO top
Step 217:CALL DISPLAY
Step 218:END SUB

Dispaly:
Step 219:SUB DISPLAY
Step 220:CALL LOAD
Step 221:OPEN "bishal.dat" FOR INPUT AS #1
Step 222:first:
Step 223:ct = 4
Step 224:CLS
Step 225:LOCATE 2, 1: PRINT "Code"
Step 226:LOCATE 2, 6: PRINT "Full Name"
Step 227:LOCATE 2, 25: PRINT "Telephone"
Step 228:LOCATE 2, 37: PRINT "Address"
Step 229:LOCATE 2, 50: PRINT "E-mail"
Step 230:PRINT STRING$(80, "-")
Step 231:WHILE NOT EOF(1)
Step 232:
INPUT #1, pcode, pname$, tel$, add$, email$
Step 233:
LOCATE ct, 1: PRINT pcode
Step 234:
LOCATE ct, 6: PRINT pname$
Step 235:
LOCATE ct, 25: PRINT tel$
Step 236:
LOCATE ct, 37: PRINT add$
Step 237:
LOCATE ct, 50: PRINT email$
Step 238:
ct = ct + 1
Step 239:
IF ct >= 23 THEN LOCATE 24, 15: PRINT "Press any key to view
next records": C$ = INPUT$(1): GOTO first
Step 240:WEND
Step 241:CLOSE #1
Step 242:LOCATE 25, 15: PRINT "Press any key to goto main menu"
Step 243:main$ = INPUT$(1)
Step 244:CALL MENU
Step 245:END SUB

7
1

Load:
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step

246:SUB LOAD
247:CLS
248:SCREEN 9
249:COLOR 2, 8: LOCATE 12, 24: PRINT "SEARCHING...."
250:COLOR 10: LINE (200, 200)-(340, 220), , B
251:LOCATE 14, 24: PRINT "PLEASE WAIT"
252:A = 201
253:FOR B = 1 TO 70
254:COLOR 2: LINE (A, 201)-(A, 218)
255:A = A + 2
256:FOR C = 1 TO 100000
257:NEXT C
258:NEXT B
259:END SUB

Menu:
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step

260:SUB MENU
261:CLS
262:SCREEN 9
263:COLOR 2, 8
264:FOR A = 15 TO 602
265:LINE (15, 16)-(602, 16), 13, BF
266:LINE (20, 21)-(597, 21), 13, BF
267:NEXT
268:FOR B = 1 TO 1000000
269:NEXT
270:PLAY "l32o2cdefgab"
271:FOR A = 15 TO 602
272:LINE (15, 300)-(602, 300), 13, BF
273:LINE (20, 295)-(597, 295), 13, BF
274:NEXT
275:FOR B = 1 TO 1000000
276:NEXT
277:PLAY ">cdefgab"
278:LINE (14, 16)-(14, 300), 13, BF
279:LINE (19, 21)-(19, 295), 13, BF
280:PLAY "l32o2>cdefgab"
281:LINE (602, 16)-(602, 300), 13, BF
282:LINE (597, 21)-(597, 295), 13, BF
283:PLAY ">cdefgab"
284:LOCATE 4, 5: PRINT "Date = "; DATE$
285:LOCATE 4, 55: PRINT "Time = "; TIME$
286:LOCATE 6, 25: PRINT "Telephone Directory"
287:LOCATE 7, 25: PRINT "===================="
288:LOCATE 9, 25: PRINT "1. Add Records"
289:LOCATE 10, 25: PRINT "2. Display All Records"
290:LOCATE 11, 25: PRINT "3. Modify Record"
7
1

Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step

291:LOCATE 12, 25: PRINT


292:LOCATE 13, 25: PRINT
293:LOCATE 14, 25: PRINT
294:LOCATE 16, 25: PRINT
295:ch$ = INPUT$(1)
296:CLS
297:SELECT CASE ch$
298:CASE "1"
299:CALL ADD1
300:CASE "2"
301:CALL DISPLAY
302:CASE "3"
303:CALL MODIFY
304:CASE "4"
305:CALL DELETE
306:CASE "5"
307:CALL SEARCH
308:CASE ELSE
309:CALL CREDIT
310:END SELECT
311:END SUB

"4. Delete Record"


"5. Search Record"
"6. Exit"
"Enter the choice (1-6)"

Modify:
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step

312:SUB MODIFY
313:OPEN "i", #1, "bishal.dat"
314:OPEN "o", #2, "temp.dat"
315:top2:
316:CLS
317:SCREEN 9
318:COLOR 2, 8
319:FOR A = 15 TO 602
320:LINE (15, 16)-(602, 16), 13, BF
321:LINE (20, 21)-(597, 21), 13, BF
322:NEXT
323:FOR B = 1 TO 1000000
324:NEXT
325:PLAY "l32o2cdefgab"
326:FOR A = 15 TO 602
327:LINE (15, 300)-(602, 300), 13, BF
328:LINE (20, 295)-(597, 295), 13, BF
329:NEXT
330:FOR B = 1 TO 1000000
331:NEXT
332:PLAY ">cdefgab"
333:LINE (14, 16)-(14, 300), 13, BF
334:LINE (19, 21)-(19, 295), 13, BF
335:PLAY "l32o2>cdefgab"
336:LINE (602, 16)-(602, 300), 13, BF
337:LINE (597, 21)-(597, 295), 13, BF
338:PLAY ">cdefgab"

Step 339:OPEN "i", #1, "bishal.dat"


Step 340:OPEN "o", #2, "temp.dat"

7
1

Step 341:tem = 0
Step 342:LOCATE 3, 5: INPUT "Enter the name"; nname$
Step 343:WHILE NOT EOF(1)
Step 344:INPUT #1, pcode, pname$, tel$, add$, email$
Step 345:IF (nname$ = pname$) THEN
Step 346:LOCATE 6, 5: PRINT "Press C to change information"
Step 347:LOCATE 8, 5: PRINT "Code number = "; pcode
Step 348:d$ = INPUT$(1)
Step 349:IF UCASE$(d$) = "C" THEN
Step 350:LOCATE 8, 35: INPUT "Enter new code number"; pcode
Step 351:END IF
Step 352:LOCATE 9, 5: PRINT "Name
= "; pname$
Step 353:d$ = INPUT$(1)
Step 354:IF UCASE$(d$) = "C" THEN
Step 355:LOCATE 9, 35: INPUT "Enter new name"; pname$
Step 356:END IF
Step 357:LOCATE 10, 5: PRINT "Telephone = "; tel$
Step 358:d$ = INPUT$(1)
Step 359:IF UCASE$(d$) = "C" THEN
Step 360:LOCATE 10, 35: INPUT "Enter new telephone"; tel$
Step 361:END IF
Step 362:LOCATE 11, 5: PRINT "Address
= "; add$
Step 363:d$ = INPUT$(1)
Step 364:IF UCASE$(d$) = "C" THEN
Step 365:LOCATE 11, 35: INPUT "Enter new address"; add$
Step 366:END IF
Step 367:LOCATE 12, 5: PRINT "E-mail
= "; email$
Step 368:d$ = INPUT$(1)
Step 369:IF UCASE$(d$) = "C" THEN
Step 370:LOCATE 12, 35: INPUT "Enter new e-mail"; email$
Step 371:END IF
Step 372:WRITE #2, pcode, pname$, tel$, add$, email$
Step 373:LOCATE 14, 5: PRINT "Record modified successfully"
Step 374:LOCATE 15, 5: PRINT TIME$
Step 375:LOCATE 16, 20: PRINT "New code number = "; pcode
Step 376:LOCATE 17, 20: PRINT "New name
= "; pname$
Step 377:LOCATE 18, 20: PRINT "New telephone = "; tel$
Step 378:LOCATE 19, 20: PRINT "New address
= "; add$
Step 379:LOCATE 20, 20: PRINT "New e-mail
= "; email$
Step 380:tem = 1
Step 381:ELSE
Step 382:WRITE #2, pcode, pname$, tel$, add$, email$
Step 383:END IF
Step 384:WEND
Step 385:CLOSE #1
Step 386:CLOSE #2
Step 387:KILL "bishal.dat"
Step 388:NAME "temp.dat" AS "bishal.dat"
Step 389:IF tem = 0 THEN
Step 390:BEEP
Step 391:LOCATE 20, 5: PRINT "Record not found"
Step 392:END IF
Step 393:LOCATE 23, 15: INPUT "Do you want to modify more records(y/n)";
modif$
7
1

Step 394:IF UCASE$(modif$) = "Y" THEN GOTO top2


Step 395:CALL MENU
Step 396:END SUB

Search:
Step 397:SUB SEARCH
Step 398:top1:
Step 399:CLS
Step 400:SCREEN 9
Step 401:COLOR 2, 8
Step 402:FOR A = 15 TO 602
Step 403:LINE (15, 16)-(602, 16), 13, BF
Step 404:LINE (20, 21)-(597, 21), 13, BF
Step 405:NEXT
Step 406:FOR B = 1 TO 1000000
Step 407:NEXT
Step 408:PLAY "l32o2cdegab"
Step 409:FOR A = 15 TO 602
Step 410:LINE (15, 300)-(602, 300), 13, BF
Step 411:LINE (20, 295)-(597, 295), 13, BF
Step 412:NEXT
Step 413:FOR B = 1 TO 1000000
Step 414:NEXT
Step 415:PLAY ">cdefgab"
Step 416:LINE (14, 16)-(14, 300), 13, BF
Step 417:LINE (19, 21)-(19, 295), 13, BF
Step 418:PLAY "l32o2>cdefgab"
Step 419:LINE (602, 16)-(602, 300), 13, BF
Step 420:LINE (597, 21)-(597, 295), 13, BF
Step 421:PLAY ">cdefgab"
Step 422:tem = 0
Step 423:OPEN "i", #1, "bishal.dat"
LOCATE 3, 5: PRINT "What do you want to search the information by?"
Step 424:LOCATE 4, 5: PRINT "1. Code number"
Step 425:LOCATE 5, 5: PRINT "2. Name"
Step 426:LOCATE 6, 5: PRINT "3. Telephone"
Step 427:LOCATE 7, 5: PRINT "4. Address"
Step 428:LOCATE 8, 5: PRINT "5. E-mail"
Step 429:LOCATE 9, 5: INPUT "Enter your choice (1-5)"; choi
Step 430:SELECT CASE choi
Step 431:CASE 1
Step 432:
LOCATE 11, 5: INPUT "Enter the code number"; ncode
Step 433:
ct = 4
Step 434:
CALL LOAD
Step 435:
CLS
Step 436:
WHILE NOT EOF(1)
Step 437:
INPUT #1, pcode, pname$, tel$, add$, email$
Step 438:
IF ncode = pcode THEN
Step 439:
CLS
Step 440:
LOCATE 2, 1: PRINT "Code"
Step 441:
LOCATE 2, 6: PRINT "Full Name"
Step 442:
LOCATE 2, 25: PRINT "Telephone"
Step 443:
LOCATE 2, 37: PRINT "Address"

7
1

Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step

444:
LOCATE 2, 50: PRINT "E-mail"
445:
PRINT STRING$(80, "-")
446:
LOCATE ct, 1: PRINT pcode
447:
LOCATE ct, 6: PRINT pname$
448:
LOCATE ct, 25: PRINT tel$
449:
LOCATE ct, 37: PRINT add$
450:
LOCATE ct, 50: PRINT email$
451:
ct = ct + 1
452:
tem = 1
453:
END IF
454:
WEND
455:CASE 2
456:
ct = 4
457:
LOCATE 3, 5: INPUT "Enter the name"; nname$
458:
CALL LOAD
459:
CLS
460:
WHILE NOT EOF(1)
461:
INPUT #1, pcode, pname$, tel$, add$, email$
462:
IF UCASE$(nname$) = UCASE$(pname$) THEN
463:
CLS
464:
LOCATE 2, 1: PRINT "Code"
465:
LOCATE 2, 6: PRINT "Full Name"
466:
LOCATE 2, 25: PRINT "Telephone"
467:
LOCATE 2, 37: PRINT "Address"
468:
LOCATE 2, 50: PRINT "E-mail"
469:
PRINT STRING$(80, "-")
470:
LOCATE ct, 1: PRINT pcode
471:
LOCATE ct, 6: PRINT pname$
472:
LOCATE ct, 25: PRINT tel$
473:
LOCATE ct, 37: PRINT add$
474:
LOCATE ct, 50: PRINT email$
475:
ct = ct + 1
476:
tem = 1
477:
END IF
478:
WEND
479:CASE 3
480:
ct = 4
481:
LOCATE 11, 5: INPUT "Enter the telephone"; ntel$
482:
CALL LOAD
483:
CLS
484:
WHILE NOT EOF(1)
485:
INPUT #1, pcode, pname$, tel$, add$, email$
486:
IF ntel$ = tel$ THEN
487:
CLS
488:
LOCATE 2, 1: PRINT "Code"
489:
LOCATE 2, 6: PRINT "Full Name"
490:
LOCATE 2, 25: PRINT "Telephone"
491:
LOCATE 2, 37: PRINT "Address"
492:
LOCATE 2, 50: PRINT "E-mail"
493:
PRINT STRING$(80, "-")
494:
LOCATE ct, 1: PRINT pcode
495:
LOCATE ct, 6: PRINT pname$
496:
LOCATE ct, 25: PRINT tel$
497:
LOCATE ct, 37: PRINT add$
498:
LOCATE ct, 50: PRINT email$
7
1

Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step
Step

499:
ct = ct + 1
500:
tem = 1
501:
END IF
502:
WEND
503:CASE 4
504:
ct = 4
505:
LOCATE 11, 5: INPUT "Enter the address"; nadd$
506:
CALL LOAD
507:
CLS
508:
WHILE NOT EOF(1)
509:
INPUT #1, pcode, pname$, tel$, add$, email$
510:
IF UCASE$(nadd$) = UCASE$(add$) THEN
511:
LOCATE 2, 1: PRINT "Code"
512:
LOCATE 2, 6: PRINT "Full Name"
513:
LOCATE 2, 25: PRINT "Telephone"
514:
LOCATE 2, 37: PRINT "Address"
515:
LOCATE 2, 50: PRINT "E-mail"
516:
PRINT STRING$(80, "-")
517:
LOCATE ct, 1: PRINT pcode
518:
LOCATE ct, 6: PRINT pname$
519:
LOCATE ct, 25: PRINT tel$
520:
LOCATE ct, 37: PRINT add$
521:
LOCATE ct, 50: PRINT email$
522:
ct = ct + 1
523:
tem = 1
524:
END IF
525:
WEND
526:CASE 5
527:
ct = 4
528:
LOCATE 11, 5: INPUT "Enter the email"; nemail$
529:
CALL LOAD
530:
CLS
531:
WHILE NOT EOF(1)
532:
INPUT #1, pcode, pname$, tel$, add$, email$
533:
IF UCASE$(nemail$) = UCASE$(email$) THEN
534:
CLS
535:
LOCATE 2, 1: PRINT "Code"
536:
LOCATE 2, 6: PRINT "Full Name"
537:
LOCATE 2, 25: PRINT "Telephone"
538:
LOCATE 2, 37: PRINT "Address"
539:
LOCATE 2, 50: PRINT "E-mail"
540:
PRINT STRING$(80, "-")
541:
LOCATE ct, 1: PRINT pcode
542:
LOCATE ct, 6: PRINT pname$
543:
LOCATE ct, 25: PRINT tel$
544:
LOCATE ct, 37: PRINT add$
545:
LOCATE ct, 50: PRINT email$
546:
ct = ct + 1
547:
tem = 1
548:
END IF
549:
WEND
550:END SELECT
551:IF tem = 0 THEN
552:BEEP
553:LOCATE 10, 15: PRINT "Record not found"
7
1

Step 554:END IF
Step 555:CLOSE #1
Step 556:LOCATE 25, 10: INPUT "Do you want to search more records(y/n)";
sea$
Step 557:IF UCASE$(sea$) = "Y" THEN GOTO top1 ELSE CALL MENU
Step 558:END SUB

PROGRAM FLOWCHART:
Main:
START

DECLARE SUB DISPLAY ()


DECLARE SUB MENU ()
DECLARE SUB SEARCH ()

DECLARE SUB DELETE ()


DECLARE SUB MODIFY ()

DECLARE SUB ADD1 ()

DECLARE SUB LOAD ()

DECLARE SUB CREDIT ()

PRINT Press any key to continue

continue$=INPUT$(
1)
PRINT LOADING

C
1

7
1

C
1
FOR A= 32 TO 35

PRINT .

NEXT A

LINE (200, 200)-(340, 220), , B

PRINT PLEASE WAIT

A=201

FOR B= 1 TO 70

LINE (A, 201)-(A, 218)


A=A+2

FOR C= 1 TO 100000

NEXT C

NEXT B
CALL MENU
STOP

7
1

Sub add:

START
T
O
C
2
Is UCASE$
(CHOICE$) =
N

YES

W
E

NO

Is
npcode=p
N
code
O
OPEN bishal.dat FOR APPEND AS #1
YES
PRINT Code already exists
PRINT Inserting the information

PRINT
Record
not added
INPUT
Code
number;
npcode
OPEN bishal.dat FOR APPEND AS #3
CLOSE #3
L
A

pcode = npcode
YES
Is EOF
reache
d?
INPUT Full name;pname$
NO

E
F

E
F

INPUT #3, pcode


INPUT Telephone;tel$

C
INPUT Address;add$
2

INPUT E-mail;email$

WRITE #1, pcode, pname$, tel$, add$, email$


7
1
C

C
3
L
A

CLOSE #1

T
O

INPUT Do you want to add more


records(y/n);choice$
W
E

CALL MENU
STOP

7
1

Sub credit:

CSTART
4

PRINT Copyright
(c)
COLOR
F 2009

= F +Heuju
1
PRINT By FBishal

M
E

NO

Is F >
Is I$ =
14

YES

F=1

NO
YES
I$ = INKEY$
A$ = Exiting.

PRINT Thanks For Choosing My


FOR B= 2 Program
TO LEN(A$)+1
C
FOR C= 1 TO 1000000
4
NEXT C

COLOR B: PRINT MID$(A$, B1, 1);


NEXT B
7
1
STOP

START
T
OPEN bishal.dat FOR INPUT AS #1

OPEN temp.dat FOR OUTUT AS #2

Tem=0
to
p
PRINT What do you want to delete records
by?
PRINT 1. Code No.

PRINT 2. Name

PRINT 3. Telephone

PRINT 4. Address

Sub delete:
PRINT 5. E-mail

INPUT Enter your choice (1-5);ch


7
1
C

C
5

YES

Is
ch
=
NO 1

Is
ch
=
NO 2

YES

Is
ch
=
3

YES

Is
ch
=
4

YES

Is
ch
=
NO 5

YES

NO

NO

PRINT Invalid input


B
Is
tem
=0
NO
C

YES

H
1

H
2

H
3

H
4

H
5

to
p

PRINT Record not found


7
1

7
1

C
6
CLOSE #1

CLOSE #2

KILL Bishal.dat

NAME temp.dat AS
Bishal.dat
INPUT Do you want to delete more records
(y/n);del$

Is UCASE$
(del$)
=Y

YES
T

NO
CALL DISPLAY

STOP

7
1

H
1
INPUT Enter the code
no.;pcode
INPUT #1, pcode, pname$, tel$, add$,
email$

Is
ncode
=
pcode

YES

PRINT Record is
deleted
PRINT TIME$

NO
WRITE #2, pcode, pname$, tel$, add$,
email$

tem =1

H
2
INPUT Enter the name;nname$
Is EOF
NO
reach
ed?
INPUT #1, pcode, pname$, tel$, add$,
email$
YES
B
Is
nname$
=
pname$

YES

PRINT Record is
deleted
PRINT TIME$

NO
WRITE #2, pcode, pname$, tel$, add$,
email$

NO

tem =1

Is EOF
reach
ed?

YES
B

7
1

H
3
INPUT Enter the telephone;
ntel$
INPUT #1, pcode, pname$, tel$, add$,
email$

Is
ntel$
= tel$

YES

PRINT Record is
deleted
PRINT TIME$

WRITE #2, pcode, pname$, tel$, add$,


email$

NO

tem =1

Is EOF
reach
ed?

YES
NO B

7
1

H
4
INPUT Enter the address;
nadd$
INPUT #1, pcode, pname$, tel$, add$,
email$

Is
nadd$
=
add$

YES

PRINT Record is
deleted
PRINT TIME$

NO
WRITE #2, pcode, pname$, tel$, add$,
email$

NO

tem =1

Is EOF
reach
ed?

YES
B

7
1

H
5
INPUT Enter the email; nemail$

INPUT #1, pcode, pname$, tel$, add$,


email$

Is
nemai
l$=
email
$

YES

PRINT Record is
deleted
PRINT TIME$

NO
WRITE #2, pcode, pname$, tel$, add$,
email$

NO

tem =1

Is EOF
reach
ed?

YES
B

7
1

START

CALL LOAD

OPEN bishal.dat FOR INPUT AS #1


FI
ct = 4

LOCATE 2,1: PRINT Code

LOCATE 2,6: PRINT Full


Name
LOCATE 2,25: PRINT
Telephone

LOCATE 2,37: PRINT


Address

Sub display:

E
O

LOCATE 2,50: PRINT E-mail

PRINT STRING$(80,
-)
INPUT #1, pcode, pname$, tel$, add$,
email$
LOCATE ct, 1: PRINT pcode
7
1
C

C
7

LOCATE ct, 6: PRINT pname$

LOCATE ct, 25: PRINT tel$

LOCATE ct, 37: PRINT add$

LOCATE ct, 50: PRINT email$

ct = ct + 1

NO

Is
ct>
=23
YES

PRINT Press any key to view next


records
C$ = INPUT$(1)
FI

E
O

NO

Is EOF
reach
ed?

YES
C

7
1

C
8
CLOSE #1

PRINT Press any key to go to main


menu
main$ = INPUT$(1)

CALL MENU
7
1
STOP

Sub load:
START

PRINT SEARCHING.

LINE (200, 200)-(340, 220), , B

PRINT PLEASE WAIT

A=201

L
1

FOR B= 1 TO 70

C
C9
9
LINE (A, 201)-(A, 218)
A=A+2

FOR C= 1 TO 100000

NEXT C
L
1

NEXT B

STOP

7
1

Sub menu:
C1
0
START
PRINT 2. Display All Records
LOCATE 4, 5: PRINT "Date = "; DATE$
PRINT 3. Modify Record
LOCATE 4, 55: PRINT "Time = "; TIME$
PRINT 4. Delete Record
LOCATE 6, 25: PRINT "Telephone
Directory"
PRINT 5. Search Record
LOCATE 7, 25: PRINT
"===================="
PRINT 6. Exit
PRINT "1. Add Records"
PRINT Enter the choice (1-6)
C1
0
ch$ = INPUT$(1)

IS
ch$
=
1

YES

NO

IS
ch$
=
2
NO

YES

IS
ch$
=
3

YES

C1

CALL ADD1

NO

CALL DISPALY

CALL MODIFY

7
1

C11
NO
IS ch$
= 4

YES

CALL DELETE

NO
IS ch$
= 5

YES

CALL SEARCH

NO
CALL CREDIT

STOP

7
1

Sub modify:

START
T2
OPEN i, #1, bishal.dat
C1
2
OPEN O, #1,
temp.dat

TE

IS
temNO
=0
LO
nname
$=
pname
INPUT
$ Enter the name; nname$
YES
PRINT PressINPUT
C to change
information
#1, pcode,
pname$, tel$, add$,
email$
PRINT Code number =; pcode
C1
2
d$ = INPUT$(1)

IS
UCASE
$ (d$)
= C
NO

YES

INPUT Enter new code number;


pcode

PRINT Name =; pname$

d$ = INPUT$(1)

IS
UCASE
$ (d$)
= C
NO
C1

YES

INPUT Enter new name; pname$ 7


1

C1
3
PRINT Telephone =; tel$
umber; pcode
elephone
=; pcode
d$ = INPUT$(1)

IS
UCASE
$ (d$)
= C

YES

INPUT Enter new telephone;


tel$

NO
PRINT Address =; add$
umber; pcode
elephone
=; pcode
d$ = INPUT$(1)

IS
UCASE
$ (d$)
= C
NO

YES

INPUT Enter new address; add$

PRINT E-mail =; email$


umber; pcode
elephone
=; pcode
d$ = INPUT$(1)

IS UCASE$ (d$) =
C

YES

INPUT Enter new e-mail; email$


7
1

NO
C1

C1
4
WRITE #2, pcode, pname$, tel$, add$,
email$
PRINT Record modified
succesfully
PRINT TIME$

PRINT New code number =;


pcode
PRINT New name =; pname$

PRINT New telephone; tel$

PRINT New address; add$

PRINT New e-mail; email$

tem = 1
LO
WRITE #2, pcode, pname$, tel$, add$,
email$
IS EOF reached?
NO

YES
C1

TE

7
1

C1
5
CLOSE #1

CLOSE #2

KILL bishal.dat

NAME temp.dat AS
bishal.dat
IS tem=0
YES

BEEP

PRINT Record not


found

NO

INPUT Do you want to modify more records (y/n);


modif$

T2

YES

IS UCASE$ (modif$)
= Y

NO
CALL MENU
7
1
STOP

START
P1
tem = 0

OPEN i, #1, bishal.dat

Sub search:

PRINT What do you want to search the


information by?
PRINT 1. Code number

PRINT 2. Name

PRINT 3. Telephone

PRINT 4. Address

PRINT 5. E-mail

INPUT Enter your choice (1-5);


choi

IS
choi
1-5?

NO

C1
6

YES
7
1
N1

N2

N3

N4

N5

C1
6

IS
tem
=
0?
N
O

YES

BEEP

PRINT Record not


found

CLOSE #1

TE

INPUT Do you want to search more records


(y/n); sea$

IS
tem
=
N 0?

YES
P1

O
CALL MENU
7
1
STOP

N1

INPUT Enter the code number; ncode

ct = 4

CALL LOAD
UP
1

INPUT #1, pcode, pname$, tel$, add$,


email$

IS
ncode
=
pcode
YES

NO

D1

LOCATE 2, 1: PRINT
"Code"
LOCATE 2, 6: PRINT "Full
Name"
LOCATE 2, 25: PRINT
"Telephone"
LOCATE 2, 37: PRINT
"Address"
LOCATE 2, 50: PRINT "Email"
PRINT STRING$(80,-)
7
1
C1

C1
7
LOCATE ct, 1: PRINT
pcode
LOCATE ct, 6: PRINT pname$
N2
LOCATE ct, 25: PRINT tel$
INPUT Enter the name; nname$
LOCATE ct, 37: PRINT
add$
ct = 4
LOCATE ct, 50: PRINT
email$
CALL LOAD
UP
2

ct = ct + 1
INPUT #1, pcode, pname$, tel$, add$,
email$
tem = 1
D1
IS UCASE$
(nname$) =
NO
IS EOF
UCASE$
reache
(pname$)
d?
YES

NO

D2

UP
1

LOCATE YES
2, 1: PRINT
"Code"
TE
LOCATE 2, 6: PRINT "Full
Name"
LOCATE 2, 25: PRINT
"Telephone"
LOCATE 2, 37: PRINT
"Address"
LOCATE 2, 50: PRINT "Email"
PRINT STRING$(80,-)
7
1
C1

C1
8
LOCATE ct, 1: PRINT
pcode
LOCATE ct, 6: PRINT pname$

LOCATE ct, 25: PRINT tel$

LOCATE ct, 37: PRINT


add$
LOCATE ct, 50: PRINT
email$
ct = ct + 1

tem = 1
D2
IS EOF
reache
d?
YES
TE

NO

UP
2
7
1

N3

INPUT Enter the telephone; ntel$

ct = 4

CALL LOAD
UP
3

INPUT #1, pcode, pname$, tel$, add$,


email$

IS
ntel$
= tel$

NO

D3

YES
LOCATE 2, 1: PRINT
"Code"
LOCATE 2, 6: PRINT "Full
Name"
LOCATE 2, 25: PRINT
"Telephone"
LOCATE 2, 37: PRINT
"Address"
LOCATE 2, 50: PRINT "Email"
PRINT STRING$(80,-)
7
1
C1

C1
9
LOCATE ct, 1: PRINT
pcode
LOCATE ct, 6: PRINT pname$

LOCATE ct, 25: PRINT tel$

LOCATE ct, 37: PRINT


add$
LOCATE ct, 50: PRINT
email$
ct = ct + 1

tem = 1
D3
IS EOF
reache
d?
YES
TE

NO

UP
3
7
1

N4

INPUT Enter the address; nadd$

ct = 4

CALL LOAD
UP
4

INPUT #1, pcode, pname$, tel$, add$,


email$

IS UCASE$
(nadd$) =
UCASE$
(add$)
YES

NO

D4

LOCATE 2, 1: PRINT
"Code"
LOCATE 2, 6: PRINT "Full
Name"
LOCATE 2, 25: PRINT
"Telephone"
LOCATE 2, 37: PRINT
"Address"
LOCATE 2, 50: PRINT "Email"
PRINT STRING$(80,-)
7
1
C2

C2
0
LOCATE ct, 1: PRINT
pcode
LOCATE ct, 6: PRINT pname$

LOCATE ct, 25: PRINT tel$

LOCATE ct, 37: PRINT


add$
LOCATE ct, 50: PRINT
email$
ct = ct + 1

tem = 1
D4
IS EOF
reache
d?
YES
TE

NO

UP
4
7
1

N5

INPUT Enter the email; nemail$

ct = 4

CALL LOAD
UP
5

INPUT #1, pcode, pname$, tel$, add$,


email$

IS UCASE$
(nemail$) =
UCASE$
(email$)
YES

NO

D5

LOCATE 2, 1: PRINT
"Code"
LOCATE 2, 6: PRINT "Full
Name"
LOCATE 2, 25: PRINT
"Telephone"
LOCATE 2, 37: PRINT
"Address"
LOCATE 2, 50: PRINT "Email"
PRINT STRING$(80,-)
7
1
C2

C2
1
LOCATE ct, 1: PRINT
pcode
LOCATE ct, 6: PRINT pname$

LOCATE ct, 25: PRINT tel$

LOCATE ct, 37: PRINT


add$
LOCATE ct, 50: PRINT
email$
ct = ct + 1

tem = 1
D5
IS EOF
reache
d?
YES
TE

NO

UP
5
7
1

PROGRAM CODING
Entrance:
DECLARE SUB DISPLAY ()
DECLARE SUB MENU ()
DECLARE SUB SEARCH ()
DECLARE SUB DELETE ()
DECLARE SUB MODIFY ()
DECLARE SUB DISPALY ()
DECLARE SUB ADD1 ()
DECLARE SUB LOAD ()
DECLARE SUB CREDIT ()
CLS
SCREEN 9
PRINT "Press any key to continue"
7
1

continue$ = INPUT$(1)
COLOR 2, 8: LOCATE 12, 24: PRINT "LOADING"
FOR A = 32 TO 35
LOCATE 12, A: PRINT "."
NEXT A
COLOR 10: LINE (200, 200)-(340, 220), , B
LOCATE 14, 24: PRINT "PLEASE WAIT"
A = 201
FOR B = 1 TO 70
COLOR 2: LINE (A, 201)-(A, 218)
A=A+2
FOR C = 1 TO 100000
NEXT C
NEXT B
CALL MENU
END

Add:
SUB ADD1
WHILE NOT UCASE$(choice$) = "N"
OPEN "bishal.dat" FOR APPEND AS #1
CLS
SCREEN 9
COLOR 2, 8
FOR A = 15 TO 602
LINE (15, 16)-(602, 16), 13, BF
LINE (20, 21)-(597, 21), 13, BF
NEXT
FOR B = 1 TO 1000000
NEXT
PLAY "l32o2cdegab"
FOR A = 15 TO 602
LINE (15, 300)-(602, 300), 13, BF
LINE (20, 295)-(597, 295), 13, BF
NEXT
FOR B = 1 TO 1000000
NEXT
PLAY ">cdefgab"
LINE (14, 16)-(14, 300), 13, BF
LINE (19, 21)-(19, 295), 13, BF
PLAY "l32o2>cdefgab"
LINE (602, 16)-(602, 300), 13, BF
LINE (597, 21)-(597, 295), 13, BF
PLAY ">cdefgab"
LOCATE 4, 20: PRINT "Inserting the information"
LOCATE 6, 5: INPUT "Code number"; npcode
OPEN "bishal.dat" FOR INPUT AS #3
WHILE NOT EOF(3)
INPUT #3, pcode
IF npcode = pcode THEN
BEEP
LOCATE 7, 7: PRINT "Code already exists"
LOCATE 8, 7: PRINT "Record not added"

7
1

CLOSE #3
GOTO last99
END IF
WEND
CLOSE #3
pcode = npcode
LOCATE 7, 5: INPUT "Full name "; pname$
LOCATE 8, 5: INPUT "Telephone "; tel$
LOCATE 9, 5: INPUT "Address "; add$
LOCATE 10, 5: INPUT "E-mail "; email$
WRITE #1, pcode, pname$, tel$, add$, email$
last99:
CLOSE #1
LOCATE 15, 5: INPUT "Do you want to add more record(y/n)"; choice$
WEND
CALL MENU
END SUB

Credit:
SUB CREDIT
CLS
DO
COLOR F
F=F+1
IF F > 14 THEN F = 1
I$ = INKEY$
LOCATE 7, 25: PRINT "Thanks For Choosing My Program"
LOCATE 8, 25: PRINT "Copyright (c) 2009"
LOCATE 10, 25: PRINT "By Bishal Heuju"
LOOP WHILE I$ = ""
LOCATE 13, 30
A$ = "Exiting...."
FOR B = 2 TO LEN(A$) + 1
FOR C = 1 TO 1000000: NEXT C
COLOR B: PRINT MID$(A$, B - 1, 1);
NEXT B
PLAY "o3 L8 E D+ E D+ E o2 B o3 D C L2 o2 A"
END SUB

Delete:
SUB DELETE
top:
CLS
SCREEN 9
COLOR 2, 8
FOR A = 15 TO 602
LINE (15, 16)-(602, 16), 13, BF
LINE (20, 21)-(597, 21), 13, BF
NEXT
FOR B = 1 TO 1000000
NEXT
PLAY "l32o2cdegab"
FOR A = 15 TO 602
LINE (15, 300)-(602, 300), 13, BF

7
1

LINE (20, 295)-(597, 295), 13, BF


NEXT
FOR B = 1 TO 1000000
NEXT
PLAY ">cdefgab"
LINE (14, 16)-(14, 300), 13, BF
LINE (19, 21)-(19, 295), 13, BF
PLAY "l32o2>cdefgab"
LINE (602, 16)-(602, 300), 13, BF
LINE (597, 21)-(597, 295), 13, BF
PLAY ">cdefgab"
OPEN "bishal.dat" FOR INPUT AS #1
OPEN "temp.dat" FOR OUTPUT AS #2
tem = 0
top55:
LOCATE 3, 5: PRINT "What do you want to delete records by?"
LOCATE 4, 5: PRINT "1. Code No."
LOCATE 5, 5: PRINT "2. Name"
LOCATE 6, 5: PRINT "3. Telephone"
LOCATE 7, 5: PRINT "4. Address"
LOCATE 8, 5: PRINT "5. E-mail"
LOCATE 9, 5: INPUT "Enter your choice"; ch
SELECT CASE ch
CASE 1
LOCATE 11, 5: INPUT "Enter the code no."; ncode
WHILE NOT EOF(1)
INPUT #1, pcode, pname$, tel$, add$, email$
IF ncode = pcode THEN
LOCATE 12, 5: PRINT "Record is deleted"
LOCATE 13, 5: PRINT TIME$
tem = 1
PRINT
ELSE
WRITE #2, pcode, pname$, tel$, add$, email$
END IF
WEND
CASE 2
LOCATE 11, 5: INPUT "Enter the name"; nname$
WHILE NOT EOF(1)
INPUT #1, pcode, pname$, tel$, add$, email$
IF nname$ = pname$ THEN
LOCATE 12, 5: PRINT "Record is deleted"
LOCATE 13, 5: PRINT TIME$
tem = 1
PRINT
ELSE
WRITE #2, pcode, pname$, tel$, add$, email$
END IF
WEND
CASE 3
LOCATE 11, 5: INPUT "Enter the telephone"; ntel$
WHILE NOT EOF(1)
INPUT #1, pcode, pname$, tel$, add$, email$
IF ntel$ = tel$ THEN
7
1

LOCATE 12, 5: PRINT "Record is deleted"


LOCATE 13, 5: PRINT TIME$
tem = 1
PRINT
ELSE
WRITE #2, pcode, pname$, tel$, add$, email$
END IF
WEND
CASE 4
LOCATE 11, 5: INPUT "Enter the address"; nadd$
WHILE NOT EOF(1)
INPUT #1, pcode, pname$, tel$, add$, email$
IF nadd$ = add$ THEN
LOCATE 12, 5: PRINT "Record is deleted"
LOCATE 13, 5: PRINT TIME$
tem = 1
PRINT
ELSE
WRITE #2, pcode, pname$, tel$, add$, email$
END IF
WEND
CASE 5
LOCATE 11, 5: INPUT "Enter the email"; nemail$
WHILE NOT EOF(1)
INPUT #1, pcode, pname$, tel$, add$, email$
IF nemail$ = email$ THEN
LOCATE 12, 5: PRINT "Record is deleted"
LOCATE 13, 5: PRINT TIME$
tem = 1
PRINT
ELSE
WRITE #2, pcode, pname$, tel$, add$, email$
END IF
WEND
CASE ELSE
LOCATE 19, 5: PRINT "Invalid input"
new$ = INPUT$(1)
GOTO top55
END SELECT
IF tem = 0 THEN
BEEP
LOCATE 20, 5: PRINT "Record not found"
END IF
CLOSE #1
CLOSE #2
KILL "bishal.dat"
NAME "temp.dat" AS "bishal.dat"
LOCATE 24, 5: INPUT "Do you want to delete more records (y/n)"; del$
IF UCASE$(del$) = "Y" THEN GOTO top
CALL DISPLAY
END SUB

Display:
SUB DISPLAY

7
1

CALL LOAD
OPEN "bishal.dat" FOR INPUT AS #1
first:
ct = 4
CLS
LOCATE 2, 1: PRINT "Code"
LOCATE 2, 6: PRINT "Full Name"
LOCATE 2, 25: PRINT "Telephone"
LOCATE 2, 37: PRINT "Address"
LOCATE 2, 50: PRINT "E-mail"
PRINT STRING$(80, "-")
WHILE NOT EOF(1)
INPUT #1, pcode, pname$, tel$, add$, email$
LOCATE ct, 1: PRINT pcode
LOCATE ct, 6: PRINT pname$
LOCATE ct, 25: PRINT tel$
LOCATE ct, 37: PRINT add$
LOCATE ct, 50: PRINT email$
ct = ct + 1
IF ct >= 23 THEN
LOCATE 24, 15: PRINT "Press any key to view next records":
C$ = INPUT$(1)
GOTO first
END IF
WEND
CLOSE #1
LOCATE 25, 15: PRINT "Press any key to go to main menu"
main$ = INPUT$(1)
CALL MENU
END SUB

Load:
SUB LOAD
CLS
SCREEN 9
COLOR 2, 8: LOCATE 12, 24: PRINT "SEARCHING...."
COLOR 10: LINE (200, 200)-(340, 220), , B
LOCATE 14, 24: PRINT "PLEASE WAIT"
A = 201
FOR B = 1 TO 70
COLOR 2: LINE (A, 201)-(A, 218)
A=A+2
FOR C = 1 TO 100000
NEXT C
NEXT B
END SUB

Menu:
SUB MENU
CLS
SCREEN 9
COLOR 2, 8
FOR A = 15 TO 602
LINE (15, 16)-(602, 16), 13, BF

7
1

LINE (20, 21)-(597, 21), 13, BF


NEXT
FOR B = 1 TO 1000000
NEXT
PLAY "l32o2cdefgab"
FOR A = 15 TO 602
LINE (15, 300)-(602, 300), 13, BF
LINE (20, 295)-(597, 295), 13, BF
NEXT
FOR B = 1 TO 1000000
NEXT
PLAY ">cdefgab"
LINE (14, 16)-(14, 300), 13, BF
LINE (19, 21)-(19, 295), 13, BF
PLAY "l32o2>cdefgab"
LINE (602, 16)-(602, 300), 13, BF
LINE (597, 21)-(597, 295), 13, BF
PLAY ">cdefgab"
LOCATE 4, 5: PRINT "Date = "; DATE$
LOCATE 4, 55: PRINT "Time = "; TIME$
LOCATE 6, 25: PRINT "Telephone Directory"
LOCATE 7, 25: PRINT "===================="
LOCATE 9, 25: PRINT "1. Add Records"
LOCATE 10, 25: PRINT "2. Display All Records"
LOCATE 11, 25: PRINT "3. Modify Record"
LOCATE 12, 25: PRINT "4. Delete Record"
LOCATE 13, 25: PRINT "5. Search Record"
LOCATE 14, 25: PRINT "6. Exit"
LOCATE 16, 25: PRINT "Enter the choice (1-6)"
ch$ = INPUT$(1)
CLS
SELECT CASE ch$
CASE "1"
CALL ADD1
CASE "2"
CALL DISPLAY
CASE "3"
CALL MODIFY
CASE "4"
CALL DELETE
CASE "5"
CALL SEARCH
CASE ELSE
CALL CREDIT
END SELECT
END SUB

Modify:
SUB MODIFY
top2:
OPEN "i", #1, "bishal.dat"
OPEN "o", #2, "temp.dat"
CLS
SCREEN 9

7
1

COLOR 2, 8
FOR A = 15 TO 602
LINE (15, 16)-(602, 16), 13, BF
LINE (20, 21)-(597, 21), 13, BF
NEXT
FOR B = 1 TO 1000000
NEXT
PLAY "l32o2cdefgab"
FOR A = 15 TO 602
LINE (15, 300)-(602, 300), 13, BF
LINE (20, 295)-(597, 295), 13, BF
NEXT
FOR B = 1 TO 1000000
NEXT
PLAY ">cdefgab"
LINE (14, 16)-(14, 300), 13, BF
LINE (19, 21)-(19, 295), 13, BF
PLAY "l32o2>cdefgab"
LINE (602, 16)-(602, 300), 13, BF
LINE (597, 21)-(597, 295), 13, BF
PLAY ">cdefgab"
tem = 0
LOCATE 3, 5: INPUT "Enter the name"; nname$
WHILE NOT EOF(1)
INPUT #1, pcode, pname$, tel$, add$, email$
IF (nname$ = pname$) THEN
LOCATE 6, 5: PRINT "Press C to change information"
LOCATE 8, 5: PRINT "Code number = "; pcode
d$ = INPUT$(1)
IF UCASE$(d$) = "C" THEN
LOCATE 8, 35: INPUT "Enter new code number"; pcode
END IF
LOCATE 9, 5: PRINT "Name
= "; pname$
d$ = INPUT$(1)
IF UCASE$(d$) = "C" THEN
LOCATE 9, 35: INPUT "Enter new name"; pname$
END IF
LOCATE 10, 5: PRINT "Telephone = "; tel$
d$ = INPUT$(1)
IF UCASE$(d$) = "C" THEN
LOCATE 10, 35: INPUT "Enter new telephone"; tel$
END IF
LOCATE 11, 5: PRINT "Address
= "; add$
d$ = INPUT$(1)
IF UCASE$(d$) = "C" THEN
LOCATE 11, 35: INPUT "Enter new address"; add$
END IF
LOCATE 12, 5: PRINT "E-mail
= "; email$
d$ = INPUT$(1)
IF UCASE$(d$) = "C" THEN
LOCATE 12, 35: INPUT "Enter new e-mail"; email$
END IF
WRITE #2, pcode, pname$, tel$, add$, email$
7
1

LOCATE 14, 5: PRINT "Record modified successfully"


LOCATE 15, 5: PRINT TIME$
LOCATE 16, 20: PRINT "New code number = "; pcode
LOCATE 17, 20: PRINT "New name
= "; pname$
LOCATE 18, 20: PRINT "New telephone = "; tel$
LOCATE 19, 20: PRINT "New address
= "; add$
LOCATE 20, 20: PRINT "New e-mail
= "; email$
tem = 1
ELSE
WRITE #2, pcode, pname$, tel$, add$, email$
END IF
WEND
CLOSE #1
CLOSE #2
KILL "bishal.dat"
NAME "temp.dat" AS "bishal.dat"
IF tem = 0 THEN
BEEP
LOCATE 20, 5: PRINT "Record not found"
END IF
LOCATE 23, 15: INPUT "Do you want to modify more records(y/n)"; modif$
IF UCASE$(modif$) = "Y" THEN GOTO top2
CALL MENU
END SUB

Search:
SUB SEARCH
top1:
CLS
SCREEN 9
COLOR 2, 8
FOR A = 15 TO 602
LINE (15, 16)-(602, 16), 13, BF
LINE (20, 21)-(597, 21), 13, BF
NEXT
FOR B = 1 TO 1000000
NEXT
PLAY "l32o2cdegab"
FOR A = 15 TO 602
LINE (15, 300)-(602, 300), 13, BF
LINE (20, 295)-(597, 295), 13, BF
NEXT
FOR B = 1 TO 1000000
NEXT
PLAY ">cdefgab"
LINE (14, 16)-(14, 300), 13, BF
LINE (19, 21)-(19, 295), 13, BF
PLAY "l32o2>cdefgab"
LINE (602, 16)-(602, 300), 13, BF
LINE (597, 21)-(597, 295), 13, BF
PLAY ">cdefgab"
tem = 0
OPEN "i", #1, "bishal.dat"

7
1

LOCATE 3, 5: PRINT "What do you want to search the information by?"


LOCATE 4, 5: PRINT "1. Code number"
LOCATE 5, 5: PRINT "2. Name"
LOCATE 6, 5: PRINT "3. Telephone"
LOCATE 7, 5: PRINT "4. Address"
LOCATE 8, 5: PRINT "5. E-mail"
LOCATE 9, 5: INPUT "Enter your choice (1-5)"; choi
SELECT CASE choi
CASE 1
LOCATE 11, 5: INPUT "Enter the code number"; ncode
ct = 4
CALL LOAD
CLS
WHILE NOT EOF(1)
INPUT #1, pcode, pname$, tel$, add$, email$
IF ncode = pcode THEN
CLS
LOCATE 2, 1: PRINT "Code"
LOCATE 2, 6: PRINT "Full Name"
LOCATE 2, 25: PRINT "Telephone"
LOCATE 2, 37: PRINT "Address"
LOCATE 2, 50: PRINT "E-mail"
PRINT STRING$(80, "-")
LOCATE ct, 1: PRINT pcode
LOCATE ct, 6: PRINT pname$
LOCATE ct, 25: PRINT tel$
LOCATE ct, 37: PRINT add$
LOCATE ct, 50: PRINT email$
ct = ct + 1
tem = 1
END IF
WEND
CASE 2
ct = 4
LOCATE 3, 5: INPUT "Enter the name"; nname$
CALL LOAD
CLS
WHILE NOT EOF(1)
INPUT #1, pcode, pname$, tel$, add$, email$
IF UCASE$(nname$) = UCASE$(pname$) THEN
CLS
LOCATE 2, 1: PRINT "Code"
LOCATE 2, 6: PRINT "Full Name"
LOCATE 2, 25: PRINT "Telephone"
LOCATE 2, 37: PRINT "Address"
LOCATE 2, 50: PRINT "E-mail"
PRINT STRING$(80, "-")
LOCATE ct, 1: PRINT pcode
LOCATE ct, 6: PRINT pname$
LOCATE ct, 25: PRINT tel$
LOCATE ct, 37: PRINT add$
LOCATE ct, 50: PRINT email$
ct = ct + 1
tem = 1
END IF
7
1

WEND
CASE 3
ct = 4
LOCATE 11, 5: INPUT "Enter the telephone"; ntel$
CALL LOAD
CLS
WHILE NOT EOF(1)
INPUT #1, pcode, pname$, tel$, add$, email$
IF ntel$ = tel$ THEN
CLS
LOCATE 2, 1: PRINT "Code"
LOCATE 2, 6: PRINT "Full Name"
LOCATE 2, 25: PRINT "Telephone"
LOCATE 2, 37: PRINT "Address"
LOCATE 2, 50: PRINT "E-mail"
PRINT STRING$(80, "-")
LOCATE ct, 1: PRINT pcode
LOCATE ct, 6: PRINT pname$
LOCATE ct, 25: PRINT tel$
LOCATE ct, 37: PRINT add$
LOCATE ct, 50: PRINT email$
ct = ct + 1
tem = 1
END IF
WEND
CASE 4
ct = 4
LOCATE 11, 5: INPUT "Enter the address"; nadd$
CALL LOAD
CLS
WHILE NOT EOF(1)
INPUT #1, pcode, pname$, tel$, add$, email$
IF UCASE$(nadd$) = UCASE$(add$) THEN
LOCATE 2, 1: PRINT "Code"
LOCATE 2, 6: PRINT "Full Name"
LOCATE 2, 25: PRINT "Telephone"
LOCATE 2, 37: PRINT "Address"
LOCATE 2, 50: PRINT "E-mail"
PRINT STRING$(80, "-")
LOCATE ct, 1: PRINT pcode
LOCATE ct, 6: PRINT pname$
LOCATE ct, 25: PRINT tel$
LOCATE ct, 37: PRINT add$
LOCATE ct, 50: PRINT email$
ct = ct + 1
tem = 1
END IF
WEND
CASE 5
ct = 4
LOCATE 11, 5: INPUT "Enter the email"; nemail$
CALL LOAD
CLS
WHILE NOT EOF(1)
INPUT #1, pcode, pname$, tel$, add$, email$
7
1

IF UCASE$(nemail$) = UCASE$(email$) THEN


CLS
LOCATE 2, 1: PRINT "Code"
LOCATE 2, 6: PRINT "Full Name"
LOCATE 2, 25: PRINT "Telephone"
LOCATE 2, 37: PRINT "Address"
LOCATE 2, 50: PRINT "E-mail"
PRINT STRING$(80, "-")
LOCATE ct, 1: PRINT pcode
LOCATE ct, 6: PRINT pname$
LOCATE ct, 25: PRINT tel$
LOCATE ct, 37: PRINT add$
LOCATE ct, 50: PRINT email$
ct = ct + 1
tem = 1
END IF
WEND
END SELECT
IF tem = 0 THEN
BEEP
LOCATE 10, 15: PRINT "Record not found"
END IF
CLOSE #1
LOCATE 25, 10: INPUT "Do you want to search more records(y/n)"; sea$
IF UCASE$(sea$) = "Y" THEN GOTO top1 ELSE CALL MENU
END SUB

OUTPUT USING DUMMY


Entrance:
Press any key to continue

PRESS ENTER TO CONTINUE AND ENTER ANY OTHE KEY TO EXIT?

LOADING . . . .
PLEASE WAIT
7
1

Main menu:

Date = 12-04-2009
09:19:34

Time

Telephone directory
==================
1. Add Records
2. Display All Records
3. Modify Record
4. Delete Record
5. Search record
6. Exit
Enter the choice (1-6)

Add:
Inserting the information
Code number? 1
Full name ? Bishal Heuju
Telephone ? 4910281
Address
? Narayantar
E-mail
? [email protected]

Do you want to add more record(y/n)? n

7
1

Load:

SEARCHING . . . .
PLEASE WAIT

Display:
Code Full name

Telephone

Address

E-mail

----------------------------------------------------------------------------------------------------------------------------------1
2
3
4

Bishal Heuju
4910281
Narayantar [email protected]
Aaditya Pudasaini 4484050
Maijubahal
[email protected]
Abhishek Pudasaini 4451452
Thali
Hari Pd. Dhakal
9851025849 Biratnagar
[email protected]

Press any key to go to main menu


7
1

Modify:
Modifying the members information
Enter the name? Hari Pd. Dhakal
Press C to change information
Code number
=4
Full name
= Hari Pd. Dhakal
Enter new name? Ram Pd. Dhakal
Telephone = 9851025849
Enter new telephone?
9841452649
Address
= Biratnagar
E-mail
= [email protected] Enter new e-mail?
[email protected]
Record modified successfully
09:25:19
New
New
New
New
New

code number = 4
name
= Ram Pd. Dhakal
telephone
= 9841452649
address
= Biratnagar
e-mail
= [email protected]

Do you want to modify more records (y/n)? n

Delete:
Deleting the members information
What do you want to delete the records by?
1. Code no.
2. Name
3. Telephone
4. Address
5. E-mail
Enter your choice (1-5)? 1

7
1

Enter the code no.? 4


Record is deleted
09:30:25
Do you want to modify more records (y/n)? n

SEARCHING . . . .
PLEASE WAIT

Code Full name

Telephone

Address

E-mail

----------------------------------------------------------------------------------------------------------------------------------1
2
3

Bishal Heuju
4910281
Narayantar [email protected]
Aaditya Pudasaini 4484050
Maijubahal
[email protected]
Abhishek Pudasaini 4451452
Thali
-

Press any key to go to main menu

Search:
7
1

What do you want to search the information by?


1. Code no.
2. Name
3. Telephone
4. Address
5. E-mail
Enter your choice (1-5)? 4
Enter the address? Thali

SEARCHING . . . .
PLEASE WAIT

Code Full name

Telephone

Address

E-mail

----------------------------------------------------------------------------------------------------------------------------------3

Abhishek Pudasaini 4451452

Thali

Do you want to search for more records (y/n)? n

Exit:

7
1

Thanks For Choosing My Program


Copyright (c) 2009
By Bishal Heuju
Exiting . . . .

CONCLUSION
I am very much satisfied with my computer project. I was able
to achieve my goals through it. Finally I was able to make a program
based on QBASIC. I had tried my best to make the program as versatile as
I was able. I tried hard to make the program reliable and error free. But
also there may be some error in the program. It is very simple program
based on QBASIC using the concept of file handling and modular
programming. It is a telephone directory which allows the user to add,
display, modify, delete and search records. I had also used some graphics
with the help of our computer teacher, Ram K. Thapa sir and the help file
of QBASIC.
At last I want to conclude my project here with the
thankfulness to all who had contributed and helped me directly as well as
indirectly to make this program successful. I hope that this program would
be an encouragement for me as well as our new QBASIC learners.

7
1

You might also like