Created: 04/26/2022
This is an assignment for CSC 135 that I wrote code for. It asks for a ZIP Code input of 5 or 9, then creates a barcode format with ':' as short and '|' as long based on the old version of USPS Barcode formatting.
Here is what it should look like:
Here is a graph depicting the implementation digits of '0's as 'short' and '1's as 'long':
Here is a quick test of the program:
This program also has a left and right bar frame along with a 'checkdigit' that verifies the number being converted. This program is split into two classes, one for encoding the barcode and the driver that handles the rest.
Use Cases:
- This program would be useful for implementing a system that uses digits for identifying packages or other items and transferring it to a Barcode system that is quicker to scan by machines and has redundancy if the packaging number is damaged by dirt, mud, or a haphazard delivery driver.
Problems:
- The program has an inherit flaw with how it asks for inputs. It asks for a ZIP Code as an integer, not a string. This means that if a digit is entered in that starts with a 0, it will ignore the digit (Thanks Java).
Possible Work Arounds:
- Ask for the input as a string instead, and convert it from there. The way I have it converting, it just converts it to a string to check for the correct length, it does not check char by char when encoding to a barcode, which would be a better way to implement it. This would allow for more efficient code and an easier runtime.


