Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

generateBarcode(...) *Precondition: The input String is not null. *Post condition: the returned string is exactly 12 characters in length where each character is a digit

generateBarcode(...)

*Precondition: The input String is not null.

*Post condition: the returned string is exactly 12 characters in length where each character is a digit [0-9]. The string should be constructed using the following rules:

-All characters in the string will be converted to numbers [0-26] e.g. 'A' or 'a' =1, 'Z' or 'z' =26. All the other character that are not letters =0.

-Groups of 3 consecutive characters numbers will be added together to form a new number; this value will be converted to a String of two digits(pad with a 0 in front of necessary)

-The next group of 3 this is to be done to is two characters later, and so on until 12 total characters have been made. This represents the barcode (If there are not enough character numbers to do this assume 0.

This is for Java

image text in transcribed

generateBarcode Example: String Character 165 9 14 5 0 19 15 12 0 0 0 39 34 00 Added Groups: Added Groups: 19 27 Final Barcode String: 391934270000

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

Step: 3

blur-text-image

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

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions

Question

LO1 Explain how the workforce is changing in unpredicted ways.

Answered: 1 week ago

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago