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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.