private string word = null;
public void SetWord (string value)
if (value == "fool" || value == "idiot")
Console.WriteLine("This is a bad word - {0}", word);
Console.WriteLine("This is a good word - {0}", word);
public static void Main()
WordIdentify word = new WordIdentify();
Console.Write("Enter a word: ");
word.SetWord(Console.ReadLine());