The Completed Book Class

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.

Answer:

See below.

The Completed Book Class

class Book  extends Goods implements Taxable
{
  String author;

  Book( String des, double pr, String auth)
  {
    super( des, pr );
    author  = auth ;
  }

  void display()
  {
    super.display() ;
    System.out.println( "author: " + author );
  }

  public double calculateTax()
  {
    return price * taxRate ;
  }
}

QUESTION 14:

Is the taxRate for Book the same as for Toy?