2210_w23_qp_23
A paper of Computer Science, 2210
Questions:
10
Year:
2023
Paper:
2
Variant:
3

Login to start this paper & get access to powerful tools

3
4
5
6
8
9
A sanctuary for pheasants has set up a new database table called PheasantList to store details of the different species of bird at the sanctuary. Part of this table is given, showing: species, description, number of birds at the sanctuary, if the birds are breeding or not, and number of young born this year. Species Description NumberBirds Breeding Young Edwards blue-black with white tail Yes Japanese green dark green with pale grey tail Yes Reeves golden, white and red scaled plumage Yes Crawfords Kalij glossy blue-black plumage No Crested fireback blue-black with black tail No True silver white laced top half and black lower half Yes Siamese fireback grey plumage with crimson legs and feet No Mikado iridescent plumage with white striped wings Yes Red junglefowl many colours Yes Himalayan monal many colours with metallic green crest Yes White eared white with ear tufts Yes Brown eared brown with ear tufts Yes Ring necked long tail with white ring neck Yes Golden rainbow coloured Yes State the number of records and fields in this part of the database table. Records Fields Give the name of a field that could be used for the primary key. Explain why the sanctuary might decide not to use the field in as the primary key. A new field SpeciesID is added to the database table. This field contains a six-character code, for example Ph0001. Give a reason why this field would be a better primary key. Write the output that would be given by this structured query language (SQL) statement: SELECT Species, Description FROM PheasantList WHERE NumberBirds > 6; Complete this SQL statement to display all the species of pheasant where the birds are breeding and there were no young born this year: SELECT FROM WHERE ;
10
A weather station takes temperature readings once an hour for a week. These temperatures are stored in a two-dimensional (2D) array Temperatures[] Each column contains 24 readings for a single day. The first temperature is recorded at 00:00 and the final temperature at 23:00. There are seven columns, one for each day of the week, starting with Monday and ending with Sunday. The variables MaxDay, MinDay and AvDay are used to store the maximum, minimum, and average temperatures for a day. The variables MaxWeek, MinWeek and AvWeek are used to store the maximum, minimum, and average temperatures for the week. The array has already been set up and the data stored. Write a program that meets the following requirements: • finds the maximum and minimum temperatures for each day • calculates the average temperature for each day • outputs for each day: – name of the day, for example Monday – maximum temperature – minimum temperature – average temperature • finds the maximum and minimum temperatures for the week • calculates the average temperature for the week • outputs: – maximum temperature for the week – minimum temperature for the week – average temperature for the week. All temperatures output must be rounded to two decimal places. You must use pseudocode or program code and add comments to explain how your code works. All inputs and outputs must contain suitable messages. You do not need to declare any arrays or variables; you may assume that this has already been done. You do not need to initialise the data in the array Temperatures[]