Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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