Uploaded by Arman's Channel

Learner's Book Answers: Algorithms & Pseudocode

advertisement
Learner’s Book answers
Unit 1
Questions 1.1
1 To design algorithms or programs
2 Program code has syntax that has to be followed, whereas pseudocode is
language-independent
3 All are valid
4 The first is not valid because the text to be output is not in double quotation
marks – it is an English statement and is not like code
Unplugged activity 1.2
1 value1 10 100 88
2 value2 12
3 value3 176
4 value4 44
Questions 1.2
1 Any command such as OUTPUT, PRINT, WRITE
2 It does not use commands or syntax for one specific language, and it can be
understood by all programmers who can write high-level language programs
3 Equals (=) and back arrow (←)
4 first, second, third
5 a 10
b 15
c 99
d0
Programming task 1.7
Investigate 1: Condition: (colour = "red"), if true value = 1, if false value = 2; Boolean operator: NOT
Predict 1: 1
Investigate 2: Conditions: (colour = "red", colour = "blue"), if true value = 1, if false value = 2; Boolean
operator: OR
Predict 2: 1
Investigate 3: Condition 1: (colour1 = "red", colour2 = "blue"), if true value = 1, if false check next condition;
condition 2: (colour2 = "red", colour1 = "purple"), if true value = 2, if false end statement; Boolean operators:
AND, OR
Predict 3:
12
21
30
Questions 1.3
1 (1) Condition, (2) code to run when true and (3) code to run when false
2 IF
3 "Smaller"
4 a "second"
b "same"
c When both values are the same
d When the first number is the larger
e When the
Download