Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Irma Pince's Library Management System Irma Pince's Library Management System The Hogwarts librarian has many duties, including: Paperwork: Establishing library rules, regulations, policies and procedures.

Irma Pince's Library Management System

Irma Pince's Library Management System

The Hogwarts librarian has many duties, including:

Paperwork:

  • Establishing library rules, regulations, policies and procedures.
  • Preparing the library due date sheets and maintaining overdue records.
  • Prepare and manage the library budgets, circulation files, statistics and inventories.
  • Classify, and catalogue library books in order to properly making them ready for checkout.

Practical work:

  • Monitoring the Library, as well as keeping it organized, clean and neat.
  • Assisting students and staff members in finding the desired reading material.
  • Implementing and enforcing library rules, regulations, policies and procedures.
  • Placing spells on the books aimed at protecting them from mistreatment or theft.
  • Checking the authenticity of the written permissions slips for the Restricted Section.
  • Making sure all students have left the library by 8:00 pm, at which time the library closes.
  • Overseeing the Study Hall and helping students with academic research and/or homework.
  • Undertaking any other reasonable duty at the request of the Headmaster/Headmistress of Hogwarts.

Technical Details

  1. Everything in Stage I goes into main.py
  2. Take a command line argument which is the filename, which is the command script, in your main statement. Do NOT take input! Read the file with the given filename.
  3. Create a function called hogwarts_library() which takes one input argument which is a string representing all the contents of command script.
  4. Process the string line-by-line (Hint: split by newline character)
  5. Create a variable (in modular scope) named "book_collection", as a dictionary with the key being a string, book_title, and the value a Book nametuple instance.
  6. Create a function command_nb() which takes in one single line of command (a string) starting with "NB" and process accordingly
  7. Create a function command_li() which takes in one single line of command (a string) starting with "LI" and process accordingly
  8. Create a function command_db() which takes in one single line of command (a string) starting with "DB" and process accordingly
  9. Create a function command_fb() which takes in one single line of command (a string) starting with "FB" and process accordingly
  10. Create a function command_as() which takes in one single line of command (a string) starting with "AS" and process accordingly
  11. Create a function command_lm() which takes in one single line of command (a string) starting with "LM" and process accordingly
  12. Create a function command_pl() which takes in one single line of command (a string) starting with "PL" and process accordingly
  13. In hogwarts_library(), call one of the command_* functions whenever a newline in command script is stepped onto
  14. Add functions using the format/pattern above for other commands as needed in each stage
  15. Don't be afraid to think outside the box.

Stage I

For this stage, your program will keep track of the rooms that are available. This stage implements four commands, as described below. On each command line, the first two non-whitespace characters are the command; command letters may be upper or lower case.

  1. NB (for "Add a New Book") followed by a comma separated list of fields: title=Title,author=Author,year_published=####,subject=Subject, section=Restricted Add a new book with the specified information. To keep the project simple, we only allow one copy of a book to present in the library.
  2. LI (for "List Inventory"). Print a list of all books owned/maintained by the library sorted by title.
  3. DB (for "Delete Book") followed by a title=Title. Print the message, "Book Not Found. Cannot be deleted." if the specified book isn't present in the library. NOTE: You will update this function again in Stages II & III.
  4. FB (for "Find Books") followed by 0 or more of the following search criteria: title=Title,author=Author,year_published=####,subject=Subject,section=Section. Print a list of books, sorted by title, that are owned/maintained by the library that meet the provided criteria. If 0 criteria is provided, then print all books. If no books are found matching the criteria provided, print the message, "No Books Found."
  5. AS (for "Add Student") followed by the following fields: student_name=Student Name, house_name=House. Add the student to library members. If the student is already present, print "Student Name is already present."
  6. LM (for "List Members") prints members according to each house, sorted by house and member name. If no members of a house are registered, print "No Registered Members".
  7. PL (for "Print Line"), followed by any text. Simply print (or "echo") a line, copying the input (not counting the PL and leading whitespace) to the output. You'll find it useful in testing, and it's also a simple way to make the program's reports clearer or fancier.
  8. ** Comment, followed by any text. Like comments in a program, comment lines don't have any effect on the program's behavior; they just serve as annotations in the command file.

The input file may contain any number of these commands in any order. See the sample output below for the format of the printed books list.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 2012 Proceedings Part 2 Lnai 7197

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284892, 978-3642284892

More Books

Students also viewed these Databases questions

Question

5. A review of the key behaviors is included.

Answered: 1 week ago