trivial information management system
5 views (last 30 days)
Show older comments
In this homework you are expected to make a trivial information management system using concepts of basic files I/O and strings.For this purpose,a basic librarymanagement system is to be used for which some hints are given at the end of this document.
Your program should have a menu like this,
- ADD BOOK: adds a new book to system, each book must have a name, genre and a unique code, the code for each book must be unique, if user enters a code that exists, the system should show a message and prevent user to enter a book with that code. Replace spaces in book names with underscores before adding to the system. The insertion will be done to the end of the list.
- DELETE BOOK: takes the code of book and delete the book with that code from system. If there is no book with this code, the system shouldshow a message. The code should be considered case- sensitive, that is, SC654, sc654,sC654 and Sc654are different codes.
- LIST OF BOOKS: shows a list of all books. The underscores in the file names should be replaced with spaces in the output.
- LIST BY GENRE: looks for specificbooks of just matching genre then a list of books appears.The genre should be considered case-insensitive, that is, Drama,drama, DRAMA, … are all same.
- SEARCH BOOK BY NAME: looks for specific books of matching name. If name does not exactly match and partially include the search phrase, it is also accepted and must be on returned list. The genre should be considered case-insensitive.
- PLOT HISTOGRAM: program should plot a histogram that represents the frequency of each English alphabet letter in the set of all book names.
This means that you may write a function that gets the book names from the file and counts the number of each letter appearing in the set book names, remember that case sensitivity is not important in this case (i.e. A=a ). The plot for the sample file books.txt is as follows:
0-
EXIT: First, saves the currentlist of booksto the same file it read at the beginning of the program and then exits the program.
Hints:
- Book codes must be unique, system should prevent duplicate code entries with proper messages, you may use a function that matches the new book code with existing codes on system to prevent duplication.
- Partially matching cases in searchoperations must get represented in search results,you may use string matching functions to do this.
- For your convenience a file (books.txt) containing of 40 books with unique codes in 10 different genres is given in text format, you can use them in your homework, also your program must be able to add new books or delete desired book.
- In the given file, the first column is codes of books, the second is the names of books and third one is their genre.
- Replace spaces in book names with underscores before inserting to the list of files.
- For plotting the histogram, don’t forget to ignore the numbers and any other special characters appearing in the file names(e.g. +,?,-,..), just consider English alphabet letters.
0 Comments
Answers (0)
See Also
Categories
Find more on Test and Measurement in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!