Question: Until 2009, the US Postal Service printed a bar code on every envelope that represented the zip code using a format called POSTNET. We wil










Until 2009, the US Postal Service printed a bar code on every envelope that represented the zip code using a format called POSTNET. We wil be doing the same with only 5-digit zip codes. POSTNET consists of long and short lines, as seen below: The POSTNET representation of 67260 In the program, the zipcode will be represented by an integer and the corresponding barcode will be represented by strings of digits. The digit 1 will represent the long bar, and the digit 0 will represent the short bar. The first and last digits of a POSTNET code are always 1. Stripping these leaves 25 digits, which can be split into groups of 5. The above example translates into the following string and groups of five: 101100100010010101100110001 01100 10001 00101 01100 11000 Now, we look at each group of 5. There will always be two 1's. Depending on its location within the group, each 1 represents a number. When the numbers that the 1's represent are added together, you get that digit of the zip code. The table below translates the first group, which represents the number 6
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
