ISBN

Complete several static methods to analyze and convert Strings representing International Standard Book Numbers (ISBNs). There are two versions of the INSB: ISBN-10 (through 2007) and ISBN-13 (after 2007). For example, the ISBNs for Harry Potter and the Prisoner of Azkaban are 0-545-58293-8 and 978-0-545-58293-3. ISBNs can include hyphens or spaces (and the rules for hyphenation are very complicated). The results from these methods ignore hyphenation, result in ISBNs with either 10 or 13 characters, and (except for convert) allow isbn parameters either with or without the check digit.

To complete the assignment, complete the following methods and click Submit:

  1. Complete the code for the public static char check10(String isbn) method in the Isbn class that calculates the check digit for an ISBN-10 isbn. Check digits can be any of the base-10 numerals, plus 'X' (because 11 symbols are needed when the calculation of the check digit includes ).
  2. Complete the code for the public static char check13(String isbn) method in the Isbn class that calculates the check digit for an ISBN-13 isbn.
  3. Complete the code for the public static String convert(String isbn) method in the Isbn class that converts an ISBN-10 to its corresponding ISBN-13 or an ISBN-13 to its corresponding ISBN-10. Note: only ISBN-13s that begin "978" can be converted to ISBN-10s.

The Isbn class includes additional helper methods that you can use in your solutions.

Include an initial comment with an @author YOUR NAME <your@email.address> line in all solution files.

Suplemental information and links