Project #6
Text Message Conspiracy
(Due 7 December 2007)
The FBI has obtained a court order to get the October text messaging records of a collection of individuals. Some of the suspects may be conspiring to commit a terrorist act; the FBI needs help in identifying who the conspirators might be. You are to write a program that processes the file of text message information and try to identify individuals who may be conspiring about something.
The FBI was able to obtain only sender, receiver and number of messages; they have no information about the content of the messages. Consequently, the FBI defines possible conspirators as a group of three or more people who have sent and received at least two text messages to and from every other member of the group. That is, if A, B, C and D are individuals and A has sent 2 or more messages to B and 2 or more messages to C and 2 or more messages to D and received 2 or more messages from each of B, C and D; in addition, B has sent 2 or more messages to each of C and D and received 2 or more messages from each of C and D; and C has sent 2 or more messages to D and received 2 or more messages from D, then A, B, C and D are possible conspirators. What they might be conspiring about is not known. Your program is simply to identify possible conspiracies given one person to start with.
The file converse.txt contains the text messaging information. The file can be found on the I: drive at I:\jlwolfe\110\converse.txt The format of the file is as follows:
First line contains the number of suspects,
s
Next s lines each contain the online name
of each suspect - each name is one word
Next s lines contain the number of text
messages the nth person has sent each of the s suspects
Below is a small part of the converse.txt file
60
Alice
Arthur
Billy
Blips
Bluto
Boopsie
...
0 0 0 0 2 5 0
9 0 0 0 0 0 0 0 0
0 0 0 0 0 0 7 4 3
...
0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
...
0 0 0 0 2 0 0
0 0 11 0 0 0 0 0 0 0
0 0 0 0 0 0 4 0 ...
0 0 0 0 0 0 0
0 3 0 0 0 12 0 2 0 0
1 0 0 10 0 0 0 0 ...
10 0 5 0 0 0
0 0 0 0 5 0 0 2 0
0 0 1 0 0 0 0 1 0
0 ...
10 0 0 0 0 0
0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 5 5
0 ...
...
The first line of numbers shows the number of messages Alice has sent to each suspect; thus, the row is the sender and the column is the receiver. Alice has sent 2 messages to Bluto and 5 to Boopsie (Bluto is the fifth suspect; Boopsie is the sixth). Billy has sent 2 messages to Bluto. Bluto and Boopsie have each sent 10 messages to Alice; Bluto has also sent 5 messages to Billy. Note that, Alice, Bluto, and Boopsie are NOT part of a possible conspiracy - Bluto has not sent any messages to Boopsie and vice versa. For the same reason, Billy, Bluto, and Boopsie are NOT part of a conspiracy. Also, note that no person can send messages to him/herself; so there is a diagonal of all zeros.
After reading in the data from converse.txt, your program should prompt for the name of a "person of interest". Then, starting with this person try to find a possible conspiracy involving this person. Use the definition of conspiracy given above; i.e., first make a list of all individuals the person has sent and received two or more messages to/from. Then, for the first person on the list, determine which of the other people on the list have exchanged two or more messages with the first person - anyone who hasn't can be deleted from the list. Then, do the same for the second person on the list and so on. If after checking out everyone on the list, if the list contains more than one person, there is a possible conspiracy between the person of interest and the people remaining on the list.
Your program MUST contain at least three functions in addition to main. Your should repeatedly prompt for a person of interest and display either the members of a possible conspiracy or a statement indicating there is not conspiracy indicated with the person of interest. The program should stop when the person of interest is not found among the suspects. Here are a few sample answers for you to test with:
Goofy not
a part of any conspiracy
Irma
Possible conspirators with Irma Momma Otto
Terry not
a part of any conspiracy
Tumbleweeds Possible conspirators with Tumbleweeds
Grimm Pigpen
Important Note: The described method for finding the possible conspiracy will not work some of the time. You may try to improve on this to get extra credit. My suggestion for an improvement is: if no conspiracy is found, delete the first person on the list and check the list again; if that yields nothing, delete the second person on the list and check the list again; continue in this manner until there is only one person on the list before checking; then declare that there is no conspiracy. Even this improvement is not foolproof; to guarantee there is no conspiracy, you would have to check the list in every possible order; you would find this very difficult and slow. It is also possible for one person to be a part of more than one possible conspiracy; the method described above looks for only one conspiracy.
When you have the program working, execute
it and enter the following names as "persons of interest":
Alice Cicero
Fuzz Lois Nancy
Mutt Otto Sandy
Wally Zero
Hand in a well-documented printout of your
program and a printout of the captured output, showing the results for
the ten specified persons of interest. Also, copy the program's .cpp
file to the handin folder on the P: drive for COSC 110 section 003.
Be sure to name the .cpp file after yourself so that it can be distinguished
from other student file names. For example, I would name my file
wolfep6.cpp