Lompat ke konten

Labs · 9618 A2 13.1

Jenis Data Buatan Pengguna

Write TYPE, DECLARE and DEFINE in 9618 pseudocode and see what your code makes: enumerated types, records, pointers and sets, and the memory that holds them.

8 levelsFree bench

In the exam

Exam questions on what this lab teaches, with the points that gain marks.

9618/32 October/November 2022 · Question 410 marks

(a) Declare the enumerated data type Aircraft (C300, C350, D242, E757, X380). (b) Declare the composite data type Flight: flight number, destination, departure date and type of aircraft. (c)(i) Set up a variable for one record of type Flight. (ii) Store the details of flight XA782 to Cambridge on 12/12/2022 with aircraft C350.

Points that gain marks

  1. (a) TYPE Aircraft = … (C300, C350, D242, E757, X380)
  2. (b) TYPE Flight and ENDTYPE correct.
  3. DECLARE FlightNumber and DECLARE Destination as STRING; DECLARE DepartureDate as DATE.
  4. DECLARE AircraftType as Aircraft (the type from part (a)).
  5. (c)(i) DECLARE Flight1 : Flight
  6. (ii) Both STRING values, the DATE value and the enumerated value assigned correctly: Flight1.DepartureDate ← 12/12/2022, Flight1.AircraftType ← C350.

In this lab: Levels 3 and 4 build exactly this record.

9618/31 October/November 2021 · Question 3(a)(b)4 marks

(a) Write pseudocode to create an enumerated type called Parts: Monitor, CPU, SSD, HDD, LaserPrinter, Keyboard, Mouse. (b) Write pseudocode to create a pointer type called SelectParts that will reference the memory location in which the current part name is stored.

Points that gain marks

  1. (a) TYPE Parts = (Monitor, CPU, SSD, HDD, LaserPrinter, Keyboard, Mouse)
  2. (b) TYPE SelectParts = ^ …
  3. … with the correct data type: Parts. TYPE SelectParts = ^Parts

In this lab: Levels 1 and 5.

9618/31 October/November 2023 · Question 34 marks

Describe what is meant by enumerated and pointer data types.

Points that gain marks

  1. Enumerated: a user-defined non-composite data type …
  2. … with a list of all possible values …
  3. … that is ordered.
  4. Pointer: a user-defined non-composite data type …
  5. … that stores addresses (memory locations) only …
  6. … and indicates the type of data stored in the memory location.

In this lab: The enumerated type shows its values in order; the pointer column in Memory holds an address.

The question as printed in the exam paper

More real experiments

All labs →

Masuk atau buat akun

IGCSE, A-Level & AP