can help me to solve this question

A class called Book is designed as shown in the class diagram.


It contains:

• Four private instance variables: name (String), authors (ArrayList of the class Author you have just created), price (double), and qtyInStock (int);
• Two constructors: o public Book (String name, ArrayList authors, double price) {…} o public Book (String name, ArrayList authors, double price, int qtyInStock) {…}
• public methods getName(), getAuthors(), getPrice(), setPrice(), getQtyInStock(), setQtyInStock()
• bookInfo(): that returns “‘book-name’ by author(s)-name(s) (gender) at email”.

In main method (Application):
Design a simple bookshop in which:
· Declare an ArrayList of type book.
· Implement a repeated menu that performs the following:

  1. buy a new book
  2. sell a book (if in stock)
  3. print a book information by its name
  4. print all books information in the store
  5. print number of all books in the store
  6. print quantity of a specific book(by its name)
  7. Exit
    you need design a repeated menu that the user can interact with.
    Description of cases in the menu:
  8. Buy a new book: here you need to read from the user the book details; book name, authors details (name, email, gender), price and quantity of books then add that book in the arraylist. (note: if the book already in the bookshop -i.e. ArrayList-; then only increase the quantity of the book.
  9. sell a book (if in stock): here read the book name from the user and sell it; here there is 3 situations:
    a. decrease the quantity of that book by one; if the quantity > 1
    b. delete the book entirely from the arraylist; if quantity = 1
    c. print book not found, if the book does not exist in the ArrayList.
  10. print a book information by its name: read a book name from the user; then if the book exists print all its information, if not print book not found
  11. print all books information in the store: here you have to print the information for all the books stored in the arraylist. (hint: using bookInfo() method)
  12. print number of all books in the store: print how many books are in the store
  13. print quantity of a specific book(by its name): print how many books are in the store for a specific book which its name is read from the user; if the book name does not exist then print a message (“book not found in the store”).
  14. Exit: exit from the application (use: System.exit(0)).

Hi @shakerawad,

Where specifically are you getting stuck? It will be a lot easier to help you with any problems that you are facing if you can give us a detailed description of the roadblocks you are facing.

Thanks!