コード例 #1
0
        bool Start()
        {
            BookStore bookStore = new BookStore();
            Book      book1     = new Book("Dracula", "Bram Stoker", 15);
            Book      book2     = new Book("Joe Speedboot", "Tommy Wieringa", 12.5);
            Book      book3     = new Book("The Hobbit", "J.R.R. Tolkien", 12.5);
            Magazine  magazine1 = new Magazine("Time", DayOfWeek.Friday, 3.9);
            Magazine  magazine2 = new Magazine("Donald Duck", DayOfWeek.Thursday, 2.5);

            bookStore.Add(book1);
            bookStore.Add(book2);
            bookStore.Add(magazine1);
            bookStore.Add(magazine2);
            bookStore.Add(book3);
            bookStore.PrintCompleteStock();

            return(ProgramTools.LoopProgram());
        }
コード例 #2
0
        void Start()
        {
            BookStore store1 = new BookStore();


            Book     b1 = new Book("Dracula", "Bram Stoker", 15);
            Book     b2 = new Book("Joe speedboot", "Tommy Wieringa", 12.50);
            Book     b3 = new Book("The hobbit", "J.R.R. Tolkien", 12.50);
            Magazine m1 = new Magazine("Time", 3.90, "Friday");
            Magazine m2 = new Magazine("Donald Duck", 2.50, "Thursday");

            store1.Add(b1);
            store1.Add(b2);
            store1.Add(m1);
            store1.Add(m2);
            store1.Add(b3);

            store1.PrintCompleteStock();
            Console.ReadKey();
        }
コード例 #3
0
        bool Start()
        {
            BookStore bookStore = new BookStore();

            Book     book1     = new Book("Dracula", 15, 5, "Bram Stoker");
            Book     book2     = new Book("Joe Speedboot", 12.5f, 3, "Tommy Wieringa");
            Magazine magazine1 = new Magazine("Time", 3.9f, 10, DayOfWeek.Friday);
            Magazine magazine2 = new Magazine("Donald Duck", 2.5f, 15, DayOfWeek.Thursday);
            CD       cd1       = new CD("Seventeen Seconds", 3.9f, 5, "The Cure");

            bookStore.Add(book1);
            bookStore.Add(book2);
            bookStore.Add(magazine1);
            bookStore.Add(magazine2);
            bookStore.Add(cd1);

            bookStore.PrintAllItems();

            return(LoopTools.LoopProgram());
        }