Project.002: OOPs, C++, Eclipse, LinuxDiscussion Forum for Programming with C++. We introduce to programming in general, including object-oriented programming and generic programming. It is also a solid introduction to the C++ programming language, one of the most widely used languages for real-world software. This Training presents modern C++ programming techniques from the start, introducing the C++ standard library to simplify programming tasks.
Write a program to implement a simple library inventory management system, where the inventory consists of books, periodicals, and DVD's, each of which may be checked-out by a library patron.
Functionality: Support must be provided for the following elements of functionality in the library management system: a) Import of library inventory from file, where the collection of all items in each category is stored in a file; that is, one file contains books, another contains periodicals, and another contains DVD's. Please note that the imported inventory files will have the following names: 1) books.dat 2) periodicals.dat 3) dvds.dat ASSUMPTIONS: 1) For simplicity, assume there is only one (1) copy of each item in the inventory. 2) Each item is assumed to be checked-in (i.e., ON_SHELF) when it is imported.
Functionality: b) Display of the library inventory manager main menu, which should look as follows: NOTE: The outside border is intended to depict the outline of the console and should not be part of the output. +--------------------------------------------------------------------- || ======= Library Inventory Manager ======= | 0 - Quit | 1 - Display all collections | 2 - Display book collection | 3 - Display periodical collection | 4 - Display DVD collection | 10 - Checkout book | 11 - Checkout periodical | 12 - Checkout DVD | 20 - Checkin book | 21 - Checkin periodical | 22 - Checkin DVD | ============================== | Command: | +---------------------------------------------------------------------- pre.western { font-family: "DejaVu Sans Mono", monospace; }pre.cjk { font-family: "WenQuanYi Zen Hei Sharp", monospace; }pre.ctl { font-family: "Lohit Devanagari", monospace; }p { margin-bottom: 0.08in; }a:link { }
Functionality: c) Display of the entire library inventory, display of only the book collection, display of only the periodical collection, and display of only the DVD collection. Each item should be displayed on a single line with a comma separating each field of the item. In addition, preceed display of each item with the following information: 1) An numeric id in the range of [0 .. N-1] which can be used to identify the item in the collection when a check-out or check-in is commanded by the user. NOTE: "N" is the number of elements in the collection. 2) Item state, displayed as either "[ON_SHELF]" or "[CHECKED_OUT]". Consider the following example in which the book collection is displayed: NOTE: The outside border is intended to depict the outline of the console and should not be part of the output. +------------------------------------------------------------------------ | Book Collection: | ================ | [ 0], [ON_SHELF] , Smith, John A., 1997, A Day in the Life of a Software Developer, Dallas, Texas, Generic Publishing House | [ 1], [ON_SHELF] , Sheely, David E., 2004, Can You Read This Book Title?, Arlington, Texas, NoName Publishing House | [ 2], [CHECKED_OUT], Johnson, Jane, 2000, Another Random Book Title, Fort Worth, Texas, Nondescript Publishing House +----------------------------------------------------------------------
Functionality: d) Check-out of a library item to a patron for an indefinite period of time. Make sure to print a warning if an attempt is made to check-out an item that is already checked-out. ASSUMPTION: There is no requirement to track a due date.
Functionality: e) Check-in of a library item by a patron. Make sure to display a warning if an attempt is made to check-in an item that is already checked-in.
Data Specifications: File Input: The following "import" inventory files should be used during implementation of the program and when you make your final run for submission of the assignment. Please simply cut and paste the contents of each into files with the following names into your development environment: books.dat periodicals.dat dvds.dat FILE ORGANIZATION: • The first line in each file contains a line of the following format to specify the number of items in the file: NUM_ITEMS X where: NUM_ITEMS is a character string X is an integer value • Each collection of lines comprising an item is separated from the next collection by an empty line. FILE FORMATS: When ASCII files are created on a DOS-based machine, each line in the file is terminated with a carriage return and linefeed character. When ASCII files are created on Apple machines, each line is terminated with a carriage return character. When ASCII files are created on a UNIX machine, each line is terminated with a linefeed character. It is important to ensure that the input files are formatted according to the machine on which you are running. If you develop on a non-Unix platform and transfer your code and data files to a UNIX machine, make sure to convert your files to UNIX format.
Data Specifications: User Input: User input is solicited from the main menu and, additionally, when the user elects to check-out or check-in an item. When the user selects menu options to check- out or check-in an item, he/she is solicited for an item number corresponding to the item he/she wishes to select.
Output: The only output required from the program is to "stdout" (console) as the menu is displayed, user commands processed, and errors are reported. pre.western { font-family: "DejaVu Sans Mono", monospace; }pre.cjk { font-family: "WenQuanYi Zen Hei Sharp", monospace; }pre.ctl { font-family: "Lohit Devanagari", monospace; }p { margin-bottom: 0.08in; }code.cjk { font-family: "DejaVu Sans Mono", monospace; }a:link { }
To call the different functions such as display,import,check-in and check-out functions according to the choice made by clients for books,periodicals and dvds