All pastes #791649 Raw Edit

Mine

public text v1 · immutable
·published 2007-11-21 00:26 UTC
rendered paste body
while (File) {
		search= FindFlight(flightNo, 20, flightnumb);
		if (search ==-1){
			cout << "Invalid Flight Number" << endl;
		} else {
			if (type==2){
				// cancel a flight
				if (seats > bookings [search])
					cout << seats << " seats were not cancled from flight "<< flightnumb << " (excess of seats booked)"<< endl;
				else {
						bookings[search]-=seats;
						cout << seats << " seats subtracted from flight " << flightnumb << endl;
				}
			} else if (type==1){
				// add a flight
				bookings[flightnumb]+=seats;
				cout << seats << " seats added to flight " << flightnumb << endl;
			} else cout << "Transaction Type Invalid" << endl;
		}
		File >> type >> flightnumb >> seats;
	}