A record type groups fields, here Student with a name and an average. An array of records is drawn as a table.

Algorithm Students

Student
  1. Run it with 3 students, for example Ana 4.5, Marko 3.8 and Jovana 4.9.
  2. Watch the table in the Arrays tab while the records are sorted, and see the record type in the code (a struct in C, a class in Java).
Teacher
  1. In the editor File, Records… defines the types and their fields; a Declare block then offers the type.
  2. Use s.name and a[i].avg in expressions; an assignment copies the whole record.