Program 4: Zip Code Utility Package

Purpose

The purpose of this assignment is to continue to gain experience designing and implementing classes. The assignment is a variation of one of the assignments found at the end of Chapter 8, Designing Classes.

Partners

You may (and are encouraged to) work with at most one other partner on this assignment. You and your partner must be in the same lab section. If you work with a partner, submit one solution with both of your names on it.

Assignment

Create a BlueJ project named Program4 and place the following file in it:

Your task is to create the missing ZipCode class such that when the main method of the Driver class is run, the output sent to the terminal window might look something like this sample output. The user provides the input following the colon(:) on each line of the transcript that starts with the words Please enter. All other output in the transcript is produced by the program. The Driver should not be modified.

Problem Description

The function of this program is to be able to convert back and forth between 5 digit zip codes (consisting of the numbers 0 through 9) and 32 character bar codes (consisting of the characters '|' and ':'). Programming Project 8-2 on pages 334 and 335 of Chapter 8 describes how to convert back and forth between zip code and bar codes. If you are interested, you can also learn more about zip codes by reading this Wikipedia article.

Getting Started

Before beginning, make sure that you understand the code provided to you in the Driver class and that you understand the sample output transcript.

Notice that there are minimally four methods in the ZipCode class that you will need to provide:

Grading (60 points possible)

Submission

E-mail the ZipCode.java file as an attachment to your lab TA no later than the start of your lab on Tuesday, November 18th. Late submissions receive no credit, but partial credit can be earned by making an ontime submission. The subject of the e-mail should be CS 160, Program 4, your name, your partner's name.

Valid XHTML 1.0!