Your Perfect Assignment is Just a Click Away

We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!

glass
pen
clip
papers
heaphones

University of California Irvine Inventory System for a Library Python Program

University of California Irvine Inventory System for a Library Python Program

Question Description

You are writing an inventory system for a library. This program will allow the user to enter a book, remove a book, and find a book. The book titles will be stored in a dictionary. Each key in the dictionary is a book’s title, and each value is the number of copies currently in stock.

In a continuous loop, give the user the option to add a book, remove a book, find a book, and quit.

  • If the user chooses to add a book, call a function named add_book. This function should ask the user for a book title. If the title is not in the dictionary, add it with a value of 1 to indicate there is now a single copy of that book in stock. If it is in the dictionary, update its value to indicate that another copy is now in stock.
  • If the user chooses to find a book, call a function named find_book which asks the user for a book title. If the book’s title exists in the dictionary, print out how many copies of it are currently in stock. Otherwise, print that no copies are in stock.
  • If the user chooses to remove a book, call a function named remove_book. In this function, ask the user to enter a title. If the title exists in the dictionary, remove a single copy. If there are no more copies in stock, remove the key/value pair from the dictionary. Hint: You may want to refer to the very end of lecture 12 for info on how to remove a specific key/value pair from a dictionary.

If the user chooses quit, write all of the dictionary’s information to a text file (i.e. store each book’s name as well as how many copies of that book the library has in stock). Hint: Don’t append! When the program starts, the data from the text file should be loaded into the dictionary (if the file exists).

Previous

Order Solution Now

Our Service Charter

1. Professional & Expert Writers: School Assignment only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by School Assignment are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. School Assignment is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At School Assignment, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.