Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Kevin Chavez
- public class Book
- {
- private String title;
- private String author;
- private String publisher;
- private String isbn;
- private double price;
- public Book()
- {
- setTitle("");
- setAuthor("");
- setIsbn("");
- setPublisher("");
- setPrice(0.0);
- }
- public Book(String title, String author, String publisher, String isbn, Double price)
- {
- setTitle(title);
- setAuthor(author);
- setPublisher(publisher);
- setIsbn(isbn);
- setPrice(price);
- }
- public void setTitle(String title)
- {
- this.title = title;
- }
- public String getTitle()
- {
- return title;
- }
- public void setAuthor(String author)
- {
- this.author = author;
- }
- public String getAuthor()
- {
- return author;
- }
- public void setPublisher(String publisher)
- {
- this.publisher = publisher;
- }
- public String getPublisher()
- {
- return publisher;
- }
- public void setIsbn(String isbn)
- {
- this.isbn = isbn;
- }
- public String getIsbn()
- {
- return isbn;
- }
- public void setPrice(double price)
- {
- this.price = price;
- }
- public double getPrice()
- {
- return price;
- }
- public String toString()
- {
- return("Title" + title + "Author" + author + "ISBN" + isbn + "Publisher" + publisher + "Price" + price);
- }
- public double calculate_charge(int quantity)
- {
- return(quantity * price);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement