C++ practice problem help

POSTNET (Postal Numeric Encoding Technique) is a barcode system that was used until 2013 by the United States Postal Service to assist in directing mail. The zip code and a check digit were encoded in half-height and full-height bars and printed on letters. Full-height frame bars were placed on either side of the six encoded digits. For this part of the project, your program will simply prompt the user for a name, street address, city, state, and zip code and output a mailing label. See Sample Output on page 2 for all the required output and format. Note the row of asterisks followed by the word, “Postage”. This is required.

In the next project, your program will output a true barcode using : for half bars and | for full bars, but you will not do any encoding in this part of the project. Instead, for your "pseudo" barcode you will:

Break a 5 digit zip code into individual digits
Calculate a check digit
Display all 6 digits with a space between each digit
Surround the group of digits with frame bars
To calculate the check digit:

Add up the 5 zip code digits. For example, if a letter is sent to 37660 it would have the sum of 22.
Find the remainder of this number when it is divided by 10, in this case 2. This is also known as the sum modulo 10. If the sum modulo 10 is 0, then the check digit will be 0. Otherwise, perform Step 3.
Subtract the sum modulo 10 from 10. Continuing with the example, 10 − 2 = 8. The check digit is therefore 8.
Summary:

Write a program that prints a mailing label with all information specified in the Sample Output.

Prompt the user for their name, street address, city, state and zip code.

Calculate a check digit.

Create a "pseudo" barcode and display it on the mailing label.

Barcode digits are separated by spaces. Use | for frame bars to surround the group of barcode digits.
what was the question? This just looks like the assignment text.

Ill get you started.
number %10 is the least significant digit in decimal. (for 1234 it is 4)
(number % 100 - number % 10)/10 is the next digit (for 1234, this is (34 - 4)/10 = 3
and (number % 1000 - number %100)/100 is (234-34)/100 = 2
and so on.


Last edited on
the sample is this
http://prntscr.com/ifdik7
I just didn't know how to make to code it
the formatting is my problem right now
Topic archived. No new replies allowed.