using System; // Extend the following visitor pattern with an additional city class // without touching existing code except additional lines in main. The // "tourist" and "college" visitors must also be extended to visit your city. interface city // visitee interface { void accept(visitor v); } interface visitor // visitor interface { void visit(NY n); void visit(LA n); } class NY : city { public void accept(visitor v) { v.visit(this); } } class LA : city { public void accept(visitor v) { v.visit(this); } } //// sample visitors class tourist : visitor { public void visit(NY n) { Console.WriteLine("goto statue of liberty"); } public void visit(LA n) { Console.WriteLine("goto hollywood"); } }//tourist class collegevisitor : visitor { public void visit(NY n) { Console.WriteLine("goto NYU"); } public void visit(LA n) { Console.WriteLine("goto UCLA"); } }//collegevisitor public class vex { public static void Main() { city[] Cs = {new NY(), new LA()}; visitor v = new tourist(); foreach(city c in Cs) c.accept(v); }//Main }