0% found this document useful (0 votes)
50 views1 page

Coding 2 Answers

iAS Alogorithm Answers

Uploaded by

randomsites7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views1 page

Coding 2 Answers

iAS Alogorithm Answers

Uploaded by

randomsites7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Cambridge International AS & A Level Computer Science Answers

End of chapter questions


1 See Key terms 9.2.
2 See Section 9.1.
3 See Section 9.2.5.
4 a) 40 b) 314.2 c) Z not declared error d) True.
5 a) i) 13 or 14 ii) 07, 11 or 19 iii) 01 to 24
b)
Identifier Name Description
Choice Store Menu Choice
Temperature Store temperature input
ConvertedTemperature Store converted temperature

c) Use a variable Try

01 Try  0
02 REPEAT
03 OUTPUT" Menu Temperature Conversion"
04 OUTPUT" Celsius to Fahrenheit 1"
05 OUTPUT" Fahrenheit to Celsius 2"
06 OUTPUT" Exit 3"
07 OUTPUT" Enter choice"
08 IF Choice = 1 OR Choice = 2
09 THEN
10 OUTPUT"Enter temperature"
11 INPUT Temperature
12 IF Choice = 1
13 THEN
14 ConvertedTemperature  1.8*Temperature + 32
15 ELSE
16 ConvertedTemperature  (Temperature – 32) * 5 / 9
17 ENDIF
18 OUTPUT "Converted temperature is ", ConvertedTemperature
19 ELSE
20 IF Choice <> 3
21 THEN
22 OUTPUT "Error in choice"
23 Try  Try + 1
24 ENDIF
25 ENDIF
26 UNTIL Choice = 3 OR Try = 3

Cambridge International AS & A Level Computer Science 15


© Helen Williams and David Watson 2020

You might also like