Question
C++ help with barcodes.============================================================================= This is what i have so far, not all the code goes into main, and maybe some functions need to be
C++ help with barcodes.=============================================================================
This is what i have so far, not all the code goes into main, and maybe some functions need to be made, any idea what to edit?
zip to bar code looks like this : ||:|:::|::|:|:|:::||:|::|::::|||
int main()
{
//std:: >> m >> n;
//use environtment cariable named QUERY_STRING
std::string s = getenv("QUERY_STRING");
// parse the string to get the intergers
// m = 5 & n = 4
// requires 2 newLines
std::cout
std::cout
Your result is:
"
std::cout
...very cool!
"
std::cout
std::istringstream iss(s);
// z = 94538
int z; char c;
iss >> c >> c >> z;
int r = z;
std::cout
return 0;
}
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 Bar 2 Bar 3 Bar 4 Bar 5 Digit Bar 1 (weight 7) (weight 4) (weight 2) (weight 1) (weight 0) 0 0 4 6 0 0 0 The digit can be easily computed from the bar code using the column weights 7,4, 2, 1,0. For example, 01100 is 0 7 + 1 4 + 1 x 2 + 0 1 + 0 x 0-6. The only exception is 0, which would yield 1 1 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 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 Bar 2 Bar 3 Bar 4 Bar 5 Digit Bar 1 (weight 7) (weight 4) (weight 2) (weight 1) (weight 0) 0 0 4 6 0 0 0 The digit can be easily computed from the bar code using the column weights 7,4, 2, 1,0. For example, 01100 is 0 7 + 1 4 + 1 x 2 + 0 1 + 0 x 0-6. The only exception is 0, which would yield 1 1 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 becomesStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started