0% found this document useful (0 votes)
20 views8 pages

Anus Oop Project 3rd Sem Final

Uploaded by

Anus Babar
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)
20 views8 pages

Anus Oop Project 3rd Sem Final

Uploaded by

Anus Babar
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/ 8

Project Title: -

“Transportation Management System”


Group Members: -
Anus Babar (231499)
Maaz Baig (231503)
Muhammad Abdullah (231533)
Q) What is transportation management system?

A Transportation Management System (TMS) in the context of Object-Oriented Programming


(OOP) is a software application designed to manage transportation-related activities. It typically
involves organizing and optimizing the movement of goods or people from one location to
another. Below is a detailed explanation of what a TMS entails and how OOP principles can be
applied to its design.

Key Components of a Transportation Management System

1. Vehicles: Represents the means of transportation (e.g., trucks, buses, trains).


2. Drivers: Represents the individuals operating the vehicles.
3. Trips: Represents specific journeys or routes taken by vehicles and drivers.
4. Passengers: Represents the individuals traveling in the vehicles (if applicable).
5. Fare Management: Handles pricing for transportation services.

Features of a TMS

• Scheduling: Organizing trips based on availability of vehicles and drivers.


• Route Optimization: Finding the most efficient routes to minimize travel time and costs.
• Passenger Management: Keeping track of passenger details and bookings.
• Fare Calculation: Determining the cost of trips based on various factors.
• Reporting: Generating reports for performance analysis and decision-making.
Flow chart: -

Start: - Initialize TMS: Add Vehicle: -

Begin the process. Create an instance of the TMS • Input vehicle details
class
(license plate, model,
capacity).
• Store the vehicle in
the TMS.

Input Trip Details Add Driver: -


Create Trip
Ask for start location. Input driver details
Initialize a Trip (name, license number).
object with the Ask for end location. Store the driver in the
provided details. TMS.
Ask for fare rate per
• passenger.

Check Capacity Input Passenger Names


Calculate Fare
Input number of Loop to input passenger
passengers. names up to the specified Call the calculate Fare
number. () method in the Trip
If passengers exceed class.
vehicle capacity, display
an error and end process.

Display Trip Information


End
Call the display All ()
method in the TMS class
Finish the process.
to show vehicle, driver,
and trip details.
C++ Program: -
Output: -

Explanation of the Program: -

This C++ program models a Transportation Management System that manages vehicles, drivers,
trips, and passengers. It allows users to input trip details and calculates the fare based on the
number of passengers.

Key Components of the Program

1. Vehicle Class:
o Attributes:
▪ license Plate: A string representing the vehicle's license plate.
▪ model: A string for the vehicle's model.
▪ capacity: An integer indicating how many passengers the vehicle can
hold.
o Methods:
▪ Constructor to initialize the vehicle's data.
▪ display (): Outputs the vehicle's details.
▪ get Capacity (): Returns the vehicle's capacity.
Driver Class:

• Attributes:
o name: A string for the driver's name.
o license Number: A string for the driver's license number.
• Methods:
o Constructor to initialize the driver's data.
o Display (): Outputs the driver's details.

Trip Class:

• Attributes:
o Start Location and end Location: Strings for the trip's start and end points.
o vehicle: An instance of the Vehicle class.
o driver: An instance of the Driver class.
o passengers: A vector to store the names of passengers.
o Fare Rate: A double representing the fare rate per passenger.
o Total Fare: A double to hold the total fare for the trip.
• Methods:
o Constructor to initialize a trip with its details.
o Add Passenger (): Adds a passenger's name to the list.
o Calculate Fare (): Computes the total fare based on the number of passengers.
o Display (): Outputs details of the trip, including passengers and total fare

TMS Class:

• Attributes:
o vehicles, drivers, and trips: Vectors to store vehicles, drivers, and trips
respectively.
• Methods:
o Add Vehicle (): Adds a vehicle to the system.
o Add Driver (): Adds a driver to the system.
o Schedule Trip (): Schedules a trip by adding it to the trips vector.
o Display All (): Displays all vehicles, drivers, and trips in the system.

Main Function

1. Initialization:
o Creates an instance of the TMS class.
o Creates a Vehicle and a Driver, and adds them to the TMS.
2. User Input:
o Prompts the user to enter the start and end locations of the trip.
o Asks the user for the fare rate per passenger.
3. Trip Creation:
o Initializes a Trip object with the user-provided details.
o Checks if the number of passengers exceeds the vehicle's capacity.
o Prompts the user to enter the names of the passengers.
4. Fare Calculation:
o Calls calculate Fare () to compute the total fare based on the number of
passengers.
5. Display Results:
o Calls display All () to show all vehicles, drivers, and the trip details, including
the total fare.

Conclusion: -

The Transportation Management System (TMS) program effectively models the management of
vehicles, drivers, trips, and passengers using object-oriented programming principles. It allows users to
input trip details, calculate fares based on passenger counts, and display comprehensive trip
information. This modular design promotes easy maintenance and scalability, making it suitable for real-
world applications in transportation logistics. Overall, the TMS serves as a foundational example of how
software can streamline transportation operations.

You might also like