F#, pattern matching + Option to make it at least a little interesting:
letcoffeeprice=price|>function|2.2->Some"Americano"|2.3->Some"Latte"|2.4->Some"Flat white"|3.5->Some"Filter"|_->None|>Option.map(sprintf"Here is your %s, have a nice day!")|>Option.defaultValue"Sorry, exact change only, try again tomorrow!"
F#, pattern matching +
Option
to make it at least a little interesting:Just perfect!