CIS 1.5

Brooklyn College

Professor Langsam

 

Assignment Seven

 

 

A very mixed up dating service needs your help desperately. They have two files (men.txt and women.txt) of potential matches, one for men and the other for women. They need a list of all potential matches as well as those individuals for whom a match can not be found. Each individual has submitted the following information: firstname, lastname, and a 1 (interested) or 0 (not interested) for each of the following categories: movies, music, romance, sports, and travel.

 

Write a complete C++ program, with comments, to do the following.

 

1. Define a class which will contain the information submitted by each individual. Create an array, men, (there will be no more than 25) of this class for the men and another array, women, (there will be no more than 25) for the women.

 

2. Using functions, store the information in each file in the appropriate arrays.

 

3. After you have read all the information, sort the arrays by the last name. Print an alphabetical list of all the men and the women.

 

4. Find dates for each woman by calling a function match. The function searches the array men and prints the information for each male who shares at least 3 common interests with the woman. If no match is found the function should print an appropriate message. Also indicate the number of matches found for each woman.

 

5. Repeat step four for each woman.

 

Be sure your program is commented, uses meaningful variables, and is structured as we have discussed in class. All output is to be to a file. You must turn in your source code, input and output files.

 

Use the following data which you may also find (men.txt and women.txt) at:

 

 http://eilat.sci.brooklyn.cuny.edu/cis1_5/CISClassPage.htm

 

 


 

firstname

lastname

Movies

Music

Romance

Sports

Travel

Women

Ziva

David

1

0

1

0

1

Abby

Sciuto

1

1

0

1

1

Jenny

Shepard

1

1

1

0

0

Allison

Cameron

0

0

1

1

1

Meredith

Grey

1

1

1

1

1

Addison

Montgomery

0

1

1

1

0

Cristina

Yang

0

0

0

0

0

Izzie

Stevens

1

1

1

0

0

Men

Jethro

Gibbs

1

1

0

1

1

Anthony

DiNozzo

1

0

1

0

1

Timothy

McGee

1

1

0

1

0

Gregory

House

0

0

0

0

0

Eric

Foreman

1

1

1

0

0

James

Wilson

0

0

1

1

1

Robert

Chase

0

0

0

0

0

Derek

Sheperd

1

1

1

1

1

Preston

Burke

1

1

0

0

0

George

O'Malley

1

1

1

0

0

Alex

Karev

0

0

1

1

0

Sebastian

Shark

0

1

0

1

0