Answered step by step
Verified Expert Solution
Link Copied!

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.

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.
image text in transcribed

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

Database And Expert Systems Applications 31st International Conference Dexa 2020 Bratislava Slovakia September 14 17 2020 Proceedings Part 1 Lncs 12391

Authors: Sven Hartmann ,Josef Kung ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

303059002X, 978-3030590024

More Books

Students also viewed these Databases questions