CPSC 120A -- Assignment #1:Humanitarian Aid Shipments

Due Friday, September 19, 2008 by 4 p.m.

The news of hurricanes in the last several weeks has made it clear that disaster planning and relief is both important and difficult. For this assignment you will write a Java program to help a relief organization plan the shipment of supplies to a disaster area.

The relief agency ships supplies to a disaster area in tractor trailers that measure 53 feet long, 98 inches wide, and 124 inches high on the interior. The agency needs a program that will help them compute the number of boxes of supplies they can afford to send and the number of trucks needed to send the supplies to the disaster area. They also would like additional information calculated such as the cost of the shipment and the time it would take the trucks to reach the disaster area. These values of course depend on things such as what commodity they are shipping, how much money they have available to buy the commodity, and the distance to the disaster area. It is assumed that all items are shipped in rectangular boxes and all boxes in a given shipment are the same size.

The program must meet the following requirements:

Input to the program will be:

Values to compute:

Assumptions: Your calculations should be based on the following assumptions and requirements.

Output Your output must be nicely formatted (similar to that below but you should choose your own way of formatting) and must include the following information (all appropriately labeled with white space):

Sample Output (NOTE: This shows the prompts and input of 36 48 54 for the dimensions of the box; $24,000 for the amount of money available for purchasing the commodity being shipped; $55 for the cost per box and 1430 for the distance. The input by the user is in bold.)

Analysis of Shipment of Humanitarian Supplies
=============================================
 
Enter size of each box to be shipped ---
   width, length, height (in inches): 36 48 54
Enter the amount of money available $: 24000
Enter the cost per box: 55
Enter the distance to the disaster site: 1430
 
Shipment Summary
****************
Box size (in inches): 36 by 48 by 54
Number of Boxes that will fit in a truck: _____
Maximum number of boxes that can be purchased: ____
Number of Trucks Needed: _____
Number of boxes to be shipped: _______
Total cost of the shipment: $  ______
Time to reach the disaster area:   ____ days and ____ hours

Additional Requirements:

Academic Integrity Reminder!!! Programming assignments are to be your own work. You may get help on the specifics of the assignment from no one except the instructor. You may not show your program to anyone or look at anyone else's program or share ideas with anyone about how to write the program or solve the problem.


Suggestions for completing the assignment