In this assignment, you are tasked with creating a book collection management system that allows for adding, searching, updating stock, and removing books from the collection. The system must also display the total stock of books and calculate the total monetary pricing of all books in stock. Additionally, the collection can be sorted by author names.
Contribute Materials
Your contribution can guide someone’s learning journey. Share your
documents today.
Running head: BOOKSTORE APPLICATION BookStore Application Name of the Student: Name of the University: Author note:
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
1 BOOKSTORE APPLICATION The Bookstore Application Summary TheapplicationhasbeenbuiltusingtheJAVAlanguage.Theconsole-based application is meant to serve the purpose of maintaining a bookstore. The user can switch into the system as an administrator and add, view, update or delete books from the collection generated. The program generates an initial array of books and allows the user to add to it. Each book has a unique ISBN, title, author, publishing year and name, price and the numbers in stock. The User can also chose to update the price for the book or the stock count of it. Features of the bookstore application include, adding a new book, searching books by ISBN, Title and Author name, updating stock and price, calculating total stock amount, calculating total stock price, finding out the most expensive book, sorting the collection with respect to author names, deleting a book from the collection and so on.
2 BOOKSTORE APPLICATION UML Class Diagram
3 BOOKSTORE APPLICATION Algorithm Start Clientclass: Main ( ) Step 1:Display menu Step 2:Input choice Step 3:If (wrong choice) display ERROR message and goto step 1, else goto next step Step 4:Call respective functions of the BookStore class, according to user’s choice BookStoreclass: add ( ) Step 1:Input book details. Step 2:Create Book type object and add to array. Step 3:Increase array index by 1. searchBook ( ) Step 1:Input ISBN string Step 1:Call function searchISBN from Book class Step 2:If return value is -1 display ISBN missing else return search index. searchAuthor ( ) Step 1:Input author string Step 2:Call function searchAuthor from Book class Step 3:If return value is 0 display Author missing. searchBook ( ) Step 1:Input title string
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
4 BOOKSTORE APPLICATION Step 2:Call function searchTitle from Book class Step 3:If return value is -1 display book missing else return search index. updateStock ( ) Step 1:Input ISBN string Step 2:Call function searchBook from Book class Step 3:Input new stock value Step 4:Call updateStock method from Book class for the book object at the returned index in array. updatePrice ( ) Step 1:Input ISBN string Step 2:Call function searchBook from Book class Step 3:Input new stock value Step 4:Call updateStock method from Book class for the book object at the returned index in array. mostExp ( ) Step 1:Check if totalBook is 0 Step 2:If yes return back, else next step Step 3:Set variable max to 0 Step 4:For each object in array, get price Step 5:Check if price is > max, and update max and index to that price and index respectively. Step 6:Display book details totalStock ( )
5 BOOKSTORE APPLICATION Step 1:Check if totalBook is 0 Step 2:If yes return back, else next step Step 3:Set totalStock to 0 Step 4:For each object in array, get stock value and add to totalStock Step 5:Return totalStock netPrice ( ) Step 1:Check if totalBook is 0 Step 2:If yes return back, else next step Step 3:Set price to 0 Step 4:For each object in array, get stock value and add to price Step 5:Return price displayAll ( ) Step 1:Check if totalBook is 0 Step 2:If yes return back, else next step Step 3:For each object in array, call the display method from Book class remove ( ) Step 1:Call searchBook method Step 2:If index is returned successfully, goto next step. Step 3:For i = index andless than totalBooks-1, set Collection array value with its next value, and increment i Step 4:Decrease totalBooks value by 1 sort ( ) Step 1:Check if totalBook is 0
6 BOOKSTORE APPLICATION Step 2:If yes return back, else next step Step 3:Sort using reverse bubble sort Step 4:Call displayAll method End
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
7 BOOKSTORE APPLICATION Output run: Name: Seah Leng Ho Student Number: 33058916 Mode of Enrolment: External, Part time Welcome to My Book Store ------------------------ Main Menu ========= Enter 1: Create the book collection. Enter 2: Add a new book to the collection. Enter 3: Search book using ISBN. Enter 4: Search books by author name. Enter 5: Update stock by searching via ISBN. Enter 6: Update book price by searching via title. Enter 7: Find the most expensive book. Enter 8: Display the total stock of books.
8 BOOKSTORE APPLICATION Enter 9: Calculate and Display the total monetary pricing of all books in stock. Enter 10: Display all books in stock. Enter 11: Removes a book from the collection. Enter 12: Sort and display the Book Collection according to author names. Enter 0: Exit the system. Enter now... 1 Enter details for book #1... Enter the title of the book: War and Peace Enter the author name: Leo Tolstoy Enter the publisher name: ABC Enter the publishing year: 1928 Enter the ISBN: 123456 Enter the price:
9 BOOKSTORE APPLICATION $5.5 Enter the number of books in stock: 20 New book added! Enter details for book #2... Enter the title of the book: Wizard of Oz Enter the author name: Frank Baum Enter the publisher name: XYZ Enter the publishing year: 2009 Enter the ISBN: 987665 Enter the price: $-9
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
10 BOOKSTORE APPLICATION Price cannot 0 or less! Enter again...Enter the price: $9 Enter the number of books in stock: 0 Initial stock cannot 0 or less! Enter again...Enter the number of books in stock: 10 New book added! Enter details for book #3... Enter the title of the book: Jungle Book Enter the author name: Rudyard Kipling Enter the publisher name: QWE Enter the publishing year: 2010 Enter the ISBN:
11 BOOKSTORE APPLICATION 159357 Enter the price: $15.5 Enter the number of books in stock: 12 New book added! Main Menu ========= Enter 1: Create the book collection. Enter 2: Add a new book to the collection. Enter 3: Search book using ISBN. Enter 4: Search books by author name. Enter 5: Update stock by searching via ISBN. Enter 6: Update book price by searching via title. Enter 7: Find the most expensive book. Enter 8: Display the total stock of books. Enter 9: Calculate and Display the total monetary pricing of all books in stock. Enter 10: Display all books in stock.
12 BOOKSTORE APPLICATION Enter 11: Removes a book from the collection. Enter 12: Sort and display the Book Collection according to author names. Enter 0: Exit the system. Enter now... 2 Enter the title of the book: The Book of Art Enter the author name: Thomas Henry Enter the publisher name: Pop Art Publishers Enter the publishing year: 2017 Enter the ISBN: 102938 Enter the price: $0 Price cannot 0 or less! Enter again...Enter the price: $12.5 Enter the number of books in stock:
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
13 BOOKSTORE APPLICATION 5 New book added! Main Menu ========= Enter 1: Create the book collection. Enter 2: Add a new book to the collection. Enter 3: Search book using ISBN. Enter 4: Search books by author name. Enter 5: Update stock by searching via ISBN. Enter 6: Update book price by searching via title. Enter 7: Find the most expensive book. Enter 8: Display the total stock of books. Enter 9: Calculate and Display the total monetary pricing of all books in stock. Enter 10: Display all books in stock. Enter 11: Removes a book from the collection. Enter 12: Sort and display the Book Collection according to author names. Enter 0: Exit the system. Enter now... 3
14 BOOKSTORE APPLICATION Enter an ISBN to search for: 12345 Book by this ISBN does not exist in collection!! Main Menu ========= Enter 1: Create the book collection. Enter 2: Add a new book to the collection. Enter 3: Search book using ISBN. Enter 4: Search books by author name. Enter 5: Update stock by searching via ISBN. Enter 6: Update book price by searching via title. Enter 7: Find the most expensive book. Enter 8: Display the total stock of books. Enter 9: Calculate and Display the total monetary pricing of all books in stock. Enter 10: Display all books in stock. Enter 11: Removes a book from the collection. Enter 12: Sort and display the Book Collection according to author names.
15 BOOKSTORE APPLICATION Enter 0: Exit the system. Enter now... 1 Collection has already been initiated!! Main Menu ========= Enter 1: Create the book collection. Enter 2: Add a new book to the collection. Enter 3: Search book using ISBN. Enter 4: Search books by author name. Enter 5: Update stock by searching via ISBN. Enter 6: Update book price by searching via title. Enter 7: Find the most expensive book. Enter 8: Display the total stock of books. Enter 9: Calculate and Display the total monetary pricing of all books in stock. Enter 10: Display all books in stock. Enter 11: Removes a book from the collection. Enter 12: Sort and display the Book Collection according to author names. Enter 0: Exit the system. Enter now... 123456
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
16 BOOKSTORE APPLICATION Wrong entry!! Try again... Main Menu ========= Enter 1: Create the book collection. Enter 2: Add a new book to the collection. Enter 3: Search book using ISBN. Enter 4: Search books by author name. Enter 5: Update stock by searching via ISBN. Enter 6: Update book price by searching via title. Enter 7: Find the most expensive book. Enter 8: Display the total stock of books. Enter 9: Calculate and Display the total monetary pricing of all books in stock. Enter 10: Display all books in stock. Enter 11: Removes a book from the collection. Enter 12: Sort and display the Book Collection according to author names. Enter 0: Exit the system. Enter now... 1 Collection has already been initiated!!
17 BOOKSTORE APPLICATION Main Menu ========= Enter 1: Create the book collection. Enter 2: Add a new book to the collection. Enter 3: Search book using ISBN. Enter 4: Search books by author name. Enter 5: Update stock by searching via ISBN. Enter 6: Update book price by searching via title. Enter 7: Find the most expensive book. Enter 8: Display the total stock of books. Enter 9: Calculate and Display the total monetary pricing of all books in stock. Enter 10: Display all books in stock. Enter 11: Removes a book from the collection. Enter 12: Sort and display the Book Collection according to author names. Enter 0: Exit the system. Enter now... 3 Enter an ISBN to search for: 159357
18 BOOKSTORE APPLICATION Book Title: Jungle Book Book Author: Rudyard Kipling Book Publisher: QWE Book Publishing year: 2010 Book ISBN: 159357 Books in Stock: 12 Book Price: $15.5 Main Menu ========= Enter 1: Create the book collection. Enter 2: Add a new book to the collection. Enter 3: Search book using ISBN. Enter 4: Search books by author name. Enter 5: Update stock by searching via ISBN. Enter 6: Update book price by searching via title. Enter 7: Find the most expensive book. Enter 8: Display the total stock of books. Enter 9: Calculate and Display the total monetary pricing of all books in stock.
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
19 BOOKSTORE APPLICATION Enter 10: Display all books in stock. Enter 11: Removes a book from the collection. Enter 12: Sort and display the Book Collection according to author names. Enter 0: Exit the system. Enter now... 4 Enter the author's name to search for: Leo Tolstoy Book Title: War and Peace Book Author: Leo Tolstoy Book Publisher: ABC Book Publishing year: 1928 Book ISBN: 123456 Books in Stock: 20 Book Price: $5.5 Main Menu =========
20 BOOKSTORE APPLICATION Enter 1: Create the book collection. Enter 2: Add a new book to the collection. Enter 3: Search book using ISBN. Enter 4: Search books by author name. Enter 5: Update stock by searching via ISBN. Enter 6: Update book price by searching via title. Enter 7: Find the most expensive book. Enter 8: Display the total stock of books. Enter 9: Calculate and Display the total monetary pricing of all books in stock. Enter 10: Display all books in stock. Enter 11: Removes a book from the collection. Enter 12: Sort and display the Book Collection according to author names. Enter 0: Exit the system. Enter now... 5 Enter an ISBN to search for: 123456 Book Title: War and Peace Book Author: Leo Tolstoy
21 BOOKSTORE APPLICATION Book Publisher: ABC Book Publishing year: 1928 Book ISBN: 123456 Books in Stock: 20 Book Price: $5.5 Enter the new stock quantity for the book: 25 Stock updated! Main Menu ========= Enter 1: Create the book collection. Enter 2: Add a new book to the collection. Enter 3: Search book using ISBN. Enter 4: Search books by author name. Enter 5: Update stock by searching via ISBN. Enter 6: Update book price by searching via title.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
22 BOOKSTORE APPLICATION Enter 7: Find the most expensive book. Enter 8: Display the total stock of books. Enter 9: Calculate and Display the total monetary pricing of all books in stock. Enter 10: Display all books in stock. Enter 11: Removes a book from the collection. Enter 12: Sort and display the Book Collection according to author names. Enter 0: Exit the system. Enter now... 3 Enter an ISBN to search for: 123456 Book Title: War and Peace Book Author: Leo Tolstoy Book Publisher: ABC Book Publishing year: 1928 Book ISBN: 123456 Books in Stock: 25 Book Price: $5.5
23 BOOKSTORE APPLICATION Main Menu ========= Enter 1: Create the book collection. Enter 2: Add a new book to the collection. Enter 3: Search book using ISBN. Enter 4: Search books by author name. Enter 5: Update stock by searching via ISBN. Enter 6: Update book price by searching via title. Enter 7: Find the most expensive book. Enter 8: Display the total stock of books. Enter 9: Calculate and Display the total monetary pricing of all books in stock. Enter 10: Display all books in stock. Enter 11: Removes a book from the collection. Enter 12: Sort and display the Book Collection according to author names. Enter 0: Exit the system. Enter now... 6 Enter the book title to search for: Wizard of Oz
24 BOOKSTORE APPLICATION Book Title: Wizard of Oz Book Author: Frank Baum Book Publisher: XYZ Book Publishing year: 2009 Book ISBN: 987665 Books in Stock: 10 Book Price: $9.0 Enter the new price for the book: $ 10.6 Price updated! Main Menu ========= Enter 1: Create the book collection. Enter 2: Add a new book to the collection.
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
25 BOOKSTORE APPLICATION Enter 3: Search book using ISBN. Enter 4: Search books by author name. Enter 5: Update stock by searching via ISBN. Enter 6: Update book price by searching via title. Enter 7: Find the most expensive book. Enter 8: Display the total stock of books. Enter 9: Calculate and Display the total monetary pricing of all books in stock. Enter 10: Display all books in stock. Enter 11: Removes a book from the collection. Enter 12: Sort and display the Book Collection according to author names. Enter 0: Exit the system. Enter now... 4 Enter the author's name to search for: Frank Baum Book Title: Wizard of Oz Book Author: Frank Baum Book Publisher: XYZ Book Publishing year: 2009
26 BOOKSTORE APPLICATION Book ISBN: 987665 Books in Stock: 10 Book Price: $10.6 Main Menu ========= Enter 1: Create the book collection. Enter 2: Add a new book to the collection. Enter 3: Search book using ISBN. Enter 4: Search books by author name. Enter 5: Update stock by searching via ISBN. Enter 6: Update book price by searching via title. Enter 7: Find the most expensive book. Enter 8: Display the total stock of books. Enter 9: Calculate and Display the total monetary pricing of all books in stock. Enter 10: Display all books in stock. Enter 11: Removes a book from the collection. Enter 12: Sort and display the Book Collection according to author names. Enter 0: Exit the system.
27 BOOKSTORE APPLICATION Enter now... 7 The most expensive book is: Book Title: Jungle Book Book Author: Rudyard Kipling Book Publisher: QWE Book Publishing year: 2010 Book ISBN: 159357 Books in Stock: 12 Book Price: $15.5 Main Menu ========= Enter 1: Create the book collection. Enter 2: Add a new book to the collection. Enter 3: Search book using ISBN. Enter 4: Search books by author name. Enter 5: Update stock by searching via ISBN. Enter 6: Update book price by searching via title.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
28 BOOKSTORE APPLICATION Enter 7: Find the most expensive book. Enter 8: Display the total stock of books. Enter 9: Calculate and Display the total monetary pricing of all books in stock. Enter 10: Display all books in stock. Enter 11: Removes a book from the collection. Enter 12: Sort and display the Book Collection according to author names. Enter 0: Exit the system. Enter now... 8 Total stock of books in collection is: 52 Main Menu ========= Enter 1: Create the book collection. Enter 2: Add a new book to the collection. Enter 3: Search book using ISBN. Enter 4: Search books by author name. Enter 5: Update stock by searching via ISBN. Enter 6: Update book price by searching via title. Enter 7: Find the most expensive book. Enter 8: Display the total stock of books.
29 BOOKSTORE APPLICATION Enter 9: Calculate and Display the total monetary pricing of all books in stock. Enter 10: Display all books in stock. Enter 11: Removes a book from the collection. Enter 12: Sort and display the Book Collection according to author names. Enter 0: Exit the system. Enter now... 9 The net cost of all books in collection is: 492.0 Main Menu ========= Enter 1: Create the book collection. Enter 2: Add a new book to the collection. Enter 3: Search book using ISBN. Enter 4: Search books by author name. Enter 5: Update stock by searching via ISBN. Enter 6: Update book price by searching via title. Enter 7: Find the most expensive book. Enter 8: Display the total stock of books. Enter 9: Calculate and Display the total monetary pricing of all books in stock. Enter 10: Display all books in stock.
30 BOOKSTORE APPLICATION Enter 11: Removes a book from the collection. Enter 12: Sort and display the Book Collection according to author names. Enter 0: Exit the system. Enter now... 10 All books in the collection are as follows: Book Title: War and Peace Book Author: Leo Tolstoy Book Publisher: ABC Book Publishing year: 1928 Book ISBN: 123456 Books in Stock: 25 Book Price: $5.5 Book Title: Wizard of Oz Book Author: Frank Baum Book Publisher: XYZ Book Publishing year: 2009 Book ISBN: 987665
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
31 BOOKSTORE APPLICATION Books in Stock: 10 Book Price: $10.6 Book Title: Jungle Book Book Author: Rudyard Kipling Book Publisher: QWE Book Publishing year: 2010 Book ISBN: 159357 Books in Stock: 12 Book Price: $15.5 Book Title: The Book of Art Book Author: Thomas Henry Book Publisher: Pop Art Publishers Book Publishing year: 2017 Book ISBN: 102938 Books in Stock: 5 Book Price: $12.5 Main Menu
32 BOOKSTORE APPLICATION ========= Enter 1: Create the book collection. Enter 2: Add a new book to the collection. Enter 3: Search book using ISBN. Enter 4: Search books by author name. Enter 5: Update stock by searching via ISBN. Enter 6: Update book price by searching via title. Enter 7: Find the most expensive book. Enter 8: Display the total stock of books. Enter 9: Calculate and Display the total monetary pricing of all books in stock. Enter 10: Display all books in stock. Enter 11: Removes a book from the collection. Enter 12: Sort and display the Book Collection according to author names. Enter 0: Exit the system. Enter now... 11 Enter an ISBN to search for: 159357 Book Title: Jungle Book
33 BOOKSTORE APPLICATION Book Author: Rudyard Kipling Book Publisher: QWE Book Publishing year: 2010 Book ISBN: 159357 Books in Stock: 12 Book Price: $15.5 Book removed! Main Menu ========= Enter 1: Create the book collection. Enter 2: Add a new book to the collection. Enter 3: Search book using ISBN. Enter 4: Search books by author name. Enter 5: Update stock by searching via ISBN. Enter 6: Update book price by searching via title. Enter 7: Find the most expensive book. Enter 8: Display the total stock of books.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
34 BOOKSTORE APPLICATION Enter 9: Calculate and Display the total monetary pricing of all books in stock. Enter 10: Display all books in stock. Enter 11: Removes a book from the collection. Enter 12: Sort and display the Book Collection according to author names. Enter 0: Exit the system. Enter now... 12 The sorted collection is as follows... All books in the collection are as follows: Book Title: Wizard of Oz Book Author: Frank Baum Book Publisher: XYZ Book Publishing year: 2009 Book ISBN: 987665 Books in Stock: 10 Book Price: $10.6 Book Title: War and Peace
35 BOOKSTORE APPLICATION Book Author: Leo Tolstoy Book Publisher: ABC Book Publishing year: 1928 Book ISBN: 123456 Books in Stock: 25 Book Price: $5.5 Book Title: The Book of Art Book Author: Thomas Henry Book Publisher: Pop Art Publishers Book Publishing year: 2017 Book ISBN: 102938 Books in Stock: 5 Book Price: $12.5 Main Menu ========= Enter 1: Create the book collection. Enter 2: Add a new book to the collection. Enter 3: Search book using ISBN.
36 BOOKSTORE APPLICATION Enter 4: Search books by author name. Enter 5: Update stock by searching via ISBN. Enter 6: Update book price by searching via title. Enter 7: Find the most expensive book. Enter 8: Display the total stock of books. Enter 9: Calculate and Display the total monetary pricing of all books in stock. Enter 10: Display all books in stock. Enter 11: Removes a book from the collection. Enter 12: Sort and display the Book Collection according to author names. Enter 0: Exit the system. Enter now... 15 Wrong entry!! Try again... Main Menu ========= Enter 1: Create the book collection. Enter 2: Add a new book to the collection. Enter 3: Search book using ISBN. Enter 4: Search books by author name. Enter 5: Update stock by searching via ISBN.
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
37 BOOKSTORE APPLICATION Enter 6: Update book price by searching via title. Enter 7: Find the most expensive book. Enter 8: Display the total stock of books. Enter 9: Calculate and Display the total monetary pricing of all books in stock. Enter 10: Display all books in stock. Enter 11: Removes a book from the collection. Enter 12: Sort and display the Book Collection according to author names. Enter 0: Exit the system. Enter now... 0 Thank you!! BUILD SUCCESSFUL (total time: 5 minutes 54 seconds)