public class TextBook extends Book{
	
	private int edition;

	public TextBook(String bookTitle, double bookPrice, int ed) {
		super(bookTitle, bookPrice);
		edition = ed;
	}
	
	//overriding the Book class method
	public String getBookInfo()
	{
		return super.getBookInfo()+"-"+edition;
	}
	
	public int getEdition()
	{
		return edition;
	}
	
	public boolean canSubstitueFor(TextBook textBook)
	{
		if (super.getTitle().equals(textBook.getTitle()))
		{
			if (edition >= textBook.getEdition()) return true;
			else return false;
		}
		return false;
	}
}
