Question
A widget distributor receives a shipment of N widgets from the manufacturer. Unfortunately, oneeighth of them are not up to specification and cannot be shipped.
A widget distributor receives a shipment of N widgets from the manufacturer. Unfortunately, oneeighth of them are not up to specification and cannot be shipped. The remaining widgets are shipped to a central warehouse. A standard mailing box holds 16 widgets and costs $8 to mail. Any widgets left over are shipped individually at a cost of $2 each. Write and test a Pep/9 assembly language program that inputs N and outputs the total cost of mailing the widgets. (Cost may be approximate because of limitations of integer arithmetic
Example
N = 300
widgets are received from the manufacturer
One eighth (37) are not up to specification leaving 263
Sixteen boxes of 16 can be filled leaving 7 widgets to be shipped individually
Total cost = (16 * $8) + (7 * $2) = $142
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