looping_arrays_5.rb
#Given an array of prices, subtract each price from the customer's account balance
Given an array of prices, subtract each price from the customer's account balance
Given an array of prices subtract each price from the customer ' s account balance
def refund (prices)
  amount = 0
  index = 0
  while index < prices.length
    amount -= prices[index] 
    index += 1 
  end
  amount 
end
def refund ( prices ) amount = 0 index = 0 while index < prices . length amount -= prices [ index ] index += 1 end amount end
Given an array of prices, subtract each price from the customer's account balance
Given an array of prices subtract each price from the customer ' s account balance
#subtract the current price #move to the next price #return the total refund
prices