botiga.erl
botiga.erl — 1 KB
Continguts del fitxer
-module (botiga). -export ([cost/1, total/1]). cost(taronges ) -> 5; cost(diaris ) -> 8; cost(pomes ) -> 2; cost(prssecs ) -> 9; cost(llet) -> 7. total([{Que, N}|T]) -> botiga:cost(Que) * N + total(T); total([]) -> 0.