Question: u need to use the Python plss follow all instructions and show me the output as well. and pls provide a Code thanksss i will


u need to use the Python plss follow all instructions and show me the output as well. and pls provide a Code thanksss i will upvote you .
Q2: You are required to design a system for a library to keep track of the available books in the library and their customers. The description of the classes as follows: (NOTE: All attributes and methods are public) 1. A class Person which has the following attributes and methods: a. ID - a unique integer b. name - string c. A constructor that initializes the person's name and set its ID. d. An _str_ method that returns the ID and name as string. 2. A class Customer which is also a Person, in addition to the Person attributes it has the following attributes: a. MEMBERSHIPS - a tuple class attribute with the following values "PLATENIUM, SILVER, or GOLD" b. membership - a string that can be only one of the MEMBERSHIPS element c. A constructor that initializes the customer membership and ID and name. d. An _str_ method that make a string of the ID and name (by calling the class Person_str_) and membership and then returns it. 3. A class Book which has the following attributes and methods: a. SN: Book serial number - unique integer b. Book title - string c. Book author - string d. Available: Boolean variable that indicate if the book is available or not Sample output: e. A Constructor that initializes the book title and author. It should also set the book serial number and set available to True. f. An_str_method that make a string of all the book information and then Welcome to the "Your Library Name" Library System returns it. What would you like to do? 4. A class Library which has the following attributes and methods: a. name - a string representing the name of the library 1. Add a new customer b. books - a list of all books in the library 2. Add a new book c. borrowed books - a dictionary of the books borrowed. The key should be the 3. Borrow a book book serial number and the value should be the customer ID. 4. Search for customers of specific membership d. customers - a list of library customers 5. Exit. e. A constructor that initializes the name of the library and creates an empty list 1 of books, an empty list of customers and an empty dictionary of borrowed Enter customer name: Abecr books. Choose the membership type: f. add_customer(self, name, membership); add a new customer to the list of 1. Platinum customers 2. Silver g. add_book(self, title, author): add a new book to the list of books 3. Gold h. borrow_book(self, book_sn, customer_id): add a new entry to type: 1 Customer has been added borrowedbooks dictionary, the key is the book_sn and the value is Customer has been added customer_id Welcome to the "Your Library Name" Library System i. get_available_books[self]; returns a list of available books j. find_customer_with_membership(self, membership): returns a list of What would you like to do? customers with the passed membership type 1. Add a new customer k. is_valid_book_sn(self, sn): check if the passed serial number is valid or not 2. Add a new book 1. is_valid_customer_id(self, id):: check if the passed customer is valid or not 3. Borrow a book 4. Search for customers of specific membership You should design your code in a way that can handle any bad input from the user without 5. Exit crashing (Exception handling). The explained methods should be enough, however, if you need to add more methods or functions, you can do so. Make sure to add comments choice: 1 explaining each function. Enter customer name: Sara Choose the membership type: Write a test code. Create an object (instance) of type Library with the name that you 1. Platinum choose for your library. Then, print a menu that allow users to add a customer, add a 2. Silver 3. Gold book, borrow a book, or search for customers with specific membership. If the user type: 2 chose to borrow a book, then only print the books that are available. Make sure to Customer has been added change the book availability to False if a user borrowed it. If all the books are borrowed, then, print "Sorry, there are no available books to borrow". Refer to the sample output. Welcome to the "Your Library Name" Library System Note: this is just a sample output, your code should handle any possible input even if it is not illustrated in the sample output. What would you like to do? 1. Add a new customer 2 Add a new book 3. Borrow a book 4. Search for customers of specific membership 5. Exit choice; 4 Enter the type of membership you are looking for: 1. Platinum 2. Silver 3. Giold
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
