Skip to content

Instantly share code, notes, and snippets.

@raymcdermott
Created February 12, 2011 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raymcdermott/823987 to your computer and use it in GitHub Desktop.
Save raymcdermott/823987 to your computer and use it in GitHub Desktop.
Java (OO) style
private val items = new HashMap[CartItem, Int]
def getTotalItemFees : Double = {
var sum = 0.0
for (item <- items)
sum += (item._1.getFee() * item._2)
sum
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment