Menu

[solved] – Question 81481

Consider the following table:
Pay Code Pay Rate
1 8
2 14
5 10
6 20
7 15
9 16
11 20
Notice that the pay codes in the array are in ascending numerical order. The user will enter the
pay code to search for in the array. Write C++ program that should search for the pay code in the
first column of the array, but the search should begin in the middle row, which is row 4. If the pay
code the user is searching for is located in the first column of row 4, the program should display
the corresponding pay rate from the second column in row 4. If the pay code the user is
searching for is greater than the pay code in row 4’s first column, the search continues in rows 5,
6, and 7. However, if the pay code the user is searching for is less than the pay code in row 4’s
first column, the search should continue in rows 3, 2, and 1.
(40

Expert Answer


OR


Leave a Reply

Your email address will not be published. Required fields are marked *