static void outputAggregateData(AggregateDataDollarWords aggregateData) { Console.WriteLine(aggregateData.ToString()); Console.Write("Enter x for exact dollar words, or d for dollar words, nothing to end: "); int input = Console.Read(); switch (input) { case 'x': foreach (string word in aggregateData.getDollarWords()) { Console.WriteLine(word); } break; case 'd': foreach (string word in aggregateData.getExactDollarWords()) { Console.WriteLine(word); } break; default: break; } }
static void saveDollarWords(AggregateDataDollarWords aggregateData) { using (TextWriter tw = new StreamWriter("dollarWords.txt")) foreach (string word in aggregateData.getDollarWords()) { tw.WriteLine(word); } }