Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please don't just copy and paste the answer... Main function must not be altered. Until 2009, the US Postal Service printed a bar code on

Please don't just copy and paste the answer... Main function must not be altered.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Until 2009, the US Postal Service printed a bar code on every envelope representing the zip code using a format called POSTNET. We will be doing the same with 5-digit zip codes. POSTNET consists of long and short lines, as seen below.: lIImIImIlInIIII The POSTNET representation of 67260, WSU's zip code 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 underlined group, which represents the number 6 POSTNET Digits Value 0 11 0 0 74 2 10 We see that the 1's correspond to the values of 4 and 2, respectively. Adding them up gives us 6, which is the first digit of the zip code (and also the fourth since the same group appears again, due to the zip code having two 6's) In order to represent the number 0, the 1's will add up to a value of 11. This is done because of the requirement that every group of five always has two 1's in it

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions

Question

=+Describe an important trade-off you recently faced

Answered: 1 week ago