Chapter 11
Adding Lists
IN THIS CHAPTER
Working with lists
Sorting items in a list
Coding a sorting algorithm in Java
Searching for items in a list
Coding a search algorithm in Java
Lists are ways of grouping data in coding. Kids encounter lists all the time in their daily lives, and so do you! Classrooms list the names of students in the class. Cookbooks list the ingredients in a recipe. Travelers make lists of what to pack in their suitcases. Students study lists of vocabulary words. Sometimes you create two lists that pair together. Parents list expenses when creating a budget, placing items such as “rent” and “car loan” in one list, and the associated cost in a second list. Dieters create paired lists of food items and their calories. Chapters 8 and 10 includes simple examples of how lists can make your programs a bit more interesting. For example, Chapter 10 shows how you can code a list of classmates that you iterate through and have your program say “hi” to each of your classmates. ...
Get Helping Kids with Coding For Dummies 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.