Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

** Instructions ** A materials processing facility has a computerized scale that can accurately weigh materials by the pound. The scale's maximum capacity is 65,535

** Instructions **

A materials processing facility has a computerized scale that can accurately weigh materials by the pound. The scale's maximum capacity is 65,535 pounds. Unfortunately, somebody attempted to weigh a 65,536 batch of materials, which broke the scale.

Until it is fixed, you and your coworkers are using the old scale, which works by placing the batch of materials on one side of a pivot point and moving heavy weights onto the other side of the pivot point until the weights balance. It operates on the same principle as this toy balance scale, but on a much, much bigger ... scale.

The facility has the following weights available for use on the weighing mechanism:

|Weight|Quantity Available| |------|------------------| |1 lb |25 | |2 lb |10 | |5 lb |10 | |10 lb |5 | |25 lb |10 | |50 lb |25 | |100 lb|750 |

In your time working at the facility, you have become pretty good at estimating the weight of a batch of materials just by looking at it. Since you are now using the old-fashioned balance technique to weigh materials, it involves quite a lot of manual labor to move the weights. For instance, to weigh a batch of materials that's 867 pounds, you have to gather the following number of weights:

|Weight|Quantity Required| |------|-----------------| |1 lb |0 | |2 lb |1 | |5 lb |1 | |10 lb |1 | |25 lb |0 | |50 lb |1 | |100 lb|8 |

Write a java program that asks the user to enter the estimated number of pounds of weight and displays the smallest number of weights required to verify that weight. If the user enters a negative number, display an error message instead.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions

Question

What has been the evolution of HRM?

Answered: 1 week ago

Question

=+2 Why are so many countries bothered by their brain drains?

Answered: 1 week ago