Question: Program Requirement Write a C++ program which will read in zip codes, one at a time, and produce a bar code for each zip code,

Program Requirement Write a C++ program which will read in zip codes,one at a time, and produce a bar code for each zipProgram Requirement Write a C++ program which will read in zip codes, one at a time, and produce a bar code for each zip code, such as in the examples above. The zip codes will be stored in a file called zip codescode, such as in the examples above. The zip codes will beRequirements: 1. Write at least one function that will do the work of encoding a zip code: string buildBarCode(const string& zipcode);

5. Use a good indentation scheme through out your program to help readability. 6. Do not use global variables. Declare all of your variables within functions. 7. Carefully choose self-descriptive variable names to help document your program. 8. Use blank lines as separators, if necessary, to help set off blocks of statements which should be logically grouped together.

please describe the program for me by putting comment in the program. thank you.

Postal Bar Codes The post office used to use a method of converting a zip code into a bar code which could be scanned by machines to help in routing letters to their destinations. Each digit of a zip code had a designated bar code representation for it consisting of a sequence of five tall and short vertical bars. The bar code was constructed by essentially substituting each digit with its bar code representation and adding a check sum code. This representation was enclosed with tall vertical bars which acted as bookends to make the final encoding There are three different types of zip codes which could be converted into a bar code. The first is the early version short 5 digit zip code, such as 67218. This was extended by appending four additional digits to produce a second, more specific version, such as 67218-1234. The extended version is now widely used today. The third version is the advanced bar code which is seen less frequently. This is an improvement of the second version by appending the last two digits of your street address or post office box number to the extended standard. An example would be 67218-1234+12 So the general representation of a zip code is: Z-EI+A]], where Z represents a sequence of 5 digits, E represents a sequence of 4 digits, and A a sequence of 2 digits. The contents of a matching pair of brackets are optional. So some example zip codes would be: 12345, 12345-1234, and 12345-1234-12 The format for a bar code was: |z[efal|]c| where is a vertical bar character, Z represented the 5 digit encoded short bar code, E represented the optional 4 digit encoded bar code extension, and A represented the optional encoded 2 digit delivery point. C was used as a check sum digit which was also bar encoded. It was required for all codes. The check sum digit was the unique digit, which when added to the sum of all the other digits, would make the sum a multiple of 10. For example, if the zip code is 67218, then 6+7+2+18 24, so the check sum digit must be 6. Then all 6 digits would be converted to their bar code equivalents We will represent short vertical bars by a ., and the tall vertical bars by a . The bar code representations for the digits were as follows

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!