Postal bar codes. 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.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here