This is probably just me, I'm not really a great comedy fan, but I do like high-concept scifi.
This is probably just me, I'm not really a great comedy fan, but I do like high-concept scifi.
15> c(coffee).
{ok,coffee}
16> coffee:testing().
[{espresso,medium,false,2.5},
{espresso,medium,true,3.5},
{espresso,large,false,3.5},
{espresso,large,true,4.5},
{espresso,xl,false,4.0},
{espresso,xl,true,5.0},
{americano,medium,false,3.0},
{americano,medium,true,4.0},
….
15> c(coffee).
{ok,coffee}
16> coffee:testing().
[{espresso,medium,false,2.5},
{espresso,medium,true,3.5},
{espresso,large,false,3.5},
{espresso,large,true,4.5},
{espresso,xl,false,4.0},
{espresso,xl,true,5.0},
{americano,medium,false,3.0},
{americano,medium,true,4.0},
….
testing () ->
[{Drink, Size, TakeAway, coffee:pricing (Drink, Size, TakeAway)} ||
Drink <- [espresso, americano, latte, cappuchino, mocha, flatWhite],
Size <- [medium, large, xl],
TakeAway <- [false, true]].
testing () ->
[{Drink, Size, TakeAway, coffee:pricing (Drink, Size, TakeAway)} ||
Drink <- [espresso, americano, latte, cappuchino, mocha, flatWhite],
Size <- [medium, large, xl],
TakeAway <- [false, true]].
costOfSize (medium) ->
0.00;
costOfSize (large) ->
1.00;
costOfSize (xl) ->
1.50.
costOfTakeaway (true) ->
1.00;
costOfTakeaway (false) ->
0.00.
costOfSize (medium) ->
0.00;
costOfSize (large) ->
1.00;
costOfSize (xl) ->
1.50.
costOfTakeaway (true) ->
1.00;
costOfTakeaway (false) ->
0.00.
costOfDrink (espresso) ->
2.50;
costOfDrink (americano) ->
3.00;
costOfDrink (latte) ->
2.50;
costOfDrink (cappuchino) ->
3.00;
costOfDrink (mocha) ->
3.50;
costOfDrink (flatWhite) ->
2.50.
costOfDrink (espresso) ->
2.50;
costOfDrink (americano) ->
3.00;
costOfDrink (latte) ->
2.50;
costOfDrink (cappuchino) ->
3.00;
costOfDrink (mocha) ->
3.50;
costOfDrink (flatWhite) ->
2.50.
Part 1:
-module (coffee).
-export ([pricing/3, testing/0]).
pricing (Drink, Size, TakeAway) ->
costOfDrink (Drink) + costOfSize (Size) + costOfTakeaway (TakeAway).
Part 1:
-module (coffee).
-export ([pricing/3, testing/0]).
pricing (Drink, Size, TakeAway) ->
costOfDrink (Drink) + costOfSize (Size) + costOfTakeaway (TakeAway).
In the real world of industry I rapidly losing patience with those who just follow a script rather than being bothered to UNDERSTAND.
In the real world of industry I rapidly losing patience with those who just follow a script rather than being bothered to UNDERSTAND.