Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3 Reaction to Aticles The Postal Service The Postal Service Bring your Java packages to such great heights Compline the folowing programming problem related to

image text in transcribed
image text in transcribed
3 Reaction to Aticles The Postal Service The Postal Service Bring your Java packages to such great heights Compline the folowing programming problem related to ZP codes and mail routiyg For faster sorting of letters, the United States Postal Service encourages companies that send large volumes of mail to use a bar code denoting the ZIP code (see Figure 8) The encoding scheme for a five-digit ZIP code is shown in Figure 8. There are full-height frame bars on each side. The five Weight Digit 74 2 1 0 digits are followed by a check digit, which is computed as follows: Add up all sum a multiple of 10. For example, the sum of the digits in the ZIP code 95014 is 19, so the 3 check digit is 1 to make the sum equal to 20. Each digit of the ZIP code, and the check digit, is encoded according to the table at right, where 0 denotes a half bar and 1 a full bar. Note that they represent all combina- tions of two full and three half bars. The digit can be computed easily from the bar code using the column weights 7, 4, 2, 1, o. For example, 01100 is 0 0 07+1x4+1x2+0x1+0x0-6 The only exception is 0, which would yield 11 according to the weight formula. Write a program that asks the user for a ZIP code and prints the bar code. Use: for half bars, I for full bars. For example, 95014 becomes DELL tions of two tull and three half bars. The digit can be computed easily from the bar code using the column weights 7,4,2, 1,0. For example, 01100 is 0x7+1x4+1 x2+0x1+0x0-6 The only exception is 0, which would yield 11 according to the weight formula. Write a program that asks the user for a ZIP code and prints the bar code. Use : for half bars, for full bars. For example, 95014 becomes (Alternatively, write a graphical application that draws real bars) Your program should also be able to carry out the opposite conversion: Translate bars into their ZIP code, reporting any errors in the input format or a mismatch of the digits. xECRLOT COS7 CODE C671RTS2 JOHN DOE 1009 FRANKILIN BLVD SUNNYVALE CA 95014-5143 Frame bans CO57 Digit 1 Digit 2 Digit 3 Digit 4 Digit 5 Chock Digit ILI LLIL Ihmi.ll ..LILLI! Figure 8 A Postal Bar Code Figure 9 Encoding for Five-Digit Bar Codes Stockton University rights eerved DOLL

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Database Systems Design Implementation And Project Management

Authors: Albert K.W. Yeung, G. Brent Hall

1st Edition

1402053932, 978-1402053931

Students also viewed these Databases questions

Question

Illustrate the link between business

Answered: 1 week ago

Question

Is short-selling good for the stock markets?

Answered: 1 week ago