### 2` `Program Design Via Iterative Refinement 3

Purpose Follow your plan.

### Modifications: Implementation

30 minutes

Using the guidance of your wish list and your work from Part 1 of this lab, design the functions in the exercises below.

If you did not complete the exercises in Part 1 of the lab, you may use this solution file as a basis for the following exercises.

Exercise 1 Update the function remove-user so that it reflects the new data definition.

Exercise 2 Update the function count-friendships to reflect the new data definition.

Exercise 3 Users would like to know how many other users have connectections to them in any type of group, not just friend groups.

Design the function count-connections by abstracting count-friendships so that it can be applied to any group type. Rewrite count-friendships using this abstraction.

Note that we are treating you as adults here. Instead of asking you to write another count- function so that you can abstract from two functions into one, we are asking you to imagine the other function and abstract a priori.

Challenge Exercise 4 Design a function, best-known, that takes a GroupName and determines which user in a SocialNetwork is the most connected to by other users within a given type of group.

### Code Review

10 minutes

The Teaching Assistants will pick a pair who will explain a solution to their lab mates, following the design recipe steps.