Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a Java application having the class name Container that calculates How many and what size containers are needed to ship widgets. A shipping
Write a Java application having the class name Container that calculates How many and what size containers are needed to ship widgets. A shipping clerk at a plant that manufactures widgets is faced with a problem. Widgets are very delicate and must be shipped in special containers. These containers are available in four sizes: 1. Huge can hold 50 widgets and at this time the cost is 2. Large can hold 20 widgets and at this time its cost is 3. Medium can hold 5 widgets and at this time its cost is 4. Small can hold 1 widget and at this time its cost is $35 $15.00 $4.25 $0.95 [These costs are subject to occasional change so your program should declare these costs as constants (final).] Write 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 by Bold. 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started