Question: Homework 3 . 1 1 . [ Submit on zyLabs ] We are trying to write a function that implements a piecewise scheme for determining

Homework 3.1
1.[Submit on zyLabs] We are trying to write a function that implements a piecewise scheme for
determining whether the size of a widget is acceptable to send further along for production. Widgets for
our production line are flat, wide pieces that we use to construct a larger device. The following plot
illustrates acceptable widgets:
Where the areas in black are acceptable widgets, the gray areas are widgets that can be reprocessed,
and the areas in white are unacceptable widgets that need to be discarded. The black area is bounded by:
=2
100
At the top, and:
=0.5
100
At the bottom. The upper gray area is bounded by:
=5
100
While the lower gray area is bounded by:
=0.2
100
Write an equation that takes two inputs:
- The area of a widget, a double that you can assume is greater than 0
- The thickness of a widget, a double that you can assume is greater than 0
It should return one output:
- A double with one of 3 different values:
o 0 for unacceptable widgets
o 1 for widgets to be reprocessed
o 2 for acceptable widgets
You can use the chart above to come up with test case numbers. For instance, an area of 30 with a
thickness of 0.01 would be unacceptable, an area of 35 with a thickness of 0.1 would be reprocessed, and
an area of 20 with a thickness of 0.04 would be accepHomework 3.1
[Submit on zyLabs] We are trying to write a function that implements a piecewise scheme for determining whether the size of a widget is acceptable to send further along for production. Widgets for our production line are flat, wide pieces that we use to construct a larger device. The following plot illustrates acceptable widgets:
Area or wiaget in m-
Where the areas in black are acceptable widgets, the gray areas are widgets that can be reprocessed, and the areas in white are unacceptable widgets that need to be discarded. The black area is bounded by:
thickness =2*area2100
At the top, and:
thickness =0.5*area2100
At the bottom. The upper gray area is bounded by:
thickness =5*area2100
While the lower gray area is bounded by: thickness =0.2*area2100
Write an equation that takes two inputs:
The area of a widget, a double that you can assume is greater than 0
The thickness of a widget, a double that you can assume is greater than 0
It should return one output:
A double with one of 3 different values:
0 for unacceptable widgets
1 for widgets to be reprocessed
2 for acceptable widgets
You can use the chart above to come up with test case numbers. For instance, an area of 30 with a
thickness of 0.01 would be unacceptable, an area of 35 with a thickness of 0.1 would be reprocessed, and
an area of 20 with a thiekness of 0.04 would be acceptable.table.
Homework 3 . 1 1 . [ Submit on zyLabs ] We are

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