A one-dimensional (1D) array Days[] contains the names of the days of the week. A two-dimensional (2D) array Readings [] is used to store 24 temperature readings, taken once an hour, for each of the seven days of the week. A 1D array AverageTemp[] is used to store the average temperature for each day of the week. The position of any day's data is the same in all three arrays. For example, if Wednesday is in index 4 of Days [], Wednesday's temperature readings are in index 4 of Readings[] and Wednesday's average temperature is in index 4 of AverageTemp[] The temperature readings are in Celsius to one decimal place. Temperatures can only be from -20.0°C to +50.0°C inclusive. Write a program that meets the following requirements: • input and validate the hourly temperatures for one week • calculate and store the average temperature for each day of the week • calculate the average temperature for the whole week • convert all the average temperatures from Celsius to Fahrenheit by using the formula Fahrenheit = Celsius * 9/5 + 32 • output the average temperature in Celsius and in Fahrenheit for each day • output the overall average temperature in Celsius and in Fahrenheit for the whole week. You must use pseudocode or program code and add comments to explain how your code works. You do not need to declare any arrays, variables or constants; you may assume that this has already been done. All inputs and outputs must contain suitable messages. All data output must be rounded to one decimal place. You will need to initialise and populate the array Days [] at the start of the program.
- A one-dimensional (1D) array Days[] contains the names of the days of the week. A two-dimensional (2D) array Readings [] is used to store 24 temperature readings, taken once an hour, for each of the seven days of the week. A 1D array AverageTemp[] is used to store the average temperature for each day of the week. The position of any day's data is the same in all three arrays. For example, if Wednesday is in index 4 of Days [], Wednesday's temperature readings are in index 4 of Readings[] and Wednesday's average temperature is in index 4 of AverageTemp[] The temperature readings are in Celsius to one decimal place. Temperatures can only be from -20.0°C to +50.0°C inclusive. Write a program that meets the following requirements: • input and validate the hourly temperatures for one week • calculate and store the average temperature for each day of the week • calculate the average temperature for the whole week • convert all the average temperatures from Celsius to Fahrenheit by using the formula Fahrenheit = Celsius * 9/5 + 32 • output the average temperature in Celsius and in Fahrenheit for each day • output the overall average temperature in Celsius and in Fahrenheit for the whole week. You must use pseudocode or program code and add comments to explain how your code works. You do not need to declare any arrays, variables or constants; you may assume that this has already been done. All inputs and outputs must contain suitable messages. All data output must be rounded to one decimal place. You will need to initialise and populate the array Days [] at the start of the program.[15]
Mark scheme
Marking points from the official mark scheme (May/June 2023). The mark or mark type is shown in brackets.
- [9] AO2: Apply knowledge and understanding of the principles and concepts of computer science to a given context, including the analysis and design of computational or programming problems. (Assessment based on bands 0, 1-3, 4-6, 7-9 as per MS page 17)
- [6] AO3: Provide solutions to problems by: evaluating computer systems, making reasoned judgements, presenting conclusions. (Assessment based on bands 0, 1-2, 3-4, 5-6 as per MS page 18)
- [] Data structures required: Arrays or lists Days[], Readings[], AverageTemp[]
- [] Data structures required: Variables WeekLoop, DayLoop, InTemp, TotalDayTemp, TotalWeekTemp, AverageWeekTemp
- [] Requirements (techniques) R1: Input and store hourly temperatures and validation of input temperatures for each day (with prompts, range check and (nested)iteration)
- [] Requirements (techniques) R2: Calculate, round to one decimal place and store daily average temperatures and calculate the weekly average temperature rounded to one decimal place (iteration, totalling and rounding)
- [] Requirements (techniques) R3: Convert all average temperatures to Fahrenheit (to one decimal place) and output the average temperatures in both Celsius and Fahrenheit. Output with appropriate messages. (output and rounding)
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →