I am trying to write a program to select a random name from the US Census last name list. The list format is
Name Weight Cumulative line -----
Just for fun, and in no way optimal
List Names = //Load your structure into this List NameBank = new List(); foreach(Name name in Names) for(int i = 0; i <= (int)(name.Weight*1000); i++) NameBank.Add(name.Name)
then:
String output = NameBank[rand(NameBank.Count)];