Friday
August 22, 2014

Homework Help: programming java language

Posted by JAZZY on Wednesday, November 24, 2010 at 3:59pm.

For faster sorting of letters, the postal service encourages companies that send large volumes of mail to use bar code denoting the ZIP code (see figure below).

Student XXXX
PO Box 34689 Jeddah
21478
KSA
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. For example, the sum of the digits in the ZIP code 21478 is 22, so the check digit is 8 to make the sum equal to 30.
Each digit of the ZIP code, and the check digit, is encoded according to the following table, where 0 denotes a half bar and 1 a full bar.
Note that they represent all combinations 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, 0. For example, 01100 is

0.7+1.4+1.2+0.1+0.0 = 6

The only exception is 0, which will 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, 21478 becomes
| | : : | : : : : | | : | : : | | : : : | : : | : | : : | : |

You are requested to design the appropriate classes and supply the appropriate methods. Your solution must be Object Oriented (OO).

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

Data Management (Math) - A Canadian postal code uses six characters. The first, ...
postal service/mail delivery - Given that today is Thurs., Dec. 29th, 2011, will...
Computer Information - A __________ provides the tools that a programmer uses to...
vba excel - Our teacher wanted us to set up a command button that gives 3 input ...
Java Programming - I'm new to Java and I'm not sure how to write the source code...
programming - in java code what are the differences between 2, 2.0, '2', "2", ...
Computer Programming - I am trying to put the following in Python Code. I know ...
math - As you travel to new planets in the space age, you discover a culture ...
LEARNING SKILLS - Suppose you've already registered in the Penn Foster Web site...
Math - The registration code for a new softwear game you purchased consists of a...

Search
Members