Question: Problems (Normal) Postage Weight less than Rate Weight less than Rate (8) Weight less than Rate 3.5 oz. t 1.15 4 oz. 1.64 8 oz.


Problems (Normal) Postage Weight less than Rate Weight less than Rate (8) Weight less than Rate 3.5 oz. t 1.15 4 oz. 1.64 8 oz. 2.52 Table 1: US Postage for first class letters in normal-sized or large-sized envelopes. (t ny first class letter weighing 3.5 oz. or more is automatically charged the large-sized envelope rate.) 1. According to the US Postal Service, first class postage for a normal-sized or large-sized en- velope weighing up to 8 oz. is determined by the information in Table 1 above. Write a Matlab function called uspostage.m whose purpose is to assign postage to an envelope given its weight and a (logica) tag identifying it as a large envelope or a small envelope. A weight of 0 or less, or of 8 or more should trigger an "impossible" postage value of -1 to signal that the weight does not fall within the ranges specified in the table. Function specifications and some sample function calls are shown below. input parameters weight a real number (the weight of the envelope) islarge a logical tag (true indicates large-sized while false indicates normal-sized) output parameter postage a real number (the postage required) sample function calls uspostage (3.6, false uces 1.64 uspostage (1.75, true produces 1.20 uspostage (3.6, true uces 1.64 uspostage (0, true produces -1 uspostage (1.75, false) produces 0.71 uspostage (9.5 true produces -1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
