Abstraction with Lists and Procedures

Let’s use the same example from the earlier section: a phone book contact entry. This time, we’re going to implement it with lists as a data structure and then make a list of our structure objects. Remember, each entry will contain a person’s name and phone number. So our list that represents a single entry will have two items: a name and a number.

In this example, we’re going to design the data structure and build some small procedures to help us manage it so that our code blocks will be easier to read and understand.

Procedures are another way to abstract ideas into simpler containers, with the details hidden. In this case, we’ll make one procedure that creates an address book entry and make two procedures ...

Get Learning MIT App Inventor: A Hands-On Guide to Building Your Own Android Apps now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.