Description
Objectives:
-
Learn how to implement generic binary search.
Example from the terminal window:
$ ./a.out
Please enter an employee ID to search the personal info: 12
Employee ID |
: 12 |
|
Name |
: MARJORIE |
|
Age |
: 40 |
|
Department |
: |
806 |
Salary |
: |
$88801.60 |
$ ./a.out
Please enter an employee ID to search the personal info: 1000
Employee ID |
: 1000 |
|
Name |
: MARGARET |
|
Age |
: 33 |
|
Department |
: |
808 |
Salary |
: |
$79536.31 |
$ ./a.out
Please enter an employee ID to search the personal info: 1100 Employee ID 1100 doesn’t exist!!
Grading Criteria: |
||
• |
Main program: |
6 points |
• |
readFile function: |
6 points |
• |
binarySearch function: |
6 points |
• |
compare function: |
6 points |
• |
freeArray function: |
6 points |
Note:
-
If your code does not compile with –Wall and –Werror, you will receive a zero for this assignment.
-
You need to finish at least three peer reviews within three days of this lab. Otherwise, you will get a 20% penalty.
-
You will lose points if you don’t have enough comments.
2