Let's assume that you're looking for an iteration : you want a simple calculation ( with a rate of interest which doesn't change ) to apply on a depositamount which changes every months. As your asking is quite unclear ( that's why you're getting these downvotes ), you might want to clarify it a lot if the following is not answering your question.
monthly_deposits = [deposit1, deposit2, deposit3... ]
Ruby
monthly_deposits.each do |deposit|
puts deposit * rate of interest * 30/365
end
Rails
<% monthly_deposits.each do |deposit| %>
<%= deposit * rate of interest * 30/365 %>
<% end %>
But if that's what you were asking, you probably need to read some tutoriels.