讲解:algorithm、JAVA program、Java、data structuresR|

Assignment 2Learning OutcomesOn successful completion of this assignment, students are expected to: understand and be able to apply a variety of data structures together with their internalrepresentation and algorithms; be able to select, with justification, appropriate data structures to ensure efficientimplementation of an algorithm.To DoDesign and implement a JAVA program called ‘Library’.DataYour system should store books’ information. A book in your library should contain: ISBN: ISBN is the acronym for International Standard Book Number. It is a 10 or 13-digitnumber used to identify a specific book. Title: each book has one title, but different books can have the same title. Author: each book has one author, but different books can have the same author. Category: each book belongs to one of these 6 categories: Arts, Business, Comics, IT,Cooking, Sports. How many copies in total of this book: no more than 20 copies per book. How many copies available for lending.Note: Different books with the same title cannot share the same author.FunctionalityYour system should provide at least 5 types of functions including: input, update, delete, displayand search book information: Add:a) Add a new book by providing all the information required. Delete:a) Delete a book by providing The book’s ISBN Or by providing the title together with the author name. Note: When some copies of the book have been lent out, this bookcannot be deleted. Search:a) Search a book by providing an input of any kind, you method should displayeverything that matches the input. Information of results books should bedisplayed in a table format and displayed in a descending order based on the totalcopy number of the books. Update:a) Find the book by ISBN and then update any information of the book (except ISBN). Display:a) Display all books’ information in table format. Allowing user to choose group by: Category: display books by category. Or author: display books by author.Note: All your methods should provide console display of the results.ExampleThe following shows a typical scenario of user interactions with the system (user commands orinputs are rendered in italics): Library Welcome to the library management system, functions provided include the following:o Add – to add a new booko Update – to update book infoo Search – to enquire about book infoo Delete – to delete a booko Display– to display book(s) infoo Quit – to exit from the current level of interactions Enter your command here(Enter ‘Quit’ at any time to exit from current level): Addo Enter a new book ISBN: 7302061866ISBN: 7302061866 Entered.o Enter the title: Data StructureTitle: Data Structure Entered.o Enter the author: Michael MainAuthor: Michael Main Entered.o Enter category: ITCategory: IT Entered.o Enter total copy number: 20Ready to add book: 7302061866; Data Structure; Michael Main; IT;20;20o Enter ‘Y’ to add new book. Anything else to quit: YNew book added successfully.o Note: automatically exit from current level. Enter your command here(Enter ‘Quit’ at any time to exit from current level): Addo Enter a new book ISBN: 7302061867ISBN: 7302061867 Entered.o Enter the title: Data StructureTitle: Data Structure Entered.o Enter the author: Michael MainBook Data Structure by Michael Main exists in system.o Please re-enter Author or enter ‘T’ to re-enter title: To Enter the title: Data Structure IIo Enter category: ITCategory: IT Entered.o Enter total copy number: 20Ready to add book: 7302061867; Data Structure II; Michael Main; IT; 20; 20o Enter ‘Y’ to add new book. Anything else to quit: YNew book added successfully.o Note: automatically exit from current level. Enter your command here: (Enter ‘Quit’ at any time to exit from current level):代写algorithm留学生作业、JAVA program作业代写、代做Java编程设计作业、代写data struct Deleteo Enter the book’s ISBN or title + author: 7302061867Found book:ISBN TITLE AUTHOR CATEGORY TOTAL_COPIES AVAILABLE_COPIES7302061867 Data Structure II Michael Main IT 20 20o Enter ‘Y’ to delete the book. Anything else to quit: YBook with ISBN 7302061867 has been deleted successfully.o Note: automatically exit from current level. Enter your command here: (Enter ‘Quit’ at any time to exit from current level): Deleteo Enter the book’s ISBN or title + author: Data Structure + Michael Main Found book:ISBN TITLE AUTHOR CATEGORY TOTAL_COPIES AVAILABLE_COPIES7302061866 Data Structure Michael Main IT 20 18Sorry this book cannot be deleted. There are 2 copies have been lent out.o Note: automatically exit from current level. Enter your command here: (Enter ‘Quit’ at any time to exit from current level): Searcho Enter your keyword: Data Structure Found book(s):ISBN TITLE AUTHOR CATEGORYTOTAL_COPIESAVAILABLE_COPIES7302061866 Data Structure Michael Main IT 20 187302061867 Data Structure II Michael Main IT 20 207302061000 Algorithm and DataStructurePAUL ERNEST IT 18 87303158867 Dynamic DataStructureDANEIL IT 10 107302000677 Data Structure inJAVALIU IT 10 3o Enter ‘Y’ to search other books, anything else to quit: Yo Enter your keyword: Michael Found book(s)ISBN TITLE AUTHOR CATEGORYTOTAL_COPIESAVAILABLE_COPIES7302061866 Data Structure Michael Main IT 20 187302061867 Data Structure II Michael Main IT 20 20o Enter ‘Y’ to search other books, anything else to quit: 7302000677 Found book:ISBN TITLE AUTHOR CATEGORYTOTAL_COPIESAVAILABLE_COPIES7302000677 Data Structure inJAVALIU IT 10 3o Enter ‘Y’ to search other books, anything else to quit: Yo Enter your keyword: Arts Found book(s)ISBN TITLE AUTHOR CATEGORYTOTAL_COPIESAVAILABLE_COPIES4102061866 Interaction of color Josef Albers Arts 15 84102061867 Digital Arts J.D IT 14 10o Enter ‘Y’ to search other books, anything else to quit: No Note: automatically exit from current level. Enter your command here: (Enter ‘Quit’ at any time to exit from current level): Updateo Enter ISBN: 7302000677Found book:ISBN TITLE AUTHOR CATEGORYTOTAL_COPIESAVAILABLE_COPIES7302000677 Data Structure inJAVALIU IT 10 3o Enter type of information you want to update, ‘T’ for title, ‘A’ for author, ‘C’ forcategory, ‘TC’ for total copy number, ‘AC’ for available number: TCo Enter your new total copy number(***with hint***): 18Book 7302000677‘s total copy number has been updated from 10 to 18successfully.o Note: automatically exit from current level. Enter your command here: (Enter ‘Quit’ at any time to exit from current level): Displayo Enter ‘C’ for displaying group by category, or ‘A’ for displaying group by author:CISBN TITLE AUTHOR CATEGORYTOTAL_COPIESAVAILABLE_COPIES7302061866 Data Structure Michael Main IT 20 187302061867 Data Structure II Michael Main IT 20 207302061000 Algorithm and DataStructurePAUL ERNEST IT 18 87303158867 Dynamic DataStructureDANEIL IT 10 107302000677 Data Structure inJAVALIU IT 10 34102061866 Interaction of colour Josef Albers Arts 15 8o Note: automatically exit from current level.Notes Capitalization makes no difference. For example ‘Add and ‘add’ can be considered as thesame. The above scenario is just an example. It is not the standard format for your system. Above scenario did not consider input validation, however in your system, you shouldvalidate the inputs. Your system must provide hints for user to understand what info to input during theinteraction. It is up to you to decide what algorithms and data structures to use to keep track ofbooks info in the system, and where to find such info. 转自:http://www.7daixie.com/2019052248576205.html

你可能感兴趣的:(讲解:algorithm、JAVA program、Java、data structuresR|)