The getData function

The getData function is shown in its entirety in Listing 3.