IUP Computer Science
CO 110 Spring 2000
Project #5
(Due at 5 pm 12 April 2000)
The XYZ Company has decided to implement new and more rigid security procedures based on voice print analysis. It has had each of its employees' voices recorded and analyzed. The net result of the analysis is that the KEYMATCH.TXT file now contains the following information about each employee:
6-digit ID number, 4-digit PIN number, and the 12 numbers of the employee's voice profile
Each employee's information occupies one line of the file. Here is a sample:
102691 6581 46.1 123.6 20.0 63.9 107.8 76.3 47.1 31.3 27.9 88.8 99.4 46.9
When anyone wants to gain entrance to the XYZ company building, s/he must walk up to a computer that has a microphone and speak the standard phrase, "X Y Z Rocks." The voice analyzer then writes the date (in the form yy/mm/dd) and a 12-number voice profile of what this person has said into a file named TESTFILE.TXT. The person must then wait for your program to prompt him/her for a PIN number.
You are to write a program that reads the TESTFILE.TXT information and tries to match this person with one or more of the employees based on the voice profiles in the KEYMATCH.TXT file. Because no one ever says a phrase exactly the same way twice, this matching is not looking for exactly the same values for the 12 numbers. Instead, your program should compute the sum of the differences between each number in the TESTFILE.TXT file and the number in the corresponding position for each of the employee profiles in KEYMATCH.TXT. If this sum of the 12 differences is less than 1.0, then this is a possible match.
Your program should collect all the possible matches (the ID number, the PIN number, and sum of differences) into three arrays. If there are no matches, display a message that says, "Do NOT move; security has already been called!" If there are some matches, prompt for the person for a PIN number and read the number in. Sort the three arrays in parallel so that the lowest sum of differences is first. Display all of the collected information (ID, PIN and sum) in table form. If the PIN the person enters exactly matches any one of the PIN numbers in the collected information, display a message in the form, "Employee xxxxxx is allowed to enter." where xxxxxx is the ID number of the employee for which the PIN number matches. If the PIN does not match any of the PINs in the collected info, display a message that says, "Do NOT move; security has already been called!"
You can find the two files, KEYMATCH.TXT and TESTFILE.TXT in the jlwolfe folder on the I: disk drive in any of the public labs. You can assume that when there are voice profile matches that the number of matches is fewer than 50.
Hand in a printout of your program and a floppy disk which contains the source program (.cpp) file and the executable (.exe) file. Both of these files should be named after yourself (your last name). If I were doing this program, the files would be named WOLFE.CPP and WOLFE.EXE. Your name is not Wolfe (unless you are Rob Wolfe); you should use your own name. You can find the .exe file in the Debug folder.