CST 183 Programming Assignment 9

$30.00

Download Details:

  • Name: Project9-zg3oct.zip
  • Type: zip
  • Size: 838.71 KB

Category:

Description

Rate this product

Objective
To build a complete working Java program that offer practice with a more involved Java graphical user
interface, multiple classes, and a large data file.
Overview & Instruction
Write a Java application to simulate shipping tool for Michigan zip codes.
Your company maintains several shipping centers around Michigan. You need to build an application
to calculate the shipping cost between one of the shipping centers and any other community in the
state. Your shipping centers are in:
University Center (48710)
Mackinaw_City (49701)
Grand Rapids (49501)
Marquette (49855)
Traverse_City (49684)
From post offices at these locations, your company can ship to any other post office in Michigan
(except of course itself).
Build a user interface that allows the user to enter a shipping center and a zip code for the product
destination. Then, calculate and provide the shipping cost for the order. Create a drop-down list
(JComboBox) that includes the small list of shipping center cities. Also include an empty default
choice in the drop-down list for an initial setting. Next, build a numerical key pad as an interface to key
in the digits of the zip code. Include a (non-editable) text field to display the digits of the zip code as
they are keyed in. Finally, include buttons to Calculate, Clear, and Quit. The Calculate button should
determine the shipping cost and the Clear button should empty the zip code text field and reset the
drop-down list to the empty “non-choice”.
Upon entering a valid zip code, the user should receive a dialog box containing the post office name,
the distance from the shipping source (see below), and the cost to ship. For simplicity, assume it
requires only 5 cents per mile to ship a product.
For error checking, be sure that the zip code entered (1) has five digits, (2) exists in Michigan, and (3)
does not match the selected shipping center. A simple message dialog can be used to display an
error the user.
Your application requires a file zipMlcity.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
(note: Western Hemisphere longitudes are negative).