Professional Documents
Culture Documents
DSA Sample - Arshad
DSA Sample - Arshad
This brief assignment checklist is designed to help you avoid some of the most common
mistakes students make in their coursework.
HAVEYOUREADTHE SSIGNMENT BRIEF?
IF NOT, DO IT NOW!
Inityou will find details of the assessment task, word count, the assessment criteria your work is marked
against ,and the learning outcomes– the basis for the assessment strategy in each module.
TICK
Have you read and understood the assessment criteria?
Have you met the learning outcomes? You will lose marks and your work
may even be failed if you have not.
Have you checked that the USB memory stick being submitted is working and
has all necessary files saved to it?
Have you demonstrated you can think and write critically in the completed
work? This means you have supported your arguments/explanations
appropriately e.g. using relevant academic sources and you have offered
discussion points which extends your own or others’ viewpoints to make
reasoned conclusions/ judgements.
Have you maintained an academic tone throughout your work? Is your
work formal, focused, developed and clear?
Have you checked that the referencing in your assignment is in line
with your programme requirements?
Have you proof-read your work and used spell check software to check
your spelling and grammar?
Have you kept to the word count (or equivalent)? If you are not sure, check
with your tutor.
Can you confirm that the work submitted is your own and not plagiarised?
Acknowledgement
I would like to thank my parents first and foremost. They have given their fullest corporation
to finish this assignment. Directress of my company, Ms Pathmaseeli, she gave valuable
guidance and advice throughout the assignment. In addition, she allowed working leaves for
me for extra studying and complete my assignment. She inspired me greatly to work in this
assignment and project.
Besides, we would like to thank bus drivers and conductors, who work in bus route numbers
100 and 87 for providing me bus environment situation, issues of bus ticket bookings etc.
Finally, an honorable mention goes to friends for their supports to complete this project.
Without above mentioned people’ helps, I would face lot of difficulties while doing assignment
and project.
Table of contents
5. Evaluation ...........................................................................................................................16
5.1 Evaluation and strengths of the system ......................................................................16
5.2 Weaknesses of the system ..........................................................................................16
5.3 Future development opportunities ..............................................................................16
6. Conclusion ..........................................................................................................................17
1. Proposed system
1.1 Introduction
Intercity bus ticket booking system has been one of the main
concerns in Central Colombo, Sri Lanka. This will be a growing
demand as well as a new trend in moving to online intercity bus ticket
booking systems. According to introducing this system, passenger’s
self-interaction in ticket booking will be changed in a positive way.
However, Central Colombo Point (CCP) is the busiest place in Sri
Lanka. All bus routes, covering every districts have been linked from
here. Usually, more than five hundred (500) journeys will be started
from here per day and nearly a hundred thousand (100,000) passenger will be travelled across
this point.
When buses arrived at the CCP, then all buses to be entered into the system. Bus
number, bus route, starting time, destination, destination time and ticket fee to be inserted. All
intercity buses are 20 seated passenger buses. Located of seats structure will be displayed front
of ticket center, hence passenger easy to book their preferred seat without any hesitation.
Nowadays manual tickets or digital ticketing issuing equipment are being used by the
transportation sector. Specially digital ticket issuing equipment will be popular among the
intercity buses. Only a few data could be stored in digital machines. Some of them are the
amount of cash collected for each trip, the number of issued tickets. Tickets issuing to be done
only for cash. As commonly not difficult to issue fake intercity bus tickets. Passengers won’t
be received a balance bus fare from conductors.
Earlier, complains have been received from passengers and bus owners regarding bus
ticket issues. Available buses couldn’t have been seen by passenger, different ticket prices have
been charged by bus conductors, conductors haven’t responded the ticket issues, arguments
between passengers and bus conductors have been seen frequently, available bus seats couldn’t
be checked by bus conductors, starting time and destination time have been decided by bus
drivers and conductors as their convenience and profit. If the not satisfied amount of passengers
1|Page
inside the bus, they have taken extra time to start the bus. If bus drivers want to run an extra
journey, they would have tried to complete the journey prior to destination time.
At daytime, intercity buses can be seen on roads once in 10 minutes running to every
area of Sri Lanka. During working hours, specially morning 8am – 9am and 5pm – 7pm
intercity buses will be run once two minutes, sometime two or three buses will be started at the
same time. Every driver is preferred to drive during that period. Hence, arguments will be
begun among drivers. But at night period, it will be changed totally. Passengers are on roads
and waiting for buses. But buses won’t be seen for a long time, sometimes passengers had to
wait more than two hours until the bus arrives at the bus point. Specially buses not work at
mid-night because only a few passengers are there. Bus owners not much like to run their buses
at mid-night considering profit.
Parking space available for only hundred buses at a time. Cause of this point lot of buses
will have to park outside of parking place. Some buses are parked on main roads some are
returned to their home. When they park on roads illegally, they will have to pay fines.
2|Page
2. Data Structure
2.1 What is the data structure?
Data structure will be used to turn abstract data into a specialized format such as
organizing, processing, retrieving and storing data. There are several data structure types, some
are basic types and some are advanced types, which will be devised to solve complex hard
search problems.
3|Page
3. UML Diagrams
4|Page
3.2 Entity relationship diagram for “intercity bus ticket booking” system.
5|Page
3.3. Class diagram for “intercity bus ticket booking” system.
6|Page
3.4 Activity diagram for “intercity bus tickets booking” system.
7|Page
3.5 Use case diagram for “intercity bus tickets booking” system.
8|Page
4. CODING & SCREEN SHOTS
4.1 Inserting of bus details
When bus arrived to “intercity bus station”, following details of bus to be entered to system.
Code
// Entering bus details
void ticketbooking::Insert()
{
cout << "\n\t\t\t ENTER BUS NUMBER : \t";
cin >> bus[p].busNo;
cout << "\n\t\t\t START FROM : \t"; cout << "COLOMBO \n";
9|Page
Visual Studio C++ console
Code
void ticketbooking::booking()
{
int seat;
char number[10];
top:
cout << "\n\t\t\t ENTER BUS NUMBER: ";
10 | P a g e
cin >> number;
int n;
for (n = 0; n <= p; n++)
{
if (strcmp(bus[n].busNo, number) == 0)
break;
}
// Bus ticket fare will be displayed according to the bus number
cout << "\n\t\t\t TICKET FARE : " << bus[n].ticketprice << endl;
while (n <= p)
{
cout << "\n\t\t\t SEAT NUMBER: ";
cin >> seat;
if (seat>20)
{
cout << "\n\t\t\t Sorry! There are only 20 seats available in
this bus. ";
}
else
{
if (strcmp(bus[n].seat[seat / 4][(seat % 4) - 1], "-") == 0)
{
//passenger name to be entered
cout << "\n\t\t\t PASSENGER'S NAME: ";
cin >> bus[n].seat[seat / 4][(seat % 4) - 1];
break;
}
else
cout << "\n\t\t\t Sorry! This seat has been reserved by a
passenger";
}
}
if (n>p)
{
cout << "\n\t\t\t Sorry! This is not valid Bus Number\n";
goto top;
}
}
11 | P a g e
4.3 When passenger try to book a over the 20th seat
4.4 When passenger try to book a not available seat (not vacant).
12 | P a g e
4.5 Checking of available seats in a bus
Code
//Checking of available seats in a bus
void ticketbooking::display()
{
int n;
char number[5];
cout << "\n\t\t\t ENTER BUS NUMBER: ";
cin >> number;
cout <<
"\n\t\t\t************************************************************************\n";
cout << "\n \t\t\t BUS NUMBER : \t" << bus[n].busNo
<< "\t\t ROUTE NUMBER : \t" << bus[n].routeNo << "\n"
<< "\n\t\t\t BUS START TIME :" << bus[n].startTime << "\t\t Bus
Destination Time :" << bus[n].destinationTime
<< "\n \t\t\t FROM: \t\t" << "COLOMBO" << "\t\t To: \t\t"
<<bus[n].to << "\n";
cout <<
"\n\t\t\t************************************************************************\n";
bus[0].position(n);
int ticketbooking = 1;
for (int i = 0; i<5; i++)
{
for (int j = 0; j<4; j++)
{
ticketbooking++;
if (strcmp(bus[n].seat[i][j], "-") != 0)
cout << "\n \t\t\t SEAT NUMBER " << (ticketbooking
- 1) << " FOR " << bus[n].seat[i][j] << ".";
}
}
break;
}
if (n>p)
cout << " t\t\t Sorry! This is Not valid Bus Number ";
}
void ticketbooking::position(int l)
{
int s = 0; p = 0;
for (int i = 0; i<5; i++)
{
cout << "\n \t\t\t";
for (int j = 0; j<4; j++)
13 | P a g e
{
s++;
if (strcmp(bus[l].seat[i][j], "-") == 0)
{
cout.width(5);
cout.fill(' ');
cout << s << ".";
cout.width(10);
cout.fill(' ');
cout << bus[l].seat[i][j];
p++;
}
else
{
cout.width(5);
cout.fill(' ');
cout << s << ".";
cout.width(10);
cout.fill(' ');
cout << bus[l].seat[i][j];
}
}
}
cout << "\n\n\t\t\t NUMBER OF AVAILABLE SEATS " <<p;
}
14 | P a g e
4.6 Available buses list
Code
//Available buses list
void ticketbooking:: availableBuses()
{
cout << "\n\t\t\t****************************************************\n";
cout << "\t\t\t\t BUSES LIST \n";
cout << "\n\t\t\t****************************************************\n";
for (int n = 0; n<p; n++)
{
cout << "\n BUS ROUTE NO: \t" << bus[n].routeNo;
cout << "\n BUS NO: \t" << bus[n].busNo<<"\t\t TICKET FARE :
RS."<<bus[n].ticketprice;
cout << "\n FROM:\t COLOMBO" << "\t\t START TIME :" << bus[n].startTime
<< "\t\t To: "<<bus[n].to << "\t\t DESTINATION TIME :" <<
bus[n].destinationTime<<endl;
cout<<"-------------------------------------------------------------\n";
}
}
15 | P a g e
5. Evaluation
5.1 Evaluation and strengths of the system
As the proposed system, the several critical issues of facing both passengers and bus
owners will be solved. All intercity buses will be registered to system and bus owners will be
received details of their routes and starting time once a week. They should have come at least
before 20 minutes to Colombo Central Point. Every 10 minutes new bus group will have arrived
at the parking venue as a limitation of 100 buses. Hence bus drivers will haven’t suffer from
parking issues, no fines.
Every bus tickets will be issued by CCP. Hence, bus conductors won’t be waste their
time. Passengers could have buy tickets meanwhile their leisure times even they can use credit
cards for payment. As well as passengers have the ability to book their preferred seat numbers.
Tickets issues, seat booking issues, arguments between bus conductors and passengers won’t
have happened.
Every journey has starting time and destination time (approx.) however it won’t be
broken by bus drivers without any considerable reasons, otherwise, bus drivers will have to
pay fines. It avoids very late destination, it would be good for passengers to end their journey
without any delay.
16 | P a g e
6. Conclusion
According to the given scenario, intercity bus ticket booking system has been implemented
using the C++ language. Several data structures types have been used for the implementation
of this system, which l learned under the data structures and algorithm subject. This system can
be prevented from several issues, which is having an existing system as described under the
1.2 current system issues. System implementation and its usage have been explained using
screenshots and coding under main number 4. Codes & screenshots.
17 | P a g e