Question: In this lab, you will plan and create an algorithm for Falcon Incorporated. The problem specification, IPO chart information, and C++ instructions are shown in

In this lab, you will plan and create an algorithm for Falcon Incorporated. The problem specification, IPO chart information, and C++ instructions are shown in Figure 12-16. The program displays a shipping charge based on the number of items ordered, which is entered by the user. The problem specification shows the three shipping charges along with their associated minimum and maximum orders. Notice that the maximum order amounts are stored in the first column of the two-dimensional shipCharges array, while their corresponding shipping charges are stored in the second column. To find the appropriate shipping charge, you search the first column for the number of items ordered, beginning with the first row. You continue searching the first column in each row as long as there are rows left to search and the number of items ordered is greater than the value in the first column. You stop searching either when there are no more rows to search or when the number of items ordered is less than or equal to the value in the first column. For example, if the number of items ordered is 75, the first value you would look at in the array is 50. The number of items ordered (75) is greater than 50, so you continue searching with the value in the second row (100). The number 100 is greater than the number of items ordered (75), so you stop searching. The appropriate shipping charge is located in the same rowin this case, the second rowbut in the second column. The appropriate shipping charge is $10.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!