Explanation Class Initialization: The AmbulanceBookingSystem class initializes a vector for bookings. Book an Ambulance: The bookAmbulance method takes patient details, creates a booking, and appends it to the bookings vector. View Bookings: The viewBookings method prints all the current bookings. Cancel a Booking: The cancelBooking method updates the status of the specified booking to "Cancelled". Main Loop: The run method provides a simple text-based menu for the user to interact with the system. Step 3: Running the System To run the system, save the code to a C++ file (e.g., ambulance_booking_system.cpp), compile it, and execute it.
sh