The goal of this assignment is to give you a gentle introduction to Pep/9 progra
ID: 3586903 • Letter: T
Question
The goal of this assignment is to give you a gentle introduction to Pep/9 programming. The required solution involves no if or while constructs just basic arithmetic and input/output. 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. Write a Pep/9 assembly code program that inputs N and outputs a report on the total shipping costs Example reports are shown belowExplanation / Answer
Enter N: 300
Number of vases made: 300
Number of vases rejected: 37
Number of vases to be shipped: 263
Cost to ship 32 boxes of 8 at 32 euros each: 1024
Cost to ship 3 boxes of 2 at 12 euros each: 36
Cost to ship 1 boxes of single vases at 8 euros each: 8
Total shipping cost: 1068 euros.
Enter N: 6
Number of vases made: 6
Number of vases rejected: 0
Number of vases to be shipped: 6
Cost to ship 0 boxes of 8 at 32 euros each: 0
Cost to ship 3 boxes of 2 at 12 euros each: 36
Cost to ship 0 boxes of single vases at 8 euros each: 0
Total shipping cost: 36 euros.
Enter N: 73
Number of vases made: 73
Number of vases rejected: 9
Number of vases to be shipped: 64
Cost to ship 8 boxes of 8 at 32 euros each: 256
Cost to ship 0 boxes of 2 at 12 euros each: 0
Cost to ship 0 boxes of single vases at 8 euros each: 0
Total shipping cost: 256 euros.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.