示例#1
0
        // ** begin class Program **
        static void Main(string[] args)
        {
            // ** begin Main method**

            // ** instansiate a new object of type Person  **
            Person newPerson = new Person();

            // ** invoke void public method GetDataFromUser on class Person to populate member variabes of newPerson **
            newPerson.GetDataFromUser();

            // ** determine if the newPerson can vote **
            bool canVote;
            if (newPerson.IsCitizen && newPerson.Age > 18)
            {
                canVote = true;
            }
            else
            {
                canVote = false;
            }

            //** invoke PrintResults static void method on class Program to print newPerson data to Console **
            PrintResults(newPerson, canVote);
        }