marking4/output
author Christian Urban <christian.urban@kcl.ac.uk>
Sun, 15 Jan 2023 10:58:13 +0000
changeset 459 7acbef680bef
parent 300 be9900ba65ff
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
257
71e534e28430 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
300
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
     2
postfix.scala does not contain vars, returns, Arrays, ListBuffers etc?
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
     3
  --> success
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
     4
postfix.scala runs?
257
71e534e28430 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
  --> success
300
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
     6
 syard(split("3 + 4 * ( 2 - 1 )")) == List("3", "4", "2", "1", "-", "*", "+")
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
     7
 syard(split("( ( ( 3 ) ) + ( ( 4 + ( 5 ) ) ) )")) == List("3", "4", "5", "+", "+")
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
     8
 syard(split("5 + 7 / 2")) == List("5", "7", "2", "/", "+")
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
     9
 syard(split("5 * 7 / 2")) == List("5", "7", "*", "2", "/")
257
71e534e28430 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
  --> success
300
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    11
 compute(syard(split("3 + 4 * ( 2 - 1 )"))) == 7
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    12
 compute(syard(split("10 + 12 * 33"))) == 406
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    13
 compute(syard(split("( 5 + 7 ) * 2"))) == 24
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    14
 compute(syard(split("5 + 7 / 2"))) == 8
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    15
 compute(syard(split("5 * 7 / 2"))) == 17
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    16
 compute(syard(split("9 + 24 / ( 7 - 3 )"))) == 15
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    17
  --> success
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    18
postfix2.scala does not contain vars, returns, Arrays, ListBuffers etc?
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    19
  --> success
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    20
postfix2.scala runs?
257
71e534e28430 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
  --> success
300
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    22
 syard(split("3 + 4 * ( 2 - 1 )")) == List("3", "4", "2", "1", "-", "*", "+")
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    23
 syard(split("( ( ( 3 ) ) + ( ( 4 + ( 5 ) ) ) )")) == List("3", "4", "5", "+", "+")
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    24
 syard(split("5 + 7 / 2")) == List("5", "7", "2", "/", "+")
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    25
 syard(split("5 * 7 / 2")) == List("5", "7", "*", "2", "/")
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    26
 syard(split("3 + 4 * 8 / ( 5 - 1 ) ^ 2 ^ 3")) == 
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    27
         List("3", "4", "8", "*", "5", "1", "-", "2", "3", "^", "^", "/", "+")
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    28
 
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    29
 compute(syard(split("3 + 4 * ( 2 - 1 )"))) == 7
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    30
 compute(syard(split("10 + 12 * 33"))) == 406
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    31
 compute(syard(split("( 5 + 7 ) * 2"))) == 24
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    32
 compute(syard(split("5 + 7 / 2"))) == 8
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    33
 compute(syard(split("5 * 7 / 2"))) == 17
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    34
 compute(syard(split("9 + 24 / ( 7 - 3 )"))) == 15
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    35
 compute(syard(split("4 ^ 3 ^ 2"))) == 262144
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    36
 compute(syard(split("4 ^ ( 3 ^ 2 )"))) == 262144
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    37
 compute(syard(split("( 4 ^ 3 ) ^ 2"))) == 4096
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    38
 compute(syard(split("( 3 + 1 ) ^ 2 ^ 3"))) == 65536
257
71e534e28430 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
  --> success
300
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    40
Overall mark for CW 9, Preliminary Part
be9900ba65ff updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 288
diff changeset
    41
4