Question: These containers are available in four sizes: huge, large, medium, and small, which can hold 50, 20, 5 and 1 widgets, respectively. The cost of

These containers are available in four sizes: huge, large, medium, and small, which can hold 50, 20, 5 and 1 widgets, respectively. The cost of each of the containers, at this time, is $35.00 (huge), $15.25 (large), $4.25 (medium) and $0.95 (small). [These costs are subject to occasional change so your program should declare these costs as constants (final).]

a program that reads the number of widgets to be shipped and prints the number of huge, large, medium, and small containers needed to send the shipment in the minimum number of containers with the minimum amount of wasted space (Example: you can't ship 3 widgets in a medium box - you must use 3 small boxes). Also, print the total cost of the containers. The program output should look like this (Note: user input is indicated byBold. In your program, it will not be in bold)

Note: Everywhere above that you see an actual number, you should replace that value with a declared constant in your program.

For example

final int HUGE_CAPACITY = 25;

Widget Manufacturing Company Container Information Program Enter the number of widgets to

Widget Manufacturing Company Container Information Program Enter the number of widgets to be shipped: 1098 Container(s) Number Huge 21 Large 2 Medium 1 Small 3 Total Cost $772.60 Container Information Program completed.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!