Question: 3 . ) Below is a problem that has a design that is partially completed: A factory producing bottles can manufacture b bottles an hour.

3.) Below is a problem that has a design that is partially completed:
A factory producing bottles can manufacture b bottles an hour. If a set of 100 bottles take r
pounds of raw material to manufacture, design an algorithm that determines how many bottles
can be produced in t minutes and how many ounces of material are required. Note that even if
the factory produces one bottle, r pounds of material are used.
Inputs: b Bottles per Hour, r Pounds of material per 100-Bottles, t minutes
Outputs: Ounces of material, Number of Bottles
Plan: 1. Multiply t by 1hr60(min)
Multiply (1) by b, this is the number of bottles produced
Integer divide (2) by 100
Add the integer 1 to (3), this is the number of 100-bottle sets produced
Multiply r by 16oz1lb
Multiply (4) by (5), this is the ounces of material required
Note: The integer division operator (//) will compute the whole number of times the right-hand side can
be divided into the left. E.g., both 4??2 and 5??2 would be 2, but 6??2 would be 3.
a.) If a test has the inputs (b=250,r=1.5,t=3), what would we expect the outputs to be?
b.) If a test has the inputs (b=1000,r=0.4,t=2), what would we expect the outputs to be?
c.) Think of an input different from the two above and calculate its output.
 3.) Below is a problem that has a design that is

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 Databases Questions!