find contacts block to select items from the contact list based on the contact's name. Students get practice with list processing, navigating abstract data types, and using the higher-order function, keep. BH: Ditto. (I still want given and family names! We can make it doable.)
On this page, you will develop code for a "Find Contact" button to locate contacts in the list.
keep in Unit 2.As you add more contacts to your list, it will become less and less realistic to find the one you want by reading through the whole list. So building a search feature will become essential for finding the desired information efficiently. Lists, adding and removing items from lists, and searching lists are common features in many programs.
Farida Bedwei (born in 1979) is a software engineer and the co-founder/Chief Technology Officer of Logiciel, a financial technology company based in Ghana. Due to difficulties in muscle control as a result of cerebral palsy, she began using a typewriter as an alternative to writing at an early age. Badwei attributes her future interest in computers to this early reliance on technology. In addition to being named as one of the most successful women in finance technology in Africa, Bedwei is a powerful advocate and role model for girls in STEM and for people with disabilities.
Article: The inspirational tech guru who’s owning cerebral palsy like a boss
Each new contact is a list (item 1 is a name and item 2 should be a phone number), so the list of contacts is a list of lists.
block that takes a text string as input and reports either a list of the contacts whose name includes that string or an empty list if no such name is in contact list.
, which reports true if the first string (for example, a contact's name in the list) contains the second string (for example, a name or part of a name)
, which reports only the items that make the function true
, which returns true if the list is empty and false otherwise
say each of the matching contacts.Modularity is the process of breaking a programming project up into separate sub-problems. For example on page 2 of this lab, you built code to add a contact to your app, and on this page, you built code to find contacts.
find contacts block to find all the matching contacts.find reports more than one.
delete contact that takes a contact as input and removes that contact from contact list.This set of exercises requires that you've already done the Take It Further exercises on page 2. Open your project U3L2-TIF.
< to compare them. Respect the data abstractions.
.
Use the contact list as the first input. The second input should be the predicate function you just wrote. (Leave its two input slots empty.) The sort block will report a new, sorted contact list.
name ADT) has to know whether it's a given-first name such as Jasmine Anderson or a family-first name such as Sun Yat-Sen. Redefine your Name ADT to make it a list of three items. The first will be either the text 'given-first' or 'family-first'. This first item is called a type tag. The second item will be the given name (or names), and the third will be the family name (or names).
and
.
and
so that they check the type tag of the name (the first item) when necessary. Be careful about when to add a comma.
find contacts block and your sorting of the contact list still work with a contact list containing both kinds of names.