Created
September 18, 2014 02:28
-
-
Save pumpkincouture/51500401ba98693b8ca9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def lay_over_two | |
@origin == "B" && @destination == "Z" || @origin != "A" && @destination != "B" && @destination != "Z" | |
end | |
def find_total_price(first_leg, second_leg, third_leg) | |
if second_leg == [] | |
total_price = first_leg.get_price + third_leg.get_price | |
elsif second_leg == third_leg | |
total_price = first_leg.get_price + second_leg.get_price | |
else | |
total_price = first_leg.get_price + second_leg.get_price + third_leg.get_price | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment