adric: books icon (c) 2004 adric.net (Default)
adric ([personal profile] adric) wrote2008-06-02 12:45 am

Ruby is against me going

>> @gas_price = 4.00
=> 4.0
>> @atl_bos = 1076
=> 1076
>> @hotel_nights = 6
=> 6
>> @hotel_fee = 60
=> 60
>> @tank_size=14.50
=> 14.5
>> @miles_per_gallon=20
=> 20
>> @roundtrip = 2*@atl_bos
=> 2152
>> @range = @tank_size * @miles_per_gallon
=> 290.0
>> @tank = @tank_size * @gas_price
=> 58.0
>> @tank = @tank_size * @gas_price
=> 58.0
>> @range = @tank_size * @miles_per_gallon
=> 290.0
>> @gas_buys =  @roundtrip / @range
=> 7.42068965517241
>> (@hotel_fee * @hotel_nights) + (@gas_buys * @tank)
=> 790.4

I'm not sure the exact value of @prohibatively_expensive but ..

[livejournal.com profile] arie pointed out an error in the math, recalculating:

>> @hotel_nights = 7
=> 7
>> (@hotel_fee * @hotel_nights) + (@gas_buys * @tank)
=> 850.4

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org