/** * A book object consists of a title (such as "Ultra Running"), * a number of books in stock (such as 132), and a cost per book (such as 12.95). * * @author Devin Gray * @version 11-28-2015 */ public class Book { // instance variables - replace the example below with your own private String title; private int booksInStock; private double price; /** * Constructor for objects of class Book */ public Book(String title, int booksInStock, double price) { this.title = title; this.booksInStock = booksInStock; this.price = price; } public String getTitle() { return this.title; } public int getBooksInStock() { return this.booksInStock; } public double getPrice() { return this.price; } public double getTotalValue() { return this.price * this.booksInStock; } public void bookSold() { this.booksInStock = this.booksInStock - 1; } }