lOMoARcPSD|31822966 Java project final B.Sc. Applied Physics (Centurion University of Technology and Management) Scan to open on Studocu Studocu is not sponsored or endorsed by any college or university Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 “BUS RESERVATION AND TICKETING SYSTEM” A Project report submitted In the partial fulfillment the award of degree of BACHELOR OF TECHNOLOGY IN COMPUTER SCIENCE AND ENGINEERING (2020-2025) BY V. HARSHITH – 211801390035 A. DHANUSH – 211801360004 K. MANOHAR – 211801390034 E. AYYAPPA - 211801340018 Y. NARAYANARAO – 211801340008 Under the esteemed Guidance of Mrs.ANURADHA.P, M.Tech,(Ph.D) Assistant Professor CENTURION UNIVERSITY OF TECHNOLOGY & MANAGEMENT Rollavaka village, Tekkali mandal 535003 (2022-2023) Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 CENTURION UNIVERSITY OF TECHNOLOGY AND MANAGEMENT (CUTM-AP) VIZIANAGARAM DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CERTIFICATE This is to certify that the project work entitled “BUS RESERVATION AND TICKETING SYSTEM” is a fulfillment of project work done by V.Harshith (Reg.No.211801390035), A.Dhanush (Reg.No.211801360004), K.Manohar (Reg.No.211801390034), E.Ayyappa (Reg.No.211801340018), Y.Narayanarao (211801340008) for the award the degree of BACHELOR OF TECHNOLOGY in COMPUTER SCIENCE AND ENGINEERING, during academic year 2022-2023. INTERNAL GUIDE HEAD OF THE DEPARTMENT Mrs.ANURADHA.P, M.TECH,(Ph.D) (Ph.D) R. LAKSHMANA RAO,M.TECH, ASSISTANT PROFESSOR ASSISTANT PROFESSOR DEPTARTMENT OF CSE DEPTARTMENT OF CSE Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 External Examinar ACKNOWLEDGEMENT It is with most pleasure and excitement we submit our project partial fulfillment of the requirement for the award of Bachelor of Technology. The project is a result to the cumulate efforts, support, guidance, encouragement and inspiration from many of those for whom we have to give our truthful honor and express gratitude through bringing out this project at the outset as per our knowledge. I convey my special thanks to Mrs. P. ANURADHA, M. Tech, (Ph.D.) Asst. Professor who has guided, encouraged and of this tremendously supported me to enhance my knowledge with present working of this project to bring out enriching the quality of project. I express my appreciativeness to Mr. R. LAKSHMAN RAO (Asst. Prof.) and Head of the Department, who facilitated us to providing the friendly environment which helped to enhance my skills in present project. I would also like to extend my gratitude to Dr. K. V. G. KRISHNA MURTHY, Dean-School of Engineering and Technology, Centurion University of Technology and Management who has helped us to attain all the requirements of the project. At the outset, we thank to Sri. G. S. N. RAJU, beloved Vice Chancellor of Centurion University of Technology and Management who is the back bone by providing for completion of this project, Thank you sir. Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 DECLARATION We hereby declare that the project entitled “BUS RESERVATION AND TICKETING SYSTEM” submitted to the fulfilment of award the degree of B.TECH (CSE) at CENTURION UNIVERSITY OF TECHNOLOGY AND MANAGEMENT(ANDHARA PRADESH). The project work is original has not been submitted so far in any part or full for any other university or institute for award of any degree or diploma. V. HARSHITH – 211801390035 A. DHANUSH – 211801360004 K. MANOHAR – 211801390034 E. AYYAPPA - 211801340018 Y. NARAYANARAO – 211801340008 Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 ABSTRACT The bus transportation industry is evolving rapidly, and the need for an efficient, secure, and convenient ticketing system has become more crucial than ever. A bus reservation and ticketing system is an innovative software application that enables customers to book bus tickets online or through a mobile application. The system simplifies the ticketing process, reduces waiting times, and improves the overall customer experience. Overall, a bus reservation and ticketing system is an essential tool for any modern transportation company that wants to stay ahead of the competition and provide a seamless customer experience. The system has revolutionized the way bus transportation companies manage their operations and provide their services, making it an indispensable technology for the industry. Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 INDEX 1. Introduction 2. System Analysis 2.1 Existing system 2.2 Proposed system 2.3 System requirements 3. Methodology 3.1 System architecture 3.2 Algorithm description 3.3 Modular design 4. Implementation 5. Output 6. Conclusion 7. Biblography S.no Title Downloaded by prachi Dabhade (prachidabhade18@gmail.com) Pg.no lOMoARcPSD|31822966 Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 1.INTRODUCTION A bus reservation and ticketing system is a software application that enables customers to book bus online or through a mobile application. The system is designed to simplify the ticketing process, reduce waiting times, and improve the overall customer experience. With a bus reservation and ticketing system, customers can search for bus routes, schedules, and availability, select their preferred seats, and make payments securely online. The system provides real-time information on bus availability, schedules, and pricing, enabling customers to make informed decisions quickly and easily. Bus operators can use the system to manage their schedules and routes, allocate seats, and monitor ticket sales and revenue. They can also generate reports on key metrics such as sales, revenue, and customer feedback, enabling them to optimize their operations and improve the customer experience. The benefits of a bus reservation and ticketing system are numerous. It can reduce costs associated with traditional ticketing methods, improve customer satisfaction, and increase revenue through online sales. With the rise of mobile technology, more and more customers are looking for convenient and secure ways to book bus tickets online, making a bus reservation and ticketing system an essential tool for any modern transportation company. Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 2.SYSTEM ANALYSIS 2.1 Existing System Before the advent of online booking systems, the bus reservation and ticketing system relied on traditional methods, such as over-the-counter ticket sales or phone reservations. These methods were time-consuming, inconvenient, and often resulted in long queues and waiting times for customers. They offer several advantages over traditional methods, including: 1. Convenience: Customers can book tickets from the comfort of their homes or offices, without the need to visit a physical ticket counter. 2. Real-time information: Online booking systems provide customers with real-time information on bus availability, schedules, and pricing, enabling them to make informed decisions quickly and easily. 3. Security: Online payment gateways provide secure and reliable payment options, reducing the risk of fraud and ensuring customer confidence. 4. Accessibility: Online booking systems are accessible 24/7, allowing customers to book tickets at any time of the day or night. 2.2 Proposed System A proposed bus reservation and ticketing system would aim to enhance the existing system by introducing new features and functionalities that further streamline the ticketing process and improve the customer experience. Some of the proposed features and functionalities of a bus reservation and ticketing system could include: 1. Mobile application: A mobile application would allow customers to book and manage their bus tickets on the go, from their smartphones. The mobile app could provide features such as real-time notifications, GPS tracking, and user-friendly interfaces. Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 2. Customizable booking options: Customers could have the option to customize their bookings by selecting preferred pick-up and drop-off locations, choosing their preferred bus type, and selecting their preferred seats. 3. Virtual assistant: A virtual assistant could be introduced to provide customers with personalized recommendations and support, such as suggesting nearby hotels or restaurants. 4. Dynamic pricing: The system could use dynamic pricing algorithms to adjust ticket prices based on factors such as demand, time of day, and seat availability, enabling bus operators to optimize revenue and occupancy rates. 5. Loyalty programs: A loyalty program could be introduced to incentivize customers to book tickets through the system, offering discounts, rewards, or other perks for frequent users. By incorporating the latest technologies and industry best practices, the proposed system would help bus operators to stay ahead of the competition and provide a seamless, efficient, and convenient ticketing experience for their customers. 2.3 System Requirements 2.3.1 Hardware Requirements 1.Servers 2.Network infrastructure 3.Workstations 4.Mobile devices 5.POS terminals(point-of-sale) 2.3.2 Software Requirements 1.Web development tools 2.Database management system Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 3.payment gateway 4.Operating system 5.Mobile Development tools 6.Analytics tools It is essential to ensure that the software components are reliable, secure, and scalable to ensure the system's smooth and uninterrupted operation. Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 3.METHODOLOGY 3.1 System architecture 3.2 Algorithm description The algorithm used in a bus reservation and ticketing system typically involves several steps to ensure that the booking process is efficient, accurate, and user-friendly. Here is an example of a typical algorithm used in a bus reservation and ticketing system: 1. Bus Schedule Management: The system should have a database of all available bus schedules, which can be accessed by customers through the web or mobile application. 2. Seat Selection: The system should allow customers to select seats on the bus through an interactive seat map. The system should also prevent double booking of seats and ensure that the selected seats are available. Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 3. Customer Registration: The system should require customers to register on the system to make a booking. Customer registration should involve capturing customer details such as name, email address, phone number, and payment information. 4. Payment Processing: The system should allow customers to make online payments using debit/credit cards or mobile wallets. The payment processing should be secure and compliant with industry standards and regulations. 5. Ticket Generation: Once the booking is confirmed and the payment is processed, the system should generate a digital ticket or receipt, which can be accessed by the customer through the web or mobile application. The system should also allow customers to print the ticket or receipt. 6. Boarding Validation: The system should validate the ticket or receipt at the time of boarding using a scanner or QR code reader. The system should also ensure that the customer has a valid ticket or receipt before allowing them to board the bus. The algorithm used in a bus reservation and ticketing system should be designed to ensure a seamless and user-friendly booking process while minimizing errors and conflicts. The algorithm should also be flexible enough to accommodate future changes and updates to the system's functionality and features. 3.3 Modular design Modular design is a popular approach for software development as it allows for easier maintenance, scalability, and flexibility. When designing a bus reservation and ticketing system, a modular design can help to create a more efficient and streamlined system. Here are some possible modules that could be included in the system: 1. User Management: This module handles user registration, authentication, and authorization. It can include features such as password management, account verification, and user roles. 2. Bus Management: This module manages the buses available for reservation, including their routes, schedules, and seating plans. It Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 can include features such as adding, editing, and deleting buses, setting their capacity, and managing their availability. 3. Reservation Management: This module handles the reservation of seats on the buses. It can include features such as seat selection, payment processing, and confirmation emails. 4. Ticketing Management: This module manages the creation and printing of tickets. It can include features such as ticket design, barcode generation, and ticket tracking. 5. Reporting Management: This module generates reports on system usage, including user activity, bus utilization, and revenue generation. It can include features such as customizable report templates and data visualization tools. Each of these modules can be designed and implemented independently, allowing for easier testing, maintenance, and updates. Additionally, modular design allows for the addition or removal of modules without affecting the entire system, providing greater flexibility for future changes. Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 4.IMPLEMENTATION Code: import java.io.*; class BusReservationAndTicketingSystem { public static void main(String args[]) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String user,password,yn,search,again,choice; int to=0,y=1,z=0,end=0,r=1; int available[] = new int[6]; int ticketI[][] = new int [100][3]; String ticketS[][] = new String[100][3]; double ticketD[][] = new double [100][3]; double pay[] = new double[20]; double change[] = new double[20]; for(int i=1;i<4;){ System.out.print("Enter Username: "); user = in.readLine(); System.out.print("Enter Password: "); password = in.readLine(); for(int o=1; o<=5; o++){ available[o]=20; Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 } if(user.equals("Nobitha_123") && password.equals("shizuka_143")){ for(int x=1; x==1;){ //the MAIN MENU// System.out.println("****************************"); System.out.println("** BUS TICKETING SYSTEM **"); System.out.println("****************************"); System.out.println("** [1] Destination **"); System.out.println("** [2] Buy Ticket **"); System.out.println("** [3] Transaction **"); System.out.println("** [4] View System.out.println("** [5] Exit **"); **"); System.out.println("****************************"); System.out.println("****************************\n"); for(x=1; x==1;){ System.out.print("ENTER CHOICE: "); choice=in.readLine(); if (choice.equals("1")){ System.out.println("***************************************"); System.out.println("** DESTINATION | FARE | SEAT **"); Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 System.out.println("***************************************"); System.out.println("** 1.)Eluru | Rs12 | "+available[1]+" **"); System.out.println("** 2.)Vijayawada | Rs15 | "+available[2]+" **"); System.out.println("** 3.)Guntur | Rs12 | "+available[3]+" **"); System.out.println("** 4.)Rajamundry | Rs16 | "+available[4]+" **"); System.out.println("** 5.)Vizag | Rs18 | "+available[5]+" **"); System.out.println("***************************************"); System.out.println("***************************************\n"); System.out.println("PWD, STUDENT, & SENIOR CITIZEN with 20% DISCOUNT!!!\n"); x=0; } else if (choice.equals("2")){ int print=1; System.out.println("***************************************"); System.out.println("** DESTINATION | FARE | SEAT **"); Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 System.out.println("***************************************"); System.out.println("** 1.)Eluru | Rs12 | "+available[1]+" **"); System.out.println("** 2.)Vijayawada | Rs15 | "+available[2]+" **"); System.out.println("** 3.)Guntur | Rs12 | "+available[3]+" **"); System.out.println("** 4.)Rajamundry | Rs16 | "+available[4]+" **"); System.out.println("** 5.)Vizag | Rs18 | "+available[5]+" **"); System.out.println("***************************************"); System.out.println("***************************************\n"); System.out.println("PWD, STUDENT, & SENIOR CITIZEN with 20% DISCOUNT!!!\n"); if((available[1]==0)&&(available[2]==0)&&(available[3]==0)&&(available[4]==0)&&( available[5]==0)){ System.out.println("Sorry, We don't have available seats for all Destination!"); x=0; } else{ for(x=1; x==1;){ Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 System.out.print("\nENTER PASSENGER'S NAME: "); ticketS[z][0] = in.readLine(); x=0; for(int l=0; l<z; l++){ if(ticketS[l] [0].equalsIgnoreCase(ticketS[z][0])){ System.out.println("Sorry, Passenger's name have already used!"); x=1; } } } for(x=1; x==1;){ System.out.print("ENTER DESTINATION [number]: "); to = Integer.parseInt(in.readLine()); if(to<1 || to>5){ System.out.println("Invalid Input!"); x=1; } for(int d=1; d<=5; d++){ Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 if(to==d){ if(available[to]==0){ System.out.println("Sorry, We don't have available seat!"); x=1; } x=0; } } } String dest[] = { " ", "Eluru", "Vijayawada", "Guntur", "Rajamundry", "Vizag"}; double fare[] = { 0,12,15,12,16,18}; //converted integer to string, transfer to storage array// ticketS[z][1] = dest[to]; ticketD[z][0] = fare[to]; //inputing for Number of Passenger's// for(x=1; x==1;){ System.out.print("HOW MANY PASSENGERS ARE YOU?: "); ticketI[z][0] = Integer.parseInt(in.readLine()); //subtract the available seat by the the number inputed// for(int p=1; p<=5; p++){ Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 if(to==p){ print=1; available[to] = available[to]ticketI[z][0]; if(available[to]<0){ System.out.print("Sorry, We don't have seat available for " +ticketI[z][0] +" person\n"); available[to] = available[to]+ticketI[z][0]; System.out.print("We only have " +available[to] +" seat available\n"); x=1; print=0; } else{ x=0; } } } } for(x=1;x==1;){ System.out.print("HOW MANY PASSENGERS HAVE DISCOUNT?: "); ticketI[z][1] = Integer.parseInt(in.readLine()); Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 if(ticketI[z][1]>ticketI[z][0]){ System.out.println("Invalid Input!"); System.out.println("No. of Passengers are only " +ticketI[z][0] +"!"); x=1; } else{ break; } } if(print==1){ System.out.println("\n***************************************"); System.out.println("** DETAILS PASSENGER'S **"); System.out.println("***************************************"); System.out.println("PASSENGER'S NAME: " + ticketS[z][0]); System.out.println("PASSENGER'S DESTINATION : " + ticketS[z][1]); System.out.println("FARE PRICE: Rs" + ticketD[z][0]); System.out.println("NO. OF PASSENGERS: " + ticketI[z][0]); Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 System.out.println("NO. OF PASSENGERS WITH DISCOUNT: " + ticketI[z][1]); System.out.println("***************************************"); System.out.println("***************************************\n"); ticketS[z][2]="0"; double discount=(ticketD[z][0]-(ticketD[z] [0]*0.2))*ticketI[z][1]; ticketD[z][2]= ((ticketI[z][0]-ticketI[z] [1])*ticketD[z][0])+discount; x=0; } z++; } } else if (choice.equals("3")){ for(x=1; x==1;){ System.out.print("ENTER PASSENGER'S NAME: "); search = in.readLine(); int s=1; for(int b=0;b<z;b++){ if(search.equalsIgnoreCase(ticketS[b][0])){ Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 System.out.println("***************************************"); System.out.println("** PASSENGER'S DETAILS **"); System.out.println("***************************************"); System.out.println("PASSENGER'S NAME: " + ticketS[b][0]); System.out.println("PASSENGER'S DESTINATION : " + ticketS[b][1]); System.out.println("FARE PRICE: Rs" + ticketD[b][0]); System.out.println("NO. OF PASSENGERS: " + ticketI[b][0]); System.out.println("NO. OF PASSENGERS WITH DISCOUNT: " + ticketI[b] [1]); System.out.println("***************************************"); System.out.println("***************************************"); s=0; x=0; if(ticketS[b] [2].equals("x")){ System.out.println("Passenger's Already Paid!"); x=0; } else{ ticketS[b] [2]="x"; Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 for(x=1; x==1;){ System.out.println("\nPASSENGER'S TOTAL FARE: Rs"+ticketD[b][2]); System.out.print("ENTER AMOUNT TO PAY: "); pay[b] = Double.parseDouble(in.readLine()); change[b]=pay[b]-ticketD[b][2]; if(change[b]<0){ System.out.println("Invalid Input!"); x=1; } else{ System.out.println("CHANGE: Rs"+change[b]); System.out.println(""); x=0; } } } } } Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 if (s==1){ System.out.println("\nPASSENGER'S NAME NOT FOUND!\n"); for(int q=1; q==1;){ System.out.print("Do you wish to continue with this transaction? [Y/N]: "); again=in.readLine(); if(again.equalsIgnoreCase("y")){ q=0; } else if (again.equalsIgnoreCase("n")){ q=0; x=0; } else{ System.out.println("\nInvalid input!\n"); } } } } } Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 else if (choice.equals("4")){ for(int sx=1; sx<=3;){ System.out.print("SEARCH PASSENGER'S NAME: "); search = in.readLine(); int s=1; for(x=0; x<=z; x++){ if(search.equalsIgnoreCase(ticketS[x][0])){ System.out.println("***************************************"); System.out.println("** PASSENGER'S DETAILS **"); System.out.println("***************************************"); System.out.println("PASSENGER'S NAME: " + ticketS[x][0]); System.out.println("PASSENGER'S DESTINATION : " + ticketS[x][1]); System.out.println("FARE PRICE: Rs" + ticketD[x][0]); System.out.println("NO. OF PASSENGERS: " + ticketI[x][0]); System.out.println("NO. OF PASSENGERS WITH DISCOUNT: " + ticketI[x][1]); System.out.println("TOTAL FARE PRICE: Rs" + ticketD[x][2]); if(ticketS[x][2].equals("x")){ Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 System.out.println("PAY: Rs" +pay[x]); System.out.println("CHANGE: Rs" +change[x]); System.out.println("STATUS: PAID"); } else{ System.out.println("STATUS: NOT PAID"); } System.out.println("***************************************"); System.out.println("***************************************"); s=0; sx=4; } } if (s==1){ System.out.println("Passenger's Name not found!"); sx++; } } } else if(choice.equals("5")){ Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 end=1; x=0; System.out.println("Thank You!"); } else{ System.out.println("Invalid Input!"); x=1; } } for(y=1; y==1;){ if(end==1){ break; } System.out.print("Do you want another transaction? [Y/N]: "); yn = in.readLine(); if (yn.equalsIgnoreCase("y")){ x=1; y=0; } else if (yn.equalsIgnoreCase("n")){ System.out.println("\nThank You!!!"); break; } else{ System.out.println("Invalid Input!!!"); Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 y=1; } } } i=4; } else{ System.out.println("\nInvalid user or password!\n"); i++; } } } } Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 5.OUTPUT Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 6.CONCLUSION A bus reservation and ticketing system provides many benefits for both bus operators and passengers. Bus operators can increase their efficiency and revenue, while passengers can enjoy a more convenient and hassle-free booking experience. The system can also help reduce fraudulent activities and improve data accuracy, making it a win-win situation for all parties involved. Overall, the adoption of such systems has been increasing rapidly, and it is likely to become a standard practice in the bus transportation industry in the coming years. Downloaded by prachi Dabhade (prachidabhade18@gmail.com) lOMoARcPSD|31822966 7.BIBLOGRAPHY References: https://www.my.dmd.uconn.edu https://www.angleritech.com https://www.oneclickitsolution.com Downloaded by prachi Dabhade (prachidabhade18@gmail.com)