Exemple #1
0
        static void Main(string[] args)
        {
            try
            {
                Students studentdetails1 = new Students("Jim Nad", "I4C345", "2020");
                Students studentdetails2 = new Students("Naresh Mash", "I4C343", "2019");
                Students studentdetails3 = new Students("Ben Hood", "I4C344", "2018");
                Students studentdetails4 = new Students("Kim Nim", "I4C345", "2017");
                Students studentdetails5 = new Students("Lam Tish", "I4C346", "2016");


                Book bookdetails1 = new Book("Think Like A Woman Act Like A Man", "icu456");
                Book bookdetails2 = new Book("The Man Behind The Wheel", "icu456");
                Book bookdetails3 = new Book("The Power", "icu457");
                Book bookdetails4 = new Book("Let Change The World", "icu458");
                Book bookdetails5 = new Book("C# Programming", "icu459");

                Library library1 = new Library(studentdetails1, bookdetails1, "2,25,2017", "3,1,2017");
                Library library2 = new Library(studentdetails2, bookdetails2, "8,2,2017", "8,20,2017");
                Library library3 = new Library(studentdetails3, bookdetails3, "12,18,2019", "1,3,2017");
                Library library4 = new Library(studentdetails4, bookdetails4, "1,19,2019", "2,4,2017");
                Library library5 = new Library(studentdetails5, bookdetails5, "2,20,2019", "3,5,2017");


                GenericDefaulterList <IDefaulters> library = new GenericDefaulterList <IDefaulters>();


                library.Add(library1);
                library.Add(library2);
                library.Add(library3);
                library.Add(library4);
                library.Add(library5);


                foreach (var item in library.GetDefaulter())
                {
                    Console.WriteLine(item);
                }
            }
            catch (System.Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Library library1 = new Library(30, 3, 2020, 4, 4, 2020, "James", "100 level", "Things fall apart", "777", "John", "Death of Yan", "7778");
            Library library2 = new Library(31, 8, 2020, 4, 2, 2020, "Stuaart", "200 level", "Things stand again", "767", "Jan", "Dont cry", "778");
            Library library3 = new Library(30, 3, 2020, 10, 10, 2020, "Jas", "300 level", "Things fall apart yet again", "777", "Jean", "Death of Yin", "777");
            Library library4 = new Library(18, 2, 2020, 5, 7, 2020, "James", "100 level", "Things fall apart", "777", "John", "Death of Yan", "7778");
            Library library5 = new Library(30, 3, 2020, 4, 4, 2020, "James", "100 level", "Things fall apart", "777", "John", "Death of Yan", "7778");


            GenericDefaulterList <IDefaulters> library = new GenericDefaulterList <IDefaulters>(6);


            library.Add(library1);
            library.Add(library2);
            library.Add(library3);
            library.Add(library4);
            library.Add(library5);


            library.GetDefaulter();
        }