calculated spending money

used array to calculate spending money