Exemple #1
0
        static void Main()
        {
            GirlScout First  = new GirlScout("Becky", 103, 80.32); // invokes the GirlScout object and passes 3 values to the constructor
            GirlScout Second = new GirlScout();                    // invokes the GirlScout object using the constructor with preset values

            Display(First);                                        // calls the Display method with the "First" GirlScout argument
            Display(Second);                                       // calls the Display method with the "Second" GirlScout argument

            Console.WriteLine();
            Console.WriteLine(GirlScout.girlscoutMotto);    // prints the Motto by referencing the GirlScout class name only
        }
Exemple #2
0
 static void Display(GirlScout scout)    // initializes the Display method that passes in name, number, and dues
 {
     Console.WriteLine("{0, 10} {1, 10} {2, 10}", scout.girlscoutName, scout.troopNumber, scout.duesOwed.ToString("C2"));
 }