static void Main()
        {
            bool debug = false;

            //Create a Person and make it say hello
            Person myPerson = new Person();

            myPerson.Greet();

            /*Create a student, set his age to 21,
             * tell him to Greet and display his age*/
            Student myStudent = new Student();

            myStudent.SetAge(21);
            myStudent.Greet();
            myStudent.ShowAge();

            /*Create a teacher, 30 years old,
             * ask him to say hello and then explain*/
            Teacher myTeacher = new Teacher();

            myTeacher.SetAge(30);
            myTeacher.Greet();
            myTeacher.Explain();

            if (debug)
            {
                Console.ReadLine();
            }
        }
Example #2
0
        static void Main()
        {
            bool debug = false;

            Person myPerson = new Person();

            myPerson.Greet();

            Student myStudent = new Student();

            myStudent.SetAge(21);
            myStudent.Greet();
            myStudent.ShowAge();

            Teacher myTeacher = new Teacher();

            myTeacher.SetAge(30);
            myTeacher.Greet();
            myTeacher.Explain();

            if (debug)
            {
                Console.ReadLine();
            }
            Console.ReadKey();
        }
Example #3
0
        static void Main(string[] args)
        {
            Person p1 = new Person();
            Student s1 = new Student();
            Teacher t1 = new Teacher();
            p1.Greet();
            s1.SetAge(21);
            s1.Greet();
            s1.ShowAge();
            t1.SetAge(30);
            t1.Greet();
            t1.Explain();

            Console.ReadKey();
        }
Example #4
0
        static void Main(string[] args)
        {
            Person p = new Person();

            p.Greet();

            Student s = new Student();

            s.SetAge(21);
            s.Greet();
            s.ShowAge();

            Teacher t = new Teacher();

            t.SetAge(30);
            t.Greet();
            t.Explain();
        }
Example #5
0
        static void Main(string[] args)
        {
            Person p = new Person("Lloyd");

            p.Greet();

            Student s = new Student("Alpha");

            s.SetAge(20);
            s.Greet();
            s.ShowAge();

            Teacher t = new Teacher("Beta");

            t.SetAge(30);
            t.Greet();
            t.Explain();

            Console.ReadKey();
        }