Question: 3 . ) Below is a problem that has a design that is partially completed: A factory producing bottles can manufacture b bottles an hour.
Below is a problem that has a design that is partially completed:
A factory producing bottles can manufacture bottles an hour. If a set of bottles take
pounds of raw material to manufacture, design an algorithm that determines how many bottles
can be produced in minutes and how many ounces of material are required. Note that even if
the factory produces one bottle, pounds of material are used.
Inputs: Bottles per Hour, Pounds of material per Bottles, minutes
Outputs: Ounces of material, Number of Bottles
Plan: Multiply by
Multiply by this is the number of bottles produced
Integer divide by
Add the integer to this is the number of bottle sets produced
Multiply by
Multiply by this is the ounces of material required
Note: The integer division operator will compute the whole number of times the righthand side can
be divided into the left. Eg both and would be but would be
a If a test has the inputs what would we expect the outputs to be
b If a test has the inputs what would we expect the outputs to be
c Think of an input different from the two above and calculate its output.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
