void GreetAndFarewell(Salutation person) { Console.WriteLine(person.Greet()); Console.WriteLine(person.Farewell()); Console.WriteLine(); }
static void Main(string[] args) { // Use the Salutation class for a Walmart Greeter. Salutation oldGuy = new Salutation("Welcome to Walmart!", "Thanks for shopping at Walmart!"); // Get the guy to talk... Console.WriteLine(); }
private void Speak(Salutation speaker) { Console.WriteLine(speaker.Greet()); Console.WriteLine(speaker.SayFareWell()); }