Computer sci
Computer sci
Total
otal R Weight Output
1.8 1.8
1 26.0
8.8 7.0
20.1 11.3
30.1 10.0
32.6 2.5
2 25.2
37.6 5.0
57.4 19.8
3 29.3
– 57.4, 3
[5]
2 (a
Trace table set 1
A B C D E F Total Check Output
5 2 4 3 1 5 38 5 Accept
3 2 1 0 7 3 45 1 Reject
(c) 1 mark for identifying the problem, 2 marks for the solution
Problem – doesn’t deal correctly with remainder 10/a check digit of X
Solution – check Z for X as a final digit
– have a special case where check = 10
– accept where Check = 10 and F = X [3]
3
0 0
1.8 1.8
1 26.0
8.8 7.0
20.1 11.3
30.1 10.0
32.6 2.5
2 25.2
37.6 5.0
57.4 19.8
3 29.3
–1 57.4, 3
[5]
Question Answer Marks
4(a) 4
Value
Value C Calc2 OUTPUT
50
0 16
33
3 11
18
8 6 1
15
5 5
30
0 10
0
4(b)
(b) two correct statements e.g. 2
• The program outputs a value
• That is divisible by 6 // 2 and 3
Question Answer Marks
PointsWon
PointsWon Po Difference OUTPUT
5000
000 526 Keep on trying
-1 67
5(b)
(b) three from: 3
• Add extra decision box …
• … before checking for difference greater than or equal to 1000
// change Is difference >= 1000 to >= 1000 and <= 5000
• Check for difference greater than 5000
• Add extra Output ‘Fantastic leap up two levels’…
• … before flowline returns to input
Question Answer Marks
6 5
Flag
lag Num Divisor Value OUTPUT
False 5
5 is prime
False 6
True 3 2
True 4
False 8
True 3 2
True 4 2
False 0
50
0 0 Accept: Extreme
75
5 25 Accept: Normal
99
9 49 Accept: Normal
28 Reject: Abnormal
82
2 32 Accept: Normal
–1
Secret Reject
Secret Reject
VerySecret
VerySecret V Accept
999 Reject
Op
Op Value Value2 Ans OUTPUT
1
87
14 101
3
2
30 60
5
10
6 Input Error
4
10
2 5
0
Question Answer Marks
9(c) To output/store the result/the value of Ans // Adding prompts for data entry. 1
MP1
1 correct Counter and Limit columns
MP2
2 correct Value column
MP3
3 correct First column
MP4
4 correct Last column
MP5
5 correct OUTPUT
0 0 8
1 6
2 60 6 606
3 622
4 844
5 64 2
6 74 7 747
7 7
8 12 1 121
10(b) One mark per mark point, max two 2
checks for / outputs 3-digit numbers
… where the first and last digit are the same
0 0
1 1 75
2 2 78
3 3 84
4 1 87 Too Hot
5 2 91 Too Hot
6 4 80
7 5 75
8 6 70
9 7 65
10 1 62 Too Cold
-1 30 30
11(b) include a message to explain the value output / e. g. “The percentage of meals not served” // 1
outputting Hot, Cold and Serve
Store
In Logi Test Number Count L Out OUTPUT
[Count]
0 5
1 TRUE 2 9
3
FALSE
2 TRUE 2 5
3 5
3 TRUE 2 8
FALSE
4 TRUE 2 10
FALSE
5 TRUE 2 7
3 7 2 5
1 7
Question Answer Marks
OR
1 F
Another Letter? (Y or N)
1 D
Another Letter? (Y or N)
13(b)
(b) (Line search 1
Or
The array would run out of values after the pointer reached 13
the algorithm will crash
Question Answer Marks
10 1 5 7 11
0 1 10
1 2 1 10 10
1 5 10 10
1 7 10
0 1
T
Total
otal V Ten1 Ten2 OUTPUT
5 1 0.5 Rejected
50
50 1 5 5
50 5 10.4 Rejected
5
555
55 1 55 55.5 Rejected
57 11 11.4 Rejected
500 1 50 50
550 –1 550