paxdesk.blogg.se

Online book store project in java
Online book store project in java






online book store project in java online book store project in java

Private int totalBooks // the number of books in this bookstore Private Book books // all the books in this bookstore myBkStore.Book(bt, pages, price, quant) Ĭase 2: ("Enter book title to buy: ") Ĭase 6: ("Thanks for coming") ĭefault: ("\nInvalid Choice") ("Enter the amount of pages of the book: ") String bt = s.next() //stores title of book user enters in ("Enter choice : ") Ĭase 1: ("Enter a book title") ("5) Print out the gross income of the bookstore") ("4) List all the information about the books in stock (in the Bookstore object)") ("3) List the titles of all the books in stock (in the Bookstore object)") ask user for his choice and validate it (make sure it is between 1 and 6) But I am not sure of how to call the inStock() function. Right now the code does not compile because I am receiving an error on the line that says if (bt = myBkStore.inStock(title, y)) because of incompatible types. I have a function called inStock, but I am unsure of how to call this function. The problem that I am having is checking to see if the book title that the user enters in is already in stock. When the user selects option 1, it asks the user to enter the book title, it then checks if the books is already in stock. Option 1 is to add more books to the stock. Currently, the one I am working on is option 1. The program gives the user 6 different options for them to select from. I am writing a bookstore program for homework.








Online book store project in java