0% found this document useful (0 votes)
25 views15 pages

Abstract

The document presents a mini project report on a Bus Ticket Reservation System developed as part of a programming course. It outlines the system's objectives, which include automating ticket bookings, providing real-time seat availability, and enhancing user experience. The report also includes an introduction to C programming, its applications, and the implementation details of the bus reservation system.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views15 pages

Abstract

The document presents a mini project report on a Bus Ticket Reservation System developed as part of a programming course. It outlines the system's objectives, which include automating ticket bookings, providing real-time seat availability, and enhancing user experience. The report also includes an introduction to C programming, its applications, and the implementation details of the bus reservation system.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

An Autonomous Intuition Under VTU


BANGALORE INSTITUTE OF TECHNOLOGY
K.R. Road, V.V. Pura, Bengaluru-560 004
2024-25

Principal of Programming in C (BPOPS103)


Mini Project Report
on
THE SANKE GAME
Submitted by
Roll no.5 Prajjwal Kumar

Roll no.39 Shashank N

Under the Guidance of


Prof Vidya R
Assistant Professor
COMPUTER SCIENCE, BIT
Bengaluru-560004
ABSTRACT

ne Bus Ticket Reservation System is a web-based application designed to facilitate the


booking of bus tickets. The problems facing the company are that customers have to go to the
counter to buy a bus ticket and will also have to queue up for along time to secure a bus
ticket.

The program employs frameworks to organize data for buses, passengers, and users.
Providing a web-based bus ticket reservation function where a customer can buy a bus ticket
through the online system without a need to queue up at the counter to purchase a bus
ticket. This system operates within a centralized network, allowing users to check seat
availability, book tickets online and to view bus booked seats.

Bus Reservation System is a tool that allows users to book tickets for their journey in
advance. It offers multiple features to provide a hassle-free experience to a traveler. The
profit of any transportation company that uses this system will be increased because the
online system will attract more customers and no need to hire many staff at the counter to sell
bus tickets.

In the long-term operation, the financial turnout from the sales of tickets is expected to
increase as passengers' satisfaction is almost guaranteed with the availability of accurate
information, shorter queues, and better services

CSE,BANGALORE INSTITUE OF TECHNOLOGY 1


Chapter 1 Introduction

1.1 Introduction of C Programming

C is a general-purpose programming language created by Dennis Ritchie at the Bell


Laboratories in 1972.

It is a very popular language, despite being old. The main reason for its popularity is because
it is a fundamental language in the field of computer science.

Computers can understand machine language written in O's & I's. The instructions given to
the computer in terms of O's &t's is called Machine Language. Even though machine
language can be understood by the computer, it is Very difficult for us to understand & hence
difficult to give the instructions to the computer in machine language.To overcome these
disadvantages we prefer high level language such as C .

C programming is one of the most populas computer programming languages that allow
users to create instruction for a computer to execute some task

1.2 Applications of C Programming

C programming language is widely used in various applications due to its efficiency,


flexibility, and close interaction with hardware. Here are some key areas where C
programming is applied:

 Embedded Systems: C is often used to program small, low-power devices designed


to perform specific tasks, such as controlling motors or monitoring sensors.

 Operating Systems: Many operating systems, including Windows, Linux, and


macOS, are developed using C due to its ability to handle low-level system functions.

 Compilers: C is used to develop compilers for other programming languages, such as


GCC (GNU Compiler Collection).

 Web Servers: Applications like Apache HTTP server and Nginx web server are
written in C.

CSE,BANGALORE INSTITUE OF TECHNOLOGY 2


Chapter 1 Introduction

 Databases: Database management systems like MySQL and PostgreSQL are


developed using C.

 Graphics and Gaming: C is used in the development of 2D and 3D graphics and


gaming applications, including popular games and game engines.

 Network Devices: C is used to develop network devices and protocols.

 IDEs and GUIs: Integrated Development Environments (IDEs) and Graphical User
Interfaces (GUIs) are often developed using C, such as Adobe Photoshop and other
Adobe products.

 Interpreters: C is used to create interpreters for other programming languages, such


as the Python interpreter.

 Compilers for Other Languages: Compilers for languages like C++, Java, and
others are often written in C.

 System Software: C is used to develop system software, including compilers and


assemblers.

1.3 Introduction of project

The introduction of a Bus Reservation System (BRS) project, often referred to as a PopC
(Popular Computing) project, aims to streamline and automate the process of booking bus
tickets. This system is designed to provide users with an efficient and user-friendly interface
to check seat availability, book tickets, and manage reservations online.The system typically
includes features such as:

 Seat Availability: Provides real-time updates on seat availability for different bus
routes and schedules.

 Ticket Booking: Enables users to select their preferred route and seats, and book
tickets for their desired travel dates.

 View Booked seats

CSE,BANGALORE INSTITUE OF TECHNOLOGY 3


Chapter 1 Introduction

1.4 Objective of the project

The objective of a bus reservation system project, such as the PopC project, is to automate
and streamline the process of booking bus tickets. This system aims to reduce manual
work, minimize errors, and provide a more efficient and user-friendly experience for both
customers and administrators.

Key objectives include:

 Providing functionalities for seat availability checks, ticket booking, and checking
booked seats
 Ensuring data integrity and security.
 Offering real-time updates and easy access to information for customers.
 Reducing the need for paper-based seat booking and improving overall operational
efficiency.
 Facilitating easier management

CSE,BANGALORE INSTITUE OF TECHNOLOGY 4


Chapter 2 Modules and Methods used

2.1 Module name1 and Methods

5
CSE,BANGALORE INSTITUE OF TECHNOLOGY
Chapter 2 Modules and Methods used

2.2 Module name2 and Method

6
CSE,BANGALORE INSTITUE OF TECHNOLOGY
Chapter 3 Implementation

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#define MAX_SEATS 40

#define MAX_NAME_LENGTH 50

typedef struct {

int seatNumber;

char passengerName[MAX_NAME_LENGTH];

int isBooked;

} Seat;

void initializeSeats(Seat seats[], int totalSeats) {

for (int i = 0; i < totalSeats; i++) {

seats[i].seatNumber = i + 1;

seats[i].isBooked = 0;

strcpy(seats[i].passengerName, "");

void displayAvailableSeats(Seat seats[], int totalSeats) {

printf("\nAvailable Seats:\n");

for (int i = 0; i < totalSeats; i++) {

if (!seats[i].isBooked) {

printf("Seat %d is available\n", seats[i].seatNumber);

CSE,BANGALORE INSTITUE OF TECHNOLOGY


7
Chapter 3 Implementation

void bookSeat(Seat seats[], int totalSeats) {

int seatNumber;

char name[MAX_NAME_LENGTH];

printf("\nEnter the seat number to book (1-%d): ", totalSeats);

scanf("%d", &seatNumber);

if (seatNumber < 1 || seatNumber > totalSeats) {

printf("Invalid seat number. Please try again.\n");

return;

if (seats[seatNumber - 1].isBooked) {

printf("Seat %d is already booked by %s.\n", seatNumber, seats[seatNumber -


1].passengerName);

return;

printf("Enter passenger name: ");

scanf(" %[^\n]s", name);

CSE,BANGALORE INSTITUE OF TECHNOLOGY


8
Chapter 3 Implementation

seats[seatNumber - 1].isBooked = 1;

strcpy(seats[seatNumber - 1].passengerName, name);

printf("Seat %d successfully booked for %s.\n", seatNumber, name);

void displayBookedSeats(Seat seats[], int totalSeats) {

printf("\nBooked Seats:\n");

for (int i = 0; i < totalSeats; i++) {

if (seats[i].isBooked) {

printf("Seat %d: %s\n", seats[i].seatNumber, seats[i].passengerName);

int main() {

int choice;

const int totalSeats = MAX_SEATS;

Seat seats[MAX_SEATS];

initializeSeats(seats, totalSeats);

while (1) {

printf("\n=== Bus Reservation System ===\n");

printf("1. View Available Seats\n");

printf("2. Book a Seat\n");


8

CSE,BANGALORE INSTITUE OF TECHNOLOGY


9
Chapter 3 Implementation

printf("3. View Booked Seats\n");

printf("4. Exit\n");

printf("Enter your choice: ");

scanf("%d", &choice);

switch (choice) {

case 1:

displayAvailableSeats(seats, totalSeats);

break;

case 2:

bookSeat(seats, totalSeats);

break;

case 3:

displayBookedSeats(seats, totalSeats);

break;

case 4:

printf("Exiting... Thank you for using the Bus Reservation System!\n");

exit(0);

default:

printf("Invalid choice. Please try again.\n");

return 0;

}
8

CSE,BANGALORE INSTITUE OF TECHNOLOGY


10
Chapter 4 Flowchart

start

Initialise
seats

Switch
(choice)

Display seats available


if seatnumber<1||
seatnumber>1 Display booked seats Exiting... Thank Invalid
you choice.
for using the Please
Bus
try again
Reservation
Print System
If
invalid seat no. (seats[seatNumber-1].
Please try again isBooked

Seat no .()is Enter passenger


already booked name
by ()

end
8

CSE,BANGALORE INSTITUE OF TECHNOLOGY


11
Chapter 5 Results

1)Checking Availability of seats

CSE,BANGALORE INSTITUE OF TECHNOLOGY


12
Chapter 5 Results

2)Booking Seats and checking booked seats

CSE,BANGALORE INSTITUE OF TECHNOLOGY


13
Chapter 5 Results

3)Exit

CSE,BANGALORE INSTITUE OF TECHNOLOGY


14

You might also like