EXAMPLE 7.9 Calculate freight charge
Design an algorithm that wil read an input weight for an item to be shipped, search an array of shipping weights and retrieve a corresponding freight charge. In this algorithm two paired arrays, each containing six elements, have been established and initialised. The array shipping weights, contains a range of shipping weights in grams, and the array, freight charges, contains a corresponding array of freight charges in dollars, as follows.