Question 7
OCR Computer Science June 2018 Paper 1AS6 marks
On the specification
- 2.2 Problem solving and programming2.3 Algorithms
Question text
7 A meteorologist sets up a weather station to monitor temperatures throughout the year. She classifies temperatures in one of four bands: Band Temperature Range (degrees Celsius) Band A 10 or below Band B 11–20 Band C 21–30 Band D 31 or above The weather station records the temperature every day as an integer. At the end of the year the temperatures are stored in an array called temperatures. Write a program in pseudocode that reads through this array and produces an output which shows the total number of days within each band. An example of such an output is shown below. Band A: 93 Band B: 143 Band C: 98 Band D: 31 Ensure your code is efficient. [6]