Zohotaxi
Zohotaxi
#include <vector>
#include <cmath> // For abs
#include <limits> // For numeric_limits
#include <algorithm> // For find
public:
Booking(int id, int pickup, int drop, int pTime, int dTime, double amt)
: customerId(id), pickupPoint(pickup), dropPoint(drop),
pickupTime(pTime), dropTime(dTime), amount(amt) {}
public:
Taxi() : taxiId(++idGenerator), totalEarnings(0), currentPoint(0) {}
public:
TaxiBookingSystem() {
taxis.reserve(numTaxis); // Reserve space for taxis
for (int i = 0; i < numTaxis; ++i) {
taxis.push_back(Taxi()); // Initialize taxis
}
}
int main() {
TaxiBookingSystem bookingSystem;
// Sample bookings
bookingSystem.bookTaxi(1, 'A', 'B', 9);
bookingSystem.bookTaxi(2, 'B', 'D', 9);
bookingSystem.bookTaxi(3, 'B', 'C', 12);
return 0;
}