示例#1
0
        public void RemoveBook()
        {
            Console.WriteLine("REMOVE A BOOK!");

            Console.WriteLine("Author name?");
            string author = Console.ReadLine();

            Console.WriteLine("Title?");
            string title = Console.ReadLine();

            ErrorCode ec = theList.Remove(author, title);

            errors(ec);
        }
示例#2
0
        public void RemoveBook()
        {
            Console.WriteLine("REMOVE A BOOK!");

            Console.WriteLine("Author name?");
            string author = Console.ReadLine();

            Console.WriteLine("Title?");
            string title = Console.ReadLine();

            ErrorCode ec = theList.Remove(author, title);

            // STUDENTS: YOUR ERROR-CHECKING CODE SHOULD GO HERE!
        }
示例#3
0
        public void RemoveBook()
        {
            Console.WriteLine("REMOVE A BOOK!");

            Console.WriteLine("Author name?");
            string author = Console.ReadLine();

            Console.WriteLine("Title?");
            string title = Console.ReadLine();

            ErrorCode ec = theList.Remove(author, title);

            if (ec == ErrorCode.BookNotFound)
            {
                Console.WriteLine("Book was searched for, but not found. Deletion failed!");
            }
            if (ec == ErrorCode.OK)
            {
                Console.WriteLine("Book was successfully removed.");
            }
        }
示例#4
0
        public void RemoveBook()
        {
            Console.WriteLine("REMOVE A BOOK!");

            Console.WriteLine("Author name?");
            string author = Console.ReadLine();

            Console.WriteLine("Title?");
            string title = Console.ReadLine();

            ErrorCode ec = theList.Remove(author, title);

            if (ec == ErrorCode.OK)
            {
                Console.WriteLine("removed a book!");
            }
            else
            {
                Console.WriteLine("failed to remove a book");
            }
        }
示例#5
0
        public void RemoveBook()
        {
            Console.WriteLine(); //Spacing/aesthetics

            Console.WriteLine("REMOVE A BOOK!");

            Console.WriteLine("Author name?");
            string author = Console.ReadLine();

            Console.WriteLine("Title?");
            string title = Console.ReadLine();

            ErrorCode ec = theList.Remove(author, title);

            if (ec == ErrorCode.BookNotFound)
            {
                Console.WriteLine("This book is not in the library!");
            }
            else if (ec == ErrorCode.OK)
            {
                Console.WriteLine("This book was successfully removed from the library.");
            }
        }
        public void RemoveBook()
        {
            Console.WriteLine("REMOVE A BOOK!");

            Console.WriteLine("Author name?");
            string author = Console.ReadLine();

            Console.WriteLine("Title?");
            string title = Console.ReadLine();

            ErrorCode ec = theList.Remove(author, title);

            // STUDENTS: YOUR ERROR-CHECKING CODE SHOULD GO HERE!

            if (ec == ErrorCode.OK)
            {
                Console.WriteLine("Book removed!");
            }
            if (ec == ErrorCode.BookNotFound)
            {
                Console.WriteLine("Book cannot be found!");
            }
        }
示例#7
0
        public void RemoveBook()
        {
            Console.WriteLine("REMOVE A BOOK!");

            Console.WriteLine("Author name?");
            string author = Console.ReadLine();

            Console.WriteLine("Title?");
            string title = Console.ReadLine();

            ErrorCode ec = theList.Remove(author, title);

            //if ec is BookNotFound, print the message to the user
            //if ec is OK, print the message to the user

            if (ec == ErrorCode.BookNotFound)
            {
                Console.WriteLine("Book is not found!");
            }
            else if (ec == ErrorCode.OK)
            {
                Console.WriteLine("Book was removed!");
            }
        }