COSC 1320 - C++ Programming and
ITSE 1307 - Introduction to C++ Programming
Bob Comer, Professor of Computer Studies
Program 4 Hint
You can use a standard sequential search to search the array for the package weight -- you only need a very minor modification.
The standard sequential search stops when an exact match for the search item is found in the array. A standard search will not work for this problem since all possible weights (1 - 50) are not stored in the array. For example, a 6 pound package would not have a matching weight -- the shipping charge would be the same as for a 7 pound package.
The required modification is simple. You need a search that stops when the package weight is less than or equal to the weight in the array.
Copyright: Ó 2005 by the Austin Community College
Department of Computer Science. All rights reserved.
Comments to: Bob Comer
Last updated: August 25, 2005