Question 1 2016 · May-June · Paper 23 · 8 marks
Reveal official mark-scheme answer
Official answer for Question 1
(i)
Show text version of question
Question 1
Zara wants to write a temperature conversion program. The program is to output a table to show Fahrenheit temperatures and their Celsius equivalents.
She writes the program specification:
- input lower bound and upper bound of Fahrenheit temperatures (whole numbers only)
- input temperature interval (whole number only)
- output conversion table (Celsius temperatures rounded to the nearest whole number)
Example conversion table with lower bound 50, upper bound 90 and interval 5:
Conversion Table Fahrenheit Celsius 50 10 55 13 : : : : 90 32
The steps to convert a Fahrenheit temperature to a Celsius temperature are:
- subtract 32 from the Fahrenheit temperature
- multiply by 5
- divide by 9
(i)
Zara writes pseudocode that uses the variables in the identifier table below.
Complete the identifier table.
Identifier Data type Explanation
Lower bound value of Fahrenheit LowerTemp temperatures
Upper bound value of Fahrenheit UpperTemp temperatures
The interval between two successive Interval Fahrenheit temperatures in the table
The Fahrenheit temperature value to Fahrenheit be converted
Value of conversion to Celsius Result before rounding
Celsius The rounded Result
Question 3
(ii)
The built-in function ROUND(x) returns x rounded to the nearest whole number.
Complete the pseudocode to print the conversion table:
INPUT LowerTemp
INPUT UpperTemp
INPUT Interval
OUTPUT " Conversion Table"
OUTPUT "Fahrenheit Celsius"
Fahrenheit ← .....................................................................................................................
REPEAT
Result ← .......................................................................................................................
........................................................................................................ ← ROUND(Result)
OUTPUT Fahrenheit, " ", Celsius
Fahrenheit ← ...............................................................................................................
UNTIL Fahrenheit > ..........................................................................................................
Why this question appears here
71% assigned-topic match · Programming › Programming basics
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9691_s16_qp_23.pdf
