Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use stacks to implement the book check-in process at a library. You are working at a local library and one of your job responsibilities is
Use stacks to implement the book check-in process at a library. You are working at a local library and one of your job responsibilities is to stack the returned books to appropriate shelves. All books in the library are assigned a call number in a specific format two letters for the genre followed by a three-digit number. The library uses the following genres - CL (classic), FI (fiction), NF (non-fiction), YA (young adult), and independent genre for the all the other books. You have to write a Java program that uses a stack and helps you or the user of the program with the check-in process of the books. The program should prompt the user for the call numbers of the returned books. The user enters 'X' when there are no more call numbers to be entered. The call numbers are added to a stack (use LinkedStack). The program will then read each of the call numbers from the stack and let the user know the shelf on which each book should go, based on the genre of that book. For example, if the call number is FI234, the program will display Call No. FI234 belongs to FICTION shelf. Similarly, if the call number is HI786, the program will display Call No. H1786 belongs to INDEPENDENT shelf. After providing the shelving instructions for each book in the stack. The program will display the book check-in report with total number of books checked in and also the number of books checked in for each genre. Write a size () method in the Linkedstack class to find the total number of books in the stack (any other solution, such as summing up the count of books in each genre, will not be accepted). Sample report could look like this BOOKS CHECK-IN REPORT checked in 11 books today - Classic: 3 Fiction: 3 Independent: 2 Non-Fiction: 2 Young Adult: 1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started