marking4/postfix_test8.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Mon, 30 Nov 2020 12:58:37 +0000
changeset 381 116fa3c8584f
parent 288 65731df141a5
permissions -rw-r--r--
updated duration class
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
288
65731df141a5 updated
Christian Urban <urbanc@in.tum.de>
parents: 257
diff changeset
     1
import CW9a._
257
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
assert(compute(syard(split("3 + 4 * ( 2 - 1 )"))) == 7)
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
assert(compute(syard(split("10 + 12 * 33"))) == 406)
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
assert(compute(syard(split("( 5 + 7 ) * 2"))) == 24)
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
assert(compute(syard(split("5 + 7 / 2"))) == 8)
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
assert(compute(syard(split("5 * 7 / 2"))) == 17)
ba4d976ca88d updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
assert(compute(syard(split("9 + 24 / ( 7 - 3 )"))) == 15)