/// Test BookList.
 public static void Main()
 {
     BookList books = new BookList();
      // ...
      books.Addbook(new Book("C# Yellow Book", "Rob Miles", 2011));
      // Add more!
      // ...
      Console.WriteLine("The full list is:");
      books.PrintList();
      // Add more tests to fully test your code.
      // Make sure the correctness of the tests can be seen without reading
      // the source code -- comment on the meanings.
      // ...
 }
示例#2
0
        /// Test BookList.
        public static void Main()
        {
            BookList books = new BookList();

            // ...
            books.Addbook(new Book("C# Yellow Book", "Rob Miles", 2011));
            // Add more!
            // ...
            Console.WriteLine("The full list is:");
            books.PrintList();
            // Add more tests to fully test your code.
            // Make sure the correctness of the tests can be seen without reading
            // the source code -- comment on the meanings.
            // ...
        }
 /// Test BookList.
 public static void Main()
 {
     BookList books = new BookList();
      // ...
      books.Addbook(new Book("C# Yellow Book", "Rob Miles", 2011));
      books.Addbook(new Book("C# Software Solutions", "John Lewis", 2007));
      books.Addbook(new Book("A History of Modern Computing", "Paul E. Ceruzzi", 2003));
      books.Addbook(new Book("Universal History of Computing", "Georges Ifrah", 2001));
      books.Addbook(new Book("Tools for Thought", "Howard Rheingold", 2000));
      // Add more!
      // ...
      Console.WriteLine("The full list is:");
      books.PrintList();
      Console.WriteLine("\nHere is an example of the PrintTilesByAuthor function:");
      books.PrintTitlesByAuthor("John Lewis");
      Console.WriteLine("\nHere is an example of teh PrintBooksInYears function:");
      books.PrintBooksInYears(2002, 2012);
      // Add more tests to fully test your code.
      // Make sure the correctness of the tests can be seen without reading
      // the source code -- comment on the meanings.
      // ...
 }
        /// Test BookList.
        public static void Main()
        {
            BookList books = new BookList();

            // ...
            books.Addbook(new Book("C# Yellow Book", "Rob Miles", 2011));
            books.Addbook(new Book("C# Software Solutions", "John Lewis", 2007));
            books.Addbook(new Book("A History of Modern Computing", "Paul E. Ceruzzi", 2003));
            books.Addbook(new Book("Universal History of Computing", "Georges Ifrah", 2001));
            books.Addbook(new Book("Tools for Thought", "Howard Rheingold", 2000));
            // Add more!
            // ...
            Console.WriteLine("The full list is:");
            books.PrintList();
            Console.WriteLine("\nHere is an example of the PrintTilesByAuthor function:");
            books.PrintTitlesByAuthor("John Lewis");
            Console.WriteLine("\nHere is an example of the PrintBooksInYears function:");
            books.PrintBooksInYears(2002, 2012);
            // Add more tests to fully test your code.
            // Make sure the correctness of the tests can be seen without reading
            // the source code -- comment on the meanings.
            // ...
        }
示例#5
0
 // extra credit AddAll chunk
 // Add each Book in books to this BookList.
 // if it is not already contained in this BookList.
 // Return true if the current list was changed.
 // Return false if each Book in books is a
 // duplicate of a Book in the current list.
 public bool AddAll(BookList books)
 {                 // code for extra credit
     return(true); // so stub compiles
 }
        // extra credit AddAll chunk
        // Add each Book in books to this BookList.
        // if it is not already contained in this BookList.
        // Return true if the current list was changed.
        // Return false if each Book in books is a
        // duplicate of a Book in the current list.
        public bool AddAll(BookList books)
        {
            // code for extra credit

             return true;  // so stub compiles
        }