subject

Write a zip code class that encodes and decodes 5-digit bar codes used by the U. S. Postal Service on envelopes. The class should have two constructors. The first constructor should input the zip code as an integer, and the second constructor should input the zip code as a bar code string consisting of 0s and 1s, as described above. Although you have two ways to input the zip code, internally, the class should store the zip code using only one format (you may choose to store it as a bar code string or as a zip code number). The class should also have at least two public member functions, one to return the zip code as an integer, and the other to return the zip code in bar code format as a string. All helper functions should be declared private. Embed your class definition in a suitable test program. Your program should print an error message if an invalid bar code is passed to the constructor.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:00
During physical science class ben and jerry connected three identical lightbulbs in parallel to a battery where happens when ben removes one of the lightbulbs from it’s socket
Answers: 2
question
Computers and Technology, 23.06.2019 11:00
What are the possible consequences of computer hacking? what is computer piracy? describe some examples. what are the effects of computer piracy? what are the possible consequences of computer piracy? what is intentional virus setting? describe some examples. what are the effects of intentional virus setting? what are the possible consequences of intentional virus setting? what is invasion of privacy? describe some examples. what are the effects of invasion of privacy? what are the possible consequences of invasion of privacy? what is an acceptable use policy and what is the purpose of the acceptable use policy what is intellectual property and how can you use it?
Answers: 1
question
Computers and Technology, 23.06.2019 18:50
What is transmission control protocol/internet protocol (tcp/ip)? software that prevents direct communication between a sending and receiving computer and is used to monitor packets for security reasons a standard that specifies the format of data as well as the rules to be followed during transmission a simple network protocol that allows the transfer of files between two computers on the internet a standard internet protocol that provides the technical foundation for the public internet as well as for large numbers of private networks
Answers: 2
question
Computers and Technology, 23.06.2019 21:00
Alcohol’s affects on the cornea and lens of the eye make it more difficult
Answers: 1
You know the right answer?
Write a zip code class that encodes and decodes 5-digit bar codes used by the U. S. Postal Service o...
Questions
question
Mathematics, 30.10.2020 21:00
question
Mathematics, 30.10.2020 21:00
question
Business, 30.10.2020 21:00
question
English, 30.10.2020 21:00
question
Mathematics, 30.10.2020 21:00
question
Mathematics, 30.10.2020 21:00
question
Biology, 30.10.2020 21:00
Questions on the website: 13722362