Пример #1
0
        /// <summary>
        /// Entry point into console application.
        /// </summary>
        static void Main()
        {
            // Facade
            CollegeLoan collegeLoan = new CollegeLoan();

            // Evaluate loan
            Student student  = new Student("Hunter Sky");
            bool    eligible = collegeLoan.IsEligible(student, 75000);

            Console.WriteLine("\n" + student.Name +
                              " has been " + (eligible ? "Approved" : "Rejected"));

            // Wait for user
            Console.ReadKey();
        }
        /// <summary>
        /// Entry point into console application.
        /// </summary>
        static void Main()
        {
            // Facade
            //create an instance of the top level CollegeLoan
            CollegeLoan collegeLoan = new CollegeLoan();

            // Evaluate loan
            //create the student applying for the load
            Student student = new Student("Hunter Sky");

            //call the facade's method, which calls the subsystem methods:
            bool eligible = collegeLoan.IsEligible(student, 75000);

            //show results:
            Console.WriteLine("\n" + student.Name +
                              " has been " + (eligible ? "Approved" : "Rejected"));

            // Wait for user
            Console.ReadKey();
        }