script to calculate total trip cost