Reference no: EM132200306
Write a Java application that accepts a bar code as a command line parameter and prints out the ZIP code.
Assume that the bar code uses the symbols "|" and ":" for the long and short bars, respectively.
Provide warnings on errors in the bar code specifying what exactly is wrong.
The bar code input should be in the format specified in Problem 1, including the pair of the full bars at the beginning and at the end.
Important: The command line parameters of your Java program might contain special characters. This particularly concerns the second problem that expects a string including the "|" character.
This character has a special meaning for the shell command interpretor (namely piping, we will consider this later). In order to turn off interpretation of this character by the shell, include your parameters into ' ' (single quotes).
That is, type the bar code as '|:::|:||:|'. Do not confuse these quotes with the back quotes ` `. They have a different meaning for the shell command interpreter.