CS 1101 - Cterm 10

Homework 6 - Writing functions for Lists of Structs

Due: Tuesday, September 21 at 5pm

Read the expectations on homework.

Assignment Goals


The Assignment

In these exercises, you will develop functions to process the Kiva data that you developed in Homework 5. Make sure you follow the templates (i.e. you should be developing helper functions for some of these problems).

(A set of solutions to Homework 5 will be published after the due date for HW5 has passed (5pm Saturday). You are welcome to use any of the definitions from this solution as your starting point for Homework 6).

  1. Write a function funds-needed that consumes a list of borrowers and produces the total amount of money that these borrowers are still seeking (ie, the sum of the amounts requested but not yet raised across all borrowers).

  2. Write a function count-by-country that consumes a list of borrowers and the name of a country and produces the number of borrowers in the list who are from the named country.

  3. Write a function find-by-country that consumes the name of a country and a list of borrowers and returns the list of borrowers who are from that country.

  4. Write a function large-teams that consumes a list of borrowers and returns a list of the names of borrowers with at least 5 team members.

What to Turn In

Here is the gradesheet for Homework 6.

Using web-based turnin, turn in a single file containing all code and documentation for this assignment. Follow the naming conventions for naming your file. Make sure that both partners' names and wpi login names are in a comment at the beginning of the file.