The barcode used by the U.S. Postal System to route mail is defined as follows: Each decimal
Question:
The barcode used by the U.S. Postal System to route mail is defined as follows: Each decimal digit in the ZIP code is encoded using a sequence of three half-height and two full-height bars. The barcode starts and ends with a full-height bar (the guard rail) and includes a checksum digit (after the five-digit ZIP code or ZIP+4), computed by summing up the original digits modulo 10. Implement the following functions • Draw a half-height or full-height bar on StdDraw.
• Given a digit, draw its sequence of bars.
• Compute the checksum digit.
Also implement a test client that reads in a five- (or nine-)
digit ZIP code as the command-line argument and draws the corresponding postal bar code.
Step by Step Answer:
Introduction To Programming In Java An Interdisciplinary Approach
ISBN: 9780672337840
2nd Edition
Authors: Robert Sedgewick, Kevin Wayne