a method which calculates and returns the total value in dollar terms of a

# A method which calculates and returns the total value

• Homework Help
• 4
• 100% (1) 1 out of 1 people found this document helpful

This preview shows page 1 - 3 out of 4 pages.

a method which calculates and returns the total value (in dollar terms) of a particular title (book) in stock (v) an equals method which compares two book objects and returns true if they have the same title, the same author and the same ISBN
ICT167 Assignment 2 2 TJA, 2017 You may add other methods as you see appropriate. However, you will need to document them clearly. The program will allow entry of these data for several books and perform some analysis and queries. Your program will provide the user with a menu which allows the following actions: 1. Quit 2. Create an array of N books. For each book, read in its details (i.e., title, name, publisher, year of publication, ISBN, price, and quantity in stock) from the keyboard, and store it in the array. Test it with N = 6. Do not use any java library class to store the books. 3. Output details (all information) of all books currently in stock; 4. View all information about a book chosen via its ISBN number. If the book is not in stock, an appropriate error message is to be displayed; 5. View all information about a book chosen via its author. If the book is not in stock, an appropriate error message is to be displayed. If there is more than one book by this author, the details of all those books should be displayed. 6. Given an ISBN, update the number of copies (quantity) of a book. If the book is not in stock, an appropriate error message is to be displayed; 7. Given the title of a book, update its price. If the book is not in stock, an appropriate error message is to be displayed; 8. Determine and display details of the most expensive book in stock; 9. Determine and display the quantity of total stock in the array (bookstore); 10. Determine and display the monetary value of total stock in the bookstore; 11. Add a new book to the array. Note that this operation will increase the array size by 1. 12. Given a book’s ISBN, delete/remove an existing book from the array. If the book is not found display an appropriate error message. Note that if delete is successful, it will reduce the array size by 1. 13. Using one of the sorting methods described in the lecture notes, sort the array of book objects into ascending (alphabetical/dictionary) order of their first authors, and output the sorted array.