LAB 6


Objectives


Task

We want to write a program that prompts for and input a US zip code (an integer of up to 9 digits) and outputs its POSTNET code. For background material on this subject, read this document.

As an example, here's an execution log of the proposed program:

    61181 : |:||:::::||:::|||::|::::||::||:|
    61820 : |:||:::::|||::|:::|:|||:::::||:|
   321456 : |::||:::|:|:::||:|::|:|:|::||::|:|::|
     1001 : |:::||||:::||::::::|||::|:| 

The program starts by prompting for and reading the zip code as an integer variable and then it prints the zip code and its POSTNET representation. Once the output is displayed, the program loops back and prompts for the next sequence. The process continues until the user enters a zip code that is either not positive or has more than 9 digits, at which point the program ends.

Generate a printout of the source code and an execution log containing at least 10 runs.

Hints:


Fall2002/HR