Question: Using Eclipse (Java) ------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------ The example given by the textbook is as followed (but I need help with the above question) I NEED HELP
Using Eclipse (Java)


------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
The example given by the textbook is as followed (but I need help with the above question)

I NEED HELP WITH THE #1 AND #2 (FIRST SET OF PICTURES)
THE BOTTOM HALF OF THE PICTURE IS JUST WHAT THE TEXTBOOK HAS PROVIDED FOR THIS QUESTION.
This is as specific as possible this question can get, PLEASE pay attention to the writing. And if it needs more information, it would help if you'd ask SPECIFIC questions.
1. Given the following ZIP codes, print out their bar code. Use":"for half bars, l" for full bars. Input: 12345, 33199, 20500, 10001, 99950, 00501 2. Given the following bar codes, check if it is valid. If it is correct, decode it into ZIP code; otherwise, print a message "bar code is not valid!". Example Input: T::I::I:1:1:1:1:11:: :: 1:11 11:1:1:1:11:1:1:1:11:1:1 IN:1:1:1:1::::||::::::|| J:::::I::1:111:.::|:11: 1:1::11:1:::::::::::::|1:1 your class and a tester, similar to the approach in Section d.). - P8.6 For faster sorting of letters, the U.S. 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 9. 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 *************** ECRLOT ** C057 Frame bars C057 CODE C671RTS2 JOHN DOE 1009 FRANKLIN BLVD SUNNYVALE CA 95014 - 5143 II.l., il. ll. ll lll lll Digit 1 Digit 2 Digit 3 Digit 4 Digit 5 Check Digit |||||||||IIIIIIIIIIIII Figure 8 A Postal Bar Code Figure 9 Encoding for Five-Digit Bar Codes er 8 Designing Classes 4 1 1 1 1 1 o oo - 1 4 make the sum a multiple of 10. For example, the sum of the digits in the ZIP code 95014 is 19, so the 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 Weight right, where 0 denotes a half bar and 1 a full Digit 7 2 0 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, 2 1 01100 is 3 0 1 0 0x7+1 X 4+1 X2+0x1+0x0=6 1 0 0 1 The only exception is o, which would yield 11 1 0 1 0 according to the weight formula. Write a program that asks the user for a ZIP 6 1 0 code and prints the bar code. Use : for half 7 1 bars, | for full bars. For example, 95014 0 becomes 8 0 11:1:::1:1:11::::::::::::||| 9 0 1 0 (Alternatively, write a graphical application 0 1 1 0 0 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. 5 0 1 0 0 0 1 1 0 1 0 1 0 0 097 Imol fontactante do 1. Given the following ZIP codes, print out their bar code. Use":"for half bars, l" for full bars. Input: 12345, 33199, 20500, 10001, 99950, 00501 2. Given the following bar codes, check if it is valid. If it is correct, decode it into ZIP code; otherwise, print a message "bar code is not valid!". Example Input: T::I::I:1:1:1:1:11:: :: 1:11 11:1:1:1:11:1:1:1:11:1:1 IN:1:1:1:1::::||::::::|| J:::::I::1:111:.::|:11: 1:1::11:1:::::::::::::|1:1 your class and a tester, similar to the approach in Section d.). - P8.6 For faster sorting of letters, the U.S. 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 9. 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 *************** ECRLOT ** C057 Frame bars C057 CODE C671RTS2 JOHN DOE 1009 FRANKLIN BLVD SUNNYVALE CA 95014 - 5143 II.l., il. ll. ll lll lll Digit 1 Digit 2 Digit 3 Digit 4 Digit 5 Check Digit |||||||||IIIIIIIIIIIII Figure 8 A Postal Bar Code Figure 9 Encoding for Five-Digit Bar Codes er 8 Designing Classes 4 1 1 1 1 1 o oo - 1 4 make the sum a multiple of 10. For example, the sum of the digits in the ZIP code 95014 is 19, so the 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 Weight right, where 0 denotes a half bar and 1 a full Digit 7 2 0 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, 2 1 01100 is 3 0 1 0 0x7+1 X 4+1 X2+0x1+0x0=6 1 0 0 1 The only exception is o, which would yield 11 1 0 1 0 according to the weight formula. Write a program that asks the user for a ZIP 6 1 0 code and prints the bar code. Use : for half 7 1 bars, | for full bars. For example, 95014 0 becomes 8 0 11:1:::1:1:11::::::::::::||| 9 0 1 0 (Alternatively, write a graphical application 0 1 1 0 0 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. 5 0 1 0 0 0 1 1 0 1 0 1 0 0 097 Imol fontactante do
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
