Explorar o código

Add travel cost example

David Peter hai 1 ano
pai
achega
b87cbf01cd
Modificáronse 1 ficheiros con 12 adicións e 0 borrados
  1. 12 0
      examples/travel_cost.nbt

+ 12 - 0
examples/travel_cost.nbt

@@ -0,0 +1,12 @@
+@aliases(nights)
+unit night
+
+let flights = $ 600
+
+let accomodation = 120 $ per night
+let food = 60 $ per night
+let spending_money = 50 $ per night
+
+let total = flights + 10 nights × (accomodation + food + spending_money)
+
+assert_eq(total, $ 2900)