Question: Use Object Oriented Java. POSTNET ( Post al N umeric E ncoding T echnique) was a barcode used by the United States Postal Service to

Use Object Oriented Java. POSTNET (Postal Numeric Encoding Technique) was a barcode used by the United States Postal Service to assist in sorting and directing mail. The ZIP+4 code is encoded in half- and full-height bars. The barcode starts and ends with a full bar called the frame bars. Each individual digit is represented by a set of five bars, two of which are full bars and three half bars, in a pseudo-binary code as in table 1.

 Use Object Oriented Java. POSTNET (Postal Numeric Encoding Technique) was a

The complete bar code consists of a start full frame bar, the 9 digit barcodes, a check digit barcode, and a stop full frame bar.

The check digit is computed as follows:

1) Add all nine digits and compute the remainder of the sum when divided by 10.

2) If the remainder is zero, the check digit is zero.

3) Otherwise, the check digit is ten minus the remainder.

Example:

The ZIP+4 of 55555-1237 yields a check digit of 2for encoded data of 5555512372 Together with the start and stop frame bars, this would be represented as:

barcode used by the United States Postal Service to assist in sorting

You can use the following data declarations to encode the barcode for each digit.

public static final char FB='\u2503',HB='\u257b'; private static String[] barcode = { ""+FB+FB+HB+HB+HB, ""+HB+HB+HB+FB+FB, ""+HB+HB+FB+HB+FB, ""+HB+HB+FB+FB+HB, ""+HB+FB+HB+HB+FB, ""+HB+FB+HB+FB+HB, ""+HB+FB+FB+HB+HB, ""+FB+HB+HB+HB+FB, ""+FB+HB+HB+FB+HB, ""+FB+HB+FB+HB+HB};

FB is a unicode full bar and HB is a unicode half bar. barcode[digit] is the barcode for that digit.

Make a class Postnet with a constructor that takes a 9-digit zip+4 code and a method public String barCode() that returns the barcode for that zip+4. Write a test program to ask the user for a zip+4 code and then print the corresponding bar code.

Another example:

Imperial Valley College 380 E ATEN RD IMPERIAL CA 922519653

and directing mail. The ZIP+4 code is encoded in half- and full-height

74210 11000 0001 00101 00110 01001 0101 01100 10001 10010 1 0100 Digit Barcode " , , 4 luli Start/Stop

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!