257
|
1 |
|
300
|
2 |
postfix.scala does not contain vars, returns, Arrays, ListBuffers etc?
|
|
3 |
--> success
|
|
4 |
postfix.scala runs?
|
257
|
5 |
--> success
|
300
|
6 |
syard(split("3 + 4 * ( 2 - 1 )")) == List("3", "4", "2", "1", "-", "*", "+")
|
|
7 |
syard(split("( ( ( 3 ) ) + ( ( 4 + ( 5 ) ) ) )")) == List("3", "4", "5", "+", "+")
|
|
8 |
syard(split("5 + 7 / 2")) == List("5", "7", "2", "/", "+")
|
|
9 |
syard(split("5 * 7 / 2")) == List("5", "7", "*", "2", "/")
|
257
|
10 |
--> success
|
300
|
11 |
compute(syard(split("3 + 4 * ( 2 - 1 )"))) == 7
|
|
12 |
compute(syard(split("10 + 12 * 33"))) == 406
|
|
13 |
compute(syard(split("( 5 + 7 ) * 2"))) == 24
|
|
14 |
compute(syard(split("5 + 7 / 2"))) == 8
|
|
15 |
compute(syard(split("5 * 7 / 2"))) == 17
|
|
16 |
compute(syard(split("9 + 24 / ( 7 - 3 )"))) == 15
|
|
17 |
--> success
|
|
18 |
postfix2.scala does not contain vars, returns, Arrays, ListBuffers etc?
|
|
19 |
--> success
|
|
20 |
postfix2.scala runs?
|
257
|
21 |
--> success
|
300
|
22 |
syard(split("3 + 4 * ( 2 - 1 )")) == List("3", "4", "2", "1", "-", "*", "+")
|
|
23 |
syard(split("( ( ( 3 ) ) + ( ( 4 + ( 5 ) ) ) )")) == List("3", "4", "5", "+", "+")
|
|
24 |
syard(split("5 + 7 / 2")) == List("5", "7", "2", "/", "+")
|
|
25 |
syard(split("5 * 7 / 2")) == List("5", "7", "*", "2", "/")
|
|
26 |
syard(split("3 + 4 * 8 / ( 5 - 1 ) ^ 2 ^ 3")) ==
|
|
27 |
List("3", "4", "8", "*", "5", "1", "-", "2", "3", "^", "^", "/", "+")
|
|
28 |
|
|
29 |
compute(syard(split("3 + 4 * ( 2 - 1 )"))) == 7
|
|
30 |
compute(syard(split("10 + 12 * 33"))) == 406
|
|
31 |
compute(syard(split("( 5 + 7 ) * 2"))) == 24
|
|
32 |
compute(syard(split("5 + 7 / 2"))) == 8
|
|
33 |
compute(syard(split("5 * 7 / 2"))) == 17
|
|
34 |
compute(syard(split("9 + 24 / ( 7 - 3 )"))) == 15
|
|
35 |
compute(syard(split("4 ^ 3 ^ 2"))) == 262144
|
|
36 |
compute(syard(split("4 ^ ( 3 ^ 2 )"))) == 262144
|
|
37 |
compute(syard(split("( 4 ^ 3 ) ^ 2"))) == 4096
|
|
38 |
compute(syard(split("( 3 + 1 ) ^ 2 ^ 3"))) == 65536
|
257
|
39 |
--> success
|
300
|
40 |
Overall mark for CW 9, Preliminary Part
|
|
41 |
4
|