Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The zip code file contains almost 4 3 0 0 0 zip codes and related information Close study of the file reveals that the first

The zip code file contains almost 43000 zip codes and
related information
Close study of the file reveals that the first line contains
information about the remaining data lines
Consider creating a small subset of this file for testing
your code when everything works as you expect, then
use the full file
You will create several classes based on the contents
Your top level program should populate an instance of
the ZipCodes class defined in a moment, based on the
Zip class, which is also defined shortly
Define a class Zip that has properties for zip code,
primary city, state, and type of address
I
t should have the usual methods (including
constructors) and incorporate the Cloneable interface
Include a method or constructor that takes a single
string (from a line of the data file) to define a new
instance of the class
Define a class called ZipCodes that contains a collection
of Zip objects, with the usual
methods
Hint: Consider using a HashMap for storing the Zips
It should also have properties for storing unique city names and
unique state names
Include methods to
add a new Zip object and to return a
Zip object based on a string
parameter
like 91360
Later: The method should update all related collections, e.g.,
adding a Zip object to the collection should also update the
collections for unique cities and states
nclude a method for populating the
collections
from a
file, specified by its file
name
All classes should override toString
()
Later: also override
equals() and hashCode()
Later: If a class contains at least one collection,
incorporate
the Iterable interface
Provide meaningful Javadoc information
Document any assumptions you make for methods and
their behavior, such as how you would handle a city or
zip that isnt found place that documentation in the
Javadocs

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What should Gail do now?

Answered: 1 week ago