Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please Help in the following language only : C ++ plus plus Must be in C ++ plus plus thank you for the help! Create
Please Help in the following language only: C ++ plus plus
Must be in C ++ plus plus thank you for the help!
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 what is tne minimum nedgnt (1n 1ncnes)! ov What is the maximum height (in inches)? 70 Smoker (Y/N)? Y What is the eyecolor (Blue, Green, Grey, Brown)? Blue Another run of the program. What is the gender of your ideal match (M, F,N)? M What is the minimum age? 42 What is the maximum age? 45 What is the minimum height (in inches)? 69 What is the maximum height (in inches)? 90 Smoker (Y/N)? N What is the eyecolor (Blue, Green, Grey, Brown)? Brown There were 1 perfect matches and 1 partial matches out of 4 records. Program ended with exit code: Another run of the program The program when no records are found. Error opening the file. Program ended with exit code: The program prints an error if the file doesn't existStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started