C++: Matching Program   Create a datafile that contains the first name, last name, gender, age, height, smoking preference, eye color and phone number. Add a variety of records to the file. A sample file looks like: Write a program that opens the file and reads the records one by one. The program will skip any records where the gender preference is not a match. Of those records that match the gender preference, check to see if the age and height are between the maximum and minum preferences. Then check to see if the smoking preference and eye color are also a match. If at least 3 of the remaining fields match, consider the record a partial match, and print it in the report. If all 4 of the remaining fields match, the record is a perfect match and print it in the report with an asterisk next to it. At the end of the program, close the file and report how many total records there were of the specified gender, how many were a partial match, and how many were a perfect match. See the sample output below.

COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter6: Creating, Sorting, And Querying A Table
Section: Chapter Questions
Problem 12AYK
icon
Related questions
Question
100%

 

C++: Matching Program

 

Create a datafile that contains the first name, last name, gender, age, height, smoking preference, eye color and phone number. Add a variety of records to the file. A sample file looks like:

Write a program that opens the file and reads the records one by one. The program will skip any records where the gender preference is not a match. Of those records that match the gender preference, check to see if the age and height are between the maximum and minum preferences. Then check to see if the smoking preference and eye color are also a match. If at least 3 of the remaining fields match, consider the record a partial match, and print it in the report. If all 4 of the remaining fields match, the record is a perfect match and print it in the report with an asterisk next to it. At the end of the program, close the file and report how many total records there were of the specified gender, how many were a partial match, and how many were a perfect match. See the sample output below.

Sample Output
What is the gender of your ideal match (M,F,N)? M
What is the minimum age? 0
What is the maximum age? 100
What is the minimum
height (in inches)? 0
What is the maximum height (in inches)? 100
Smoker (Y/N)? N
What is the eyecolor (Blue, Green, Grey, Brown)? Brown
Name
Bobby Singer
*Dean Winchester
*Sam Winchester
Age Height Smoker Eye Color
70
43
39
69 77 75
72
Name
Program ended with exit code: 0
A run of the program.
What is the gender of your ideal match (M,F,N)? F
What is the minimum age? 20
What is the maximum age? 65
Y
N
N
There were 2 perfect matches and 1 partial matches out of 4 records.
Height
What is the minimum height (in inches)? 60
What is the maximum height (in inches)? 70
Smoker (Y/N)? Y
What is the eyecolor (Blue, Green, Grey, Brown)? Blue
Brown
Brown
69
555-867-5309
555-867-5309
Brown 555-867-5309
Age
*Bela Talbot
39
There were 1 perfect matches and partial matches out of 3 records.
Phone
Smoker Eye Color
Blue
Y
Phone
===
555-867-5309
Transcribed Image Text:Sample Output What is the gender of your ideal match (M,F,N)? M What is the minimum age? 0 What is the maximum age? 100 What is the minimum height (in inches)? 0 What is the maximum height (in inches)? 100 Smoker (Y/N)? N What is the eyecolor (Blue, Green, Grey, Brown)? Brown Name Bobby Singer *Dean Winchester *Sam Winchester Age Height Smoker Eye Color 70 43 39 69 77 75 72 Name Program ended with exit code: 0 A run of the program. What is the gender of your ideal match (M,F,N)? F What is the minimum age? 20 What is the maximum age? 65 Y N N There were 2 perfect matches and 1 partial matches out of 4 records. Height What is the minimum height (in inches)? 60 What is the maximum height (in inches)? 70 Smoker (Y/N)? Y What is the eyecolor (Blue, Green, Grey, Brown)? Blue Brown Brown 69 555-867-5309 555-867-5309 Brown 555-867-5309 Age *Bela Talbot 39 There were 1 perfect matches and partial matches out of 3 records. Phone Smoker Eye Color Blue Y Phone === 555-867-5309
Matching Program
C++.
Create a datafile that contains the first name, last name,
gender, age, height, smoking preference, eye color and
phone number. Add a variety of records to the file. A sample
file looks like:
Charlie Bradbury
Bobby Singer
Dean Winchester
Sam Winchester
Jody Mills
Bela Talbot
James Novak
2 龙 42 38 51 39 45
42
70
43
39
51
96
46
SONSS65
69
72
75
matches.txt
69
71
YNNZ
Green 555-867-5309
Brown 555-867-5309
Brown
Brown
Brown
Blue
Blue
555-867-5309
555-867-5309
555-867-5309
555-867-5309
555-867-5309
Write a program that opens the file and reads the records
one by one. The program will skip any records where the
gender preference is not a match. Of those records that
match the gender preference, check to see if the age and
height are between the maximum and minum preferences.
Then check to see if the smoking preference and eye color
are also a match. If at least 3 of the remaining fields match,
consider the record a partial match, and print it in the
report. If all 4 of the remaining fields match, the record is a
perfect match and print it in the report with an asterisk next
to it. At the end of the program, close the file and report how
many total records there were of the specified gender, how
many were a partial match, and how many were a perfect
match. See the sample output below.
Transcribed Image Text:Matching Program C++. Create a datafile that contains the first name, last name, gender, age, height, smoking preference, eye color and phone number. Add a variety of records to the file. A sample file looks like: Charlie Bradbury Bobby Singer Dean Winchester Sam Winchester Jody Mills Bela Talbot James Novak 2 龙 42 38 51 39 45 42 70 43 39 51 96 46 SONSS65 69 72 75 matches.txt 69 71 YNNZ Green 555-867-5309 Brown 555-867-5309 Brown Brown Brown Blue Blue 555-867-5309 555-867-5309 555-867-5309 555-867-5309 555-867-5309 Write a program that opens the file and reads the records one by one. The program will skip any records where the gender preference is not a match. Of those records that match the gender preference, check to see if the age and height are between the maximum and minum preferences. Then check to see if the smoking preference and eye color are also a match. If at least 3 of the remaining fields match, consider the record a partial match, and print it in the report. If all 4 of the remaining fields match, the record is a perfect match and print it in the report with an asterisk next to it. At the end of the program, close the file and report how many total records there were of the specified gender, how many were a partial match, and how many were a perfect match. See the sample output below.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
User Defined DataType
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L