CPSC 120 -- Assignment #1

Humanitarian Aid Shipment
Due Friday, September 18, 2009 by 4 p.m.

Write a Java program to help a local service organization plan a shipment of food to a war torn country. The organization wants to send one shipping container of a single commodity (such as wheat, maize, or dried milk). The shipping container is 9.5 feet wide by 40 feet long by 12 feet high. The commodity will be packaged in boxes which are different sizes depending on what is being shipped. The cost of a shipment depends on the number of boxes that must be loaded into the container and the weight (in pounds) of the goods to be shipped. The shipping company the organization plans to use charges $12.75 per box and $0.65 per pound for each pound in excess of 5000 pounds (so if the shipment weighed 15000 pounds the organization would be charged $0.65 per pound for 10000 pounds).

The program should compute the number of boxes that will fit in the container and the total cost of shipping the boxes. Furthermore the organization would like for the program to compute the amount of aid the shipment would supply in two ways: (1) the total number of people the shipment would feed for one day; (2) how long (expressed as months, weeks, and days) the shipment would feed a village of 150 people.

Input to the program will be:

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):

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

Sample Output (NOTE: This shows the prompts and input of 24 36 30 for the dimensions of the box; 7.5 for the weight; 2.5 for the amount to feed one person for one day.)

Analysis of Shipment of Humanitarian Supplies
=============================================
 
Enter size of each box to be shipped ---
   width, length, height (in inches): 24 36 30
Enter the weight (in pounds) per cubic foot of the goods: 7.5
Enter the number of pounds needed to feed one person for one day: 2.5
 
Shipment Summary
****************
 
Box size (in inches): 24.0 by 36.0 by 30.0
Number of Boxes: 240
Total Cubic Feet: 3600.0
Weight: 27000.0 pounds
Shipment Cost: $ 17360.00
 
The shipment will feed 10800 people for one day OR
a village of 150 people for 2 month(s), 1 week(s), and 5 day(s).

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.