You can then determine the postal cost of each parcel by


Problem

A small postal system ships parcels within your state. Acceptance of parcels is subject to the following constraints:

a. Parcels are not to exceed a weight of 50 pounds.

b. Parcels are not to exceed 3 feet in length, width, or depth, and may not have a combined length and girth exceeding 6 feet. (The girth of a parcel is the circumference of the parcel around its two smallest sides; the mathematical formula is

Girth = 2 x (S1 + S2 + S3 - Largest)

where Largest is the largest of the three parcel dimensions, S1, S2, and S3.) Your program should process a transaction file containing one entry for each box mailed during the week. Each entry contains a transaction number followed by the weight of the box and its dimensions (in no particular order). The program should print the transaction number, weight, and postal charge for all accepted parcels, as well as the transaction number and weight for all rejected parcels. At the end of the report, the program must print the number of parcels processed and the number rejected.

Input Parcel post table-

weight and cost (contains 25 pairs of values). Store this table in a one-dimensional array of records. You can then determine the postal cost of each parcel by searching the Weight fields and then using the Cost field. If a parcel weight falls between weight categories in the table, your program should use the cost for the higher weight.

Transaction file-

transaction number, weight, and three dimensions for an arbitrary number of transactions. Assume that all weights are whole numbers, and that all dimensions are given to the nearest inch.

Output First line-appropriate headings.

Next N records-transaction number, whether accepted or rejected, weight, and cost.

Last line-number of parcels processed, number of parcels rejected.

 

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: You can then determine the postal cost of each parcel by
Reference No:- TGS02652867

Expected delivery within 24 Hours