Back to Challenge Set 24

Code Challenge: Clean the List

Difficulty  

divider

The Brief

What they asked for
Here is the sign-up sheet from the open evening. People typed
their own names in and it shows. I need to know how many
actual different people signed up.

Write your requirements list before you write any code. Input, calculate, output, and anything you had to decide for yourself.


Notes

  • Underspecified on purpose. Is chen, ines the same person as CHEN, INES? Almost certainly. Decide, write it down, and be consistent. Activity 2.18's ToLower() handles capitals.
  • Spacing varies too: okafor,ravi and Okafor, Ravi are the same signature. Replace(" ", "") hands back a copy with every space removed, the same way ToLower() works.
  • Some entries are not names at all. Decide what disqualifies one and say so. Contains(",") returns true if a string has a comma in it, if that helps.
  • Report what you dropped and why, one line each. A count with no record of what was removed is not trustworthy.
  • In your requirements list, name one pair of entries your rule gets wrong. Every rule has one; finding yours is the challenge.

Sample Output

Sample Output
dropped 'chen, ines' (same person as one already kept)
dropped 'CHEN, INES' (same person as one already kept)
dropped 'okafor,ravi' (same person as one already kept)
dropped '' (not a name)
dropped '?' (not a name)
Unique people: 3 (from 8 entries, 5 dropped)
chen,ines
okafor,ravi
diaz,nadia

Eight entries, three people. The printed names are the cleaned form, all lowercase with no spaces: a decision worth defending. Would you show that to the person who signed up?


Submit

Your requirements list and your program file, named cc-clean-the-list.

Commence Challenge