Question: In C++ please. Objectives: Use functions, loops, and input/output streams The US Postal Services uses bar codes to represent zip codes in order to sort
In C++ please.

Objectives: Use functions, loops, and input/output streams The US Postal Services uses bar codes to represent zip codes in order to sort them quickly using machines. The machine will read the bar code and direct the letter to the right location. Write a C++ program that generate bar codes. The program should read the zip codes from an text file and determine the complete bar codes. All the codes along with the zip codes must be stored in another file. The program must ask the user for both the input and output file names. Your program should generate the codes repeatedly from the file until the end of the input file is reached. Your program should output an error message if the zip code read is invalid (for example, non-digit character, fewer or more than 5 digits). See sample output file below. Bar Codes The code is represented by a series of short and long bars. The following table shows the barcodes for each digit. Value Encoding 1 2 3 4 5 5 7 B 0 Use'' and '|' to represent short and long bars. Acheck digit is also added at the end of the barcode. The check digit is determined by totaling all the digits of the zip code and adding a digit that makes the sum divisible by 10. For example, if the sum of all the digits is 38 then the check digit is 2, if the sum is 10 the check digit is 0, etc. A long bar is added at the beginning and at the end of the barcade (total of 32 bars). The following is an example of the code 45701 (sum = 17, check digit is 3) 5 7 0 1 1:1::/ :1:1: 1313:||-:||: 3 Check Digit Your program must include at least the following two functions (do not change the names or the prototypes): string qe Digit.code (char digit): return a barcode for a single digit in- get checkdigitvaluelint sum): return the check digit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
