Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java application to simulate shipping tool for Michigan zip codes. Your companys home base is located in (the mythical community of) University Center,

Write a Java application to simulate shipping tool for Michigan zip codes.

Your companys home base is located in (the mythical community of) University Center, MI 48710 at latitude 43.5566 and longitude -83.9943 (note: Western Hemisphere longitudes are negative).

The user should see a numerical key pad as an interface to key in the digits of the zip code. Upon entering a valid zip code, the user should receive a dialog box containing the post office name and geographical informationincluding the distance from Delta College.

Your application should utilize a file zipMI.txt that contains all zip codes in Michigan including the location (latitude,longitude) and name of the post office. A sample line of input from the file will be:

48706 43.60880 -83.95300 MI Bay_City

Your application should be object oriented containing:

The main application GUI

At least one class that will act as a "data manager" for the list of zip code information

Consider additional classes to manage a zip code, a county, and/or a county list

The main application GUI should include the following components and features:

A numerical keypad with digits 0...9 (similar to a keypad on a computer keyboard) defined as buttons. Use layout managers as needed to accomplish this.

A text field that will display the zip code digits as they are keyed in by the user.

A button that will submit the user's request for a zip code search.

A button to "clear" the zip code digits currently in the text field.

Provide error message dialogs for the following errors:

A zip code having an invalid format (any form other than five numerical digits).

The zip code of University Center (48710) is entered.

An invalid zip code (which must be coordinated with the data manager class method(s).

The data manager class should perform the following tasks "behind the scenes":

Read the raw zip code information from the provided data files.

Store the information in one or more arrays within your class(es).

Search for the name, latitude, and longitude for the zip code entered.

Perform required distance calculations.

Combine zip code and county information as needed for given user input.

A basic description of the purpose of your software product will be to allow a user to enter a five-digit zip code and you will return the city, state, and optional geographical information. The output can be displayed via a simple dialog box and should contain the zip code, city name, post office latitude, and longitude, the distance of that post office from University Center.

The look and feel of the graphical interface is up to you. Be sure it is clear, organized, and understandable by any general user.

To calculate the distance from Delta College, you will need to integrate the great circle distance formula. This formula is provided and demonstrated for you in the following example: DistanceCalc.java.

the great circle distance formula

// Calculate great circle distance and return return RADIUS_EARTH * Math.acos( Math.sin(la1) * Math.sin(la2) + Math.cos(la1) * Math.cos(la2) * Math.cos(lo2-lo1) );

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

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

Recommended Textbook for

Introduction To Database And Knowledge Base Systems

Authors: S Krishna

1st Edition

9810206208, 978-9810206208

More Books

Students also viewed these Databases questions