Question
Write a Pep/9 assembly code program that inputs N and outputs a report on the total shipping costs. Example reports are shown below. A factory
Write a Pep/9 assembly code program that inputs N and outputs a report on the total shipping costs. Example reports are shown below.
A factory makes vases from a batch of molten glass. These are then sent to the shipping department for shipping in boxes to the central warehouse. However, of the N vases sent from the factory, one quarter are not up to standard and are sent back to be melted down. The remaining vase are packed as follows: As many as possible are packed into large boxes each holding 8 vases. Large boxes cost 14 dollars to ship. Of the remaining vases, as many as possible are packed into medium boxes each holding 4 vases. Medium boxes cost 8 dollars each to ship. The remaining vases are sent in small boxes that hold a single vase. Small boxes costing 3 dollars each to ship.
Example program runs
N: 1000
Number of bad vases: 250
Cost to ship 93 large boxes @ $14 each: $1302
Cost to ship 1 medium boxes @ $8 each: $8
Cost to ship 2 small boxes @ $3 each: $6
Total shipping cost: $1316
N: 0
Number of bad vases: 0
Cost to ship 0 large boxes @ $14 each: $0
Cost to ship 0 medium boxes @ $8 each: $0
Cost to ship 0 small boxes @ $3 each: $0
Total shipping cost: $0
N: 73
Number of bad vases: 18
Cost to ship 6 large boxes @ $14 each: $84
Cost to ship 1 medium boxes @ $8 each: $8
Cost to ship 3 small boxes @ $3 each: $9
Total shipping cost: $101
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