# Sample CoffeeScript — samplefiles.com
class Customer
  constructor: (@id, @name, @balance) ->

  isVip: -> @balance >= 10000

customers = [
  new Customer(1, 'Ada', 12500)
  new Customer(2, 'Grace', 830.5)
  new Customer(3, 'Linus', 10000)
]

for c in customers
  console.log "#{c.name.padEnd(6)} #{c.balance.toFixed(2).padStart(10)} #{if c.isVip() then 'VIP' else ''}"

total = customers.reduce(((sum, c) -> sum + c.balance), 0)
console.log "Total: #{total.toFixed(2)}"
