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 saveExactDollarWords(AggregateDataDollarWords aggregateData) { using (TextWriter tw = new StreamWriter("exactDollarWords.txt")) foreach (string word in aggregateData.getExactDollarWords()) { tw.WriteLine(word); } }