0% found this document useful (0 votes)
15 views18 pages

Computer Science Project

The document outlines a project titled 'Bus Ticket Booking System' submitted by students Anuj Singh and Riki Man Tamrakar at GEMS School, Nepal. It includes a certificate of authenticity, acknowledgments, an introduction to the system's objectives, analysis, algorithms, coding, output, and a conclusion emphasizing its efficiency in managing bus ticket sales. The project aims to streamline the ticket booking process and enhance user experience for both customers and bus workers.

Uploaded by

sanax7322
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views18 pages

Computer Science Project

The document outlines a project titled 'Bus Ticket Booking System' submitted by students Anuj Singh and Riki Man Tamrakar at GEMS School, Nepal. It includes a certificate of authenticity, acknowledgments, an introduction to the system's objectives, analysis, algorithms, coding, output, and a conclusion emphasizing its efficiency in managing bus ticket sales. The project aims to streamline the ticket booking process and enhance user experience for both customers and bus workers.

Uploaded by

sanax7322
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Computer Science Project

GEMS SCHOOL
Dhapakhel, Lalitpur
Nepal

Department of Computer Science


Secondary Level

Submitted By: Submitted To

Anuj SIngh (roll no : 4)


RIki Man Tamrakar(Roll No. : 18 ) Submitted to :

…………………………
Mr . Ibran Ansari

Grade X
Section : G
CERTIFICATE

This is to certify that content of this project entitled, “Bus Ticket Booking 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 2082. On the basis of the declaration made by
him/her/team, I recommend this project report for evaluation.

Remark: …………………………………………………………...

Submission By: Anuj SIngh XG(roll no : 4)


Riki Man Tamrakar (roll no : 18)
Certified By:
Ibran Ansari
Computer Department
Table Of Content

. Acknowledgement

. introduction

. Analysis

. Algorithm

. Flowchart

. Coding

. Output

. Conclusion

. Bibliography
ACKNOWLEDGEMENT
We would like to take this opportunity to acknowledge and appreciate all of
those who helped us with the project in every possible way. We would like to
express our sincerest gratitude to our secondary level computer science
department, and project supervisor Mr Ibran Ansari for the
tremendous support, critical analysis and crucial suggestions throughout
the project development process.
It has been a great opportunity for us to learn about the basic implementation
of the real-world system. We consider us to be lucky to have the opportunity to
meet such great individuals and professionals who are notable in their field of
work.
Further, we would also like to present our deepest thanks to the GEMS
School who facilitated us with this curriculum to test our potential and break
boundaries with the project. Their contributions are sincerely appreciated.
1. Introduction
Bus Ticket Booking System(MTBS) is a system which allows the user to buy bus tickets
faster and easily. This system also helps the customers trying to book bus tickets and adjust
the ticket fare according to the numbers of tickets.

In the Bus ticket Booking system, the user can book tickets according to their own
preferable prices and choose their destination.

This type of protocol of the system can be implemented in vehicles every 4


wheeled vehicles.

2. Objective
The objective of this project is to make the selling of bus tickets faster and easier
and help the user and the bus worker reach a cooperative price from the both
sides. It helps to take feedback from user and improve the relationship between
user and bus worker as well as develop the system of bus travelling.

3. Analysis
A bus ticket booking system (BTBS) is an essential tool for efficiently running a
bus vehicle. To understand its impacts, benefits , and potential challenges, It’s
important to analyze it from multiple perspectives such as efficiency ,
functionality and user experience. It helps the user to buy tickets faster and in a
suitable way without any difficulties.
4. Algorithm

Step 1: Start Program

Step 2: Display main menu with options:

4. View Bus Schedule

5. Buy Ticket

6. Driver Login

7. Exit

Step 3: Ask the user to enter a choice (1–4)

Step 4: Use a loop to handle the choice:


📌 Case 1: View Bus Schedule

● Clear screen

● Display bus schedule (route no, departure, arrival, destination, fare)

● Wait for key press

● Return to main menu

📌 Case 2: Buy Ticket

1. Ask for passenger name

2. Ask for destination (validate from list)


3. Ask how many tickets to buy

4. If invalid number, show error and return

5. Determine fare and route based on destination

6. For each ticket:

○ Ask for seat number

○ Save data (name, dest, seat, fare) to respective destination file

7. Display ticket booking summary (passenger name, dest, fare, etc.)

8. Return to main menu

📌 Case 3: Driver Login

1. Ask for username and password

2. Match with predefined driver credentials

3. If incorrect, show error and return

4. If correct:

○ Show route info (based on login)

○ Open corresponding file and read passenger data

○ Parse and display each passenger's name, seat, and fare


5. Return to main menu

📌 Case 4: Exit Program


● Show thank you message

● Exit

📌 Case Else: Invalid Choice


● Show error message

● Return to menu

🔁 Loop back to Step 3 (Main Menu)

Step 5: End Program


Flowchart
Coding
Screen 12

Dim pname$, dest$, seat$, filename$, rec$, name$, rest$, rest2$, user$, pass$, choice$,
destUpper$
Dim fare As Integer
Dim driverRoute As Integer, recCount As Integer
Dim pos1 As Integer, pos2 As Integer, pos3 As Integer

Do
Cls
Color 15, 1
Locate 4, 15: Print " WELCOME TO CITY BUS SYSTEM "
Color 15, 1
Locate 10, 20: Print "1. View Bus Schedule"
Locate 12, 20: Print "2. Buy Ticket"
Locate 14, 20: Print "3. Bus Driver Login"
Locate 16, 20: Print "4. Exit Program"
Locate 20, 20: Input "Choose an option (1-4): ", choice$
Select Case choice$
Case "1"
GoSub BusSchedule
Case "2"
GoSub BuyTicket
Case "3"
GoSub DriverLogin
Case "4"
Cls
Color 15, 0
Locate 12, 20: Print "Thank you for using City Bus System!"
Sleep
End
Case Else
Locate 22, 20: Print "Invalid option! Press any key..."
Sleep
End Select
Loop

BusSchedule:
Cls
Color 15, 0
Locate 3, 20: Print "CITY BUS SCHEDULE"
Locate 6, 10: Print "Route No. Departure Arrival Destination Fare (Rs.)"
Locate 8, 10: Print "101 07:00 AM 11:00 AM Pokhara 600"
Locate 10, 10: Print "102 09:30 AM 01:30 PM Dharan 500"
Locate 12, 10: Print "103 01:00 PM 05:00 PM Chitwan 450"
Locate 14, 10: Print "104 04:00 PM 09:00 PM Biratnagar 700"
Locate 16, 10: Print "105 06:00 PM 11:30 PM Butwal 550"
Locate 20, 10: Print "Press any key to return..."
Sleep
Return

BuyTicket:
Cls
Color 15, 1
Dim numTickets As Integer
Dim totalFare As Integer
Dim i As Integer
Locate 5, 10: Print "BUY BUS TICKET"
Locate 7, 10: Input "Enter Passenger Name: ", pname$
Locate 9, 10: Input "Enter Destination (Pokhara/Dharan/Chitwan/Biratnagar/Butwal): ",
dest$
Locate 11, 10: Input "How many tickets do you want to buy? ", temp$
numTickets = Val(temp$)
If numTickets <= 0 Then
Locate 13, 10: Print "Invalid number of tickets! Returning to home..."
Sleep
Return
End If
dest$ = LTrim$(RTrim$(dest$))
destUpper$ = UCase$(dest$)
filename$ = ""
fare = 0
route$ = ""
If destUpper$ = "POKHARA" Then
filename$ = "[Link]": fare = 600: route$ = "101"
ElseIf destUpper$ = "DHARAN" Then
filename$ = "[Link]": fare = 500: route$ = "102"
ElseIf destUpper$ = "CHITWAN" Then
filename$ = "[Link]": fare = 400: route$ = "103"
ElseIf destUpper$ = "BIRATNAGAR" Then
filename$ = "[Link]": fare = 700: route$ = "104"
ElseIf destUpper$ = "BUTWAL" Then
filename$ = "[Link]": fare = 550: route$ = "105"
Else
Locate 13, 10: Print "Invalid destination entered!"
Locate 14, 10: Print "Please try again."
Sleep
Return
End If
totalFare = fare * numTickets
Open filename$ For Append As #1
For i = 1 To numTickets
Locate 13 + i, 10
Print "Enter Seat Number for Ticket #"; i; ": ";
Input seat$
Print #1, pname$; ","; dest$; ","; seat$; ","; fare
Next i
Close #1
Cls
Color 15, 0
Locate 5, 20: Print "TICKETS BOOKED SUCCESSFULLY!"
Locate 7, 12: Print "Passenger Name: "; pname$
Locate 8, 12: Print "Destination : "; dest$
Locate 9, 12: Print "Route Number : "; route$
Locate 10, 12: Print "Tickets Bought: "; numTickets
Locate 11, 12: Print "Fare per Ticket: Rs."; fare
Locate 12, 12: Print "Total Fare : Rs."; totalFare
Locate 14, 12: Print "All ticket info saved in file: "; filename$
Locate 16, 12: Print "Press any key to return to Home..."
Sleep
Return

DriverLogin:
Cls
Color 15, 0
Locate 5, 20: Print "BUS DRIVER LOGIN"
Locate 7, 20: Input "Enter Username: ", user$
Locate 8, 20: Input "Enter Password: ", pass$
driverRoute = 0
filename$ = ""
If user$ = "pokhara" And pass$ = "p123" Then driverRoute = 101: filename$ =
"[Link]"
If user$ = "dharan" And pass$ = "d123" Then driverRoute = 102: filename$ = "[Link]"
If user$ = "chitwan" And pass$ = "c123" Then driverRoute = 103: filename$ =
"[Link]"
If user$ = "biratnagar" And pass$ = "b123" Then driverRoute = 104: filename$ =
"[Link]"
If user$ = "butwal" And pass$ = "bt123" Then driverRoute = 105: filename$ = "[Link]"
If driverRoute = 0 Then
Locate 10, 20: Print "Invalid login! Returning..."
Sleep
Return
End If
Cls
Locate 3, 20: Print "BUS DRIVER PANEL"
Locate 6, 10: Print "You are logged in for Route "; driverRoute
Select Case driverRoute
Case 101: Print " Destination: Pokhara (07:00 AM - 11:00 AM)"
Case 102: Print " Destination: Dharan (09:30 AM - 01:30 PM)"
Case 103: Print " Destination: Chitwan (01:00 PM - 05:00 PM)"
Case 104: Print " Destination: Biratnagar(04:00 PM - 09:00 PM)"
Case 105: Print " Destination: Butwal (06:00 PM - 11:30 PM)"
End Select
Locate 10, 10: Print "Passenger List:"
If filename$ = "" Then
Locate 12, 12: Print "No passengers booked yet."
Else
On Error GoTo FileMissing
Open filename$ For Input As #1
On Error GoTo 0
recCount = 0
Do Until EOF(1)
Line Input #1, rec$
recCount = recCount + 1
pos1 = InStr(rec$, ",")
If pos1 > 0 Then
name$ = Left$(rec$, pos1 - 1)
rest$ = Mid$(rec$, pos1 + 1)
pos2 = InStr(rest$, ",")
If pos2 > 0 Then
dest$ = Left$(rest$, pos2 - 1)
rest2$ = Mid$(rest$, pos2 + 1)
pos3 = InStr(rest2$, ",")
If pos3 > 0 Then
seat$ = Left$(rest2$, pos3 - 1)
fare$ = Mid$(rest2$, pos3 + 1)
Else
seat$ = rest2$
fare$ = ""
End If
Else
dest$ = rest$
seat$ = ""
fare$ = ""
End If
Else
name$ = rec$
dest$ = ""
seat$ = ""
fare$ = ""
End If
Locate 11 + recCount, 12: Print recCount; ". "; name$; " - "; dest$; " (Seat: "; seat$;
") Fare: "; fare$
Loop
Close #1
End If
Locate 24, 15: Print "Press any key to return Home..."
Sleep
Return

FileMissing:
Locate 12, 12: Print "No passengers booked yet."
On Error GoTo 0
Return
Output Screen
Conclusion
A Bus Ticket Booking System is a software application designed to help bus drivers and
workers efficiently run their vehicles. It helps organize and manage various tasks such
as sales , customer information and even employee management. Essentially, it acts as a
digital assistant to make the day to day works of a bus more faster and easier.

Bibliography
1. [Link]
2. [Link]
3. [Link]
4. [Link]
5. [Link]
6. Ms- Paint
7 . [Link]
8 . [Link]

You might also like