Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python pls. also pls include comments and ouput results. thank you. Problem specification: Write a program that asks the user to enter a zip code

python pls. also pls include comments and ouput results. thank you.

Problem specification: Write a program that asks the user to enter a zip code (in ZIP+4 format) then encode the zip code and prints out the barcode (note: this is the old format barcode.)

Example: The ZIP+4 of 55555-1237 yields a check digit of 2 for encoded data of 5555512372 Together with the initial and terminal frame bars, this would be represented as:

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Your program should import a digitprint module (see attachment) that has print_zero(), print_one(), print_start_stop() functions (instead of using the given module you can write your own functions to print out the barcode for digits), write a function that reads in a ZIP+4 code and returns a string by removing the character, another function for generating the check sum, and then a main function that completes the project. Dont forget to call the main function to run.

Digit

7 4 2 1 0

Barcode

0

1 1 0 0 0

image text in transcribed

1

0 0 0 1 1

image text in transcribed

2

0 0 1 0 1

image text in transcribed

3

0 0 1 1 0

image text in transcribed

4

0 1 0 0 1

image text in transcribed

5

0 1 0 1 0

image text in transcribed

6

0 1 1 0 0

image text in transcribed

7

1 0 0 0 1

image text in transcribed

8

1 0 0 1 0

image text in transcribed

9

1 0 1 0 0

image text in transcribed

Start/Stop

1

image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions