A program to manage regular flight details at an airport requires some user-defined data types.
- (a)Write pseudocode statements to declare the enumerated data type Aircraft to hold data about the types of aircraft used for a flight. These types of aircraft are: C300, C350, D242, E757, X380.[2]
- (b)Write pseudocode statements to declare the composite data type Flight to hold data about flights to a specific destination. These include: • flight number, which could be any combination of letters and numbers • destination • date of departure • type of aircraft used. Use the enumerated data type you created in part (a).[4]
- (c)(i)Write the pseudocode statement to set up a variable for one record of the composite data type Flight.[1]
- (c)(ii)Write pseudocode to store the details of the following flight in the variable you set up in part (c)(i). Field Data flight number XA782 destination Cambridge date of departure 12/12/2022 type of aircraft used C350 Use the field names you created in part (b).[3]
Mark scheme
Marking points from the official mark scheme (Oct/Nov 2022). The mark or mark type is shown in brackets.
- [2] (a) Marks as shown in the square brackets: TYPE Aircraft = (C300, C350, D242, E757, X380) TYPE Aircraft = [1] (C300, C350, D242, E757, X380)[1]
- [1] (b) One mark for each point (Max 4) • TYPE Flight and ENDTYPE correct
- [1] (b) • DECLARE FlightNumber and DECLARE Destination as STRING
- [1] (b) • DECLARE DepartureDate as DATE
- [1] (b) • DECLARE AircraftType as Aircraft (correct data type from part 4(a)) Example answer: TYPE Flight DECLARE FlightNumber : STRING DECLARE Destination : STRING DECLARE DepartureDate : DATE DECLARE AircraftType : Aircraft ENDTYPE
- [1] (c)(i) Example answer: DECLARE Flight1 : Flight
- [1] (c)(ii) One mark for each point (Max 3) • Correct assignments of both string data values
- [1] (c)(ii) • Correct assignments of date data value
- [1] (c)(ii) • Correct assignments of enumerated data value Example answer: Flight1.FlightNumber ← "XA782" Flight1.Destination ← "Cambridge" Flight1.DepartureDate ← 12/12/2022 Flight1.AircraftType ← C350
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 →