Question: Programming Assignment Objectives Read data from standard in Write your own functions Use methods provided by the string object Tasks The United States Postal Service

Programming Assignment

Objectives

Read data from standard in

Write your own functions

Use methods provided by the string object

Tasks

The United States Postal Service encourages companies that send large volumes of mail to use a bar code to encode the zip code that the package should be routed to. Your job is to write software that will drive a barcode generator that your company designed and built. In order to get full credit for this assignment you must write your own functions, you should not be writing any code in the main function, it is given to you in the starter files. The encoding scheme for a five-digit zip code is shown in figure 1. There are full-height frame bars on each side. The five encoded digits are followed by a check digit, which is computed as follows: Add up all digits, and choose the check digit to make the sum a multiple of 10.

If you are generating the check digit (correction caracter), which is not a requirement of this project, you would follow the table below.

For example, the zip code 95014 has a sum of 19, so the check digit is 1 to make a sum equal to 20. Each digit of the zip code, and the check digit, is encoded according to table 1 where 0 denotes a half bar and 1 a full bar. The digit can be computed from the bar code using the column weights 7,4,2,1,0. For example, 01100 is 0 x 7 + 1 x 4 + 1 x 2 + 0 x 1 + 0 x 0 = 6. The only exception is 0, which would yield 11 according to the weight formula. Again, this is required for creating a NEW barcode. You are only supposed to verify existing barcodes.

Programming Assignment Objectives Read data from standard in Write your own functions

Use methods provided by the string object Tasks The United States Postal

Service encourages companies that send large volumes of mail to use a

bar code to encode the zip code that the package should be

What you will be graded on

You will be graded on the following criteria:

Your program compiles and runs. If your program does not compile, 60% of the grade is in jeopardy. However, depending on the severity of the issue, you can receive some credit.

Your code logic is correct. Be sure to test your conditionals and all of your endpoints. Code that is not reachable (Dead Code) should not be present.

You code is well structured and your use of abstraction is good.

Your use of variables and constants. Well named variables should be used. Constants should be used when warranted. Proper case for constants and camel case for variables should be used.

Your use of commenting and white space. Each file that is turned in needs a file header. All functions need function headers. Comments should be used to aid in readability (for you, weeks later and for others). White space aids in readability. If you are using an IDE then indentation is handled for you automatically. Sections of code should be broken up using blank lines; i.e., to separate declarations and code, etc..

What to turn in

All the files should be well documented, to include file headers and headers for each function, as well as appropriate inline comments.

Turn in main.cpp. Any other submission will not be graded.

5-DIgt ZIP Code (A Fleld) Correcton Charecier E-DZIP Code Here is more information regarding barcodes in the United States Digit Bar 1 (weight 7) Bar 2 (weight 4) Bar 3 (weight 2) Bar 4 (weight 1) Bar 5 (weight 0) 3 0 0 9 Weighting of digits in a postal bar code Sample Output

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!