objectCoffeeShop{privatelazyvalcoffees=Map(2.2->"Americano",2.3->"Flat white",2.4->"Latte",3.5->"Filter")//desired method
defmakeCoffee(change:Double):String={coffees.get(change).fold("Sorry, exact change only, try again tomorrow!"){coffee=>s"Here is your $coffee, have a nice day!"}}}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Scala: