Data Structures
Last updated
Last updated
explained what variables are (temporary location for storing data) and how to create and use them in Sonar.
The one downside to variables is that they can only store a single value of a single data type. Most of the time, this won't be a problem, but when you write programs that need to store and manipulate collections of data (such as an attendance register for a classroom), you'll need a way to store collections of data, instead of just single values.
Sonar offers two kinds of collections: arrays and maps.The following sections will explain how they can be used to create complex programs.