Question: Using Object - Oriented Programming, write a C + + program that will read in a file of names and a file of birth years.
Using ObjectOriented Programming, write a C program that will read in a file of names and a file of birth years. The file of names is called Names.txt and the file of birth years is called BirthYear.txt Both input files should be located in the current directory of your program. The list of names in the Names.txt file corresponds to the list of birth years in the BirthYears.txt file.
This means:
The first name in the Names.txt file corresponds to the first birth year in the BirthYear.txt file. The second name in the Names.txt file corresponds to the second birth year in the BirthYear.txt file... and so on Read in and store the names into an array of Next, read in and store the birth years into another array of integers. Sort the arrays using the selection sort or the bubblesort code in your textbook. List the roster of names in ascending alphabetical order displaying their birth years beside their names. Next, promp the user to enter a birth year. Validate this input value. Valid birth years are between the years List each name who has the birth year entered by the user.
Alphabetical Roster of Names
Alexis
Holly
Jim
Kevin
Sam
Names by Birth Year
Please enter the birth year: abcd
Invalid birth year entered, try again:
Invalid birth year entered, try again:
Invalid birth year entered, try again:
Invalid birth year entered, try again:
For the birth year of :
Alexis
Jim
End of results
A quick example:
If the Names.txt held the following names:
Jin, Kevin, Alexis, Holly, Sam
And the BirthYear.txt held the following years:
The output would be as follows:
Please write an algorithm for the provided algorithm. And please be sure to use SELECTION SORT OR BUBBLESORT TO SORT THE ARRAYS. Additionally, make sure the list of names of those with the input year are displayed, if any. If no names correlate to the birth year entered, a message is displayed indicating no names are associated with the input year.
Below is Names.txt:
Jackie, Sam, Bill, Tom, Mary, Paul, Zev, Barb, John, Sharon, Dana, Dominic, Steven, Padro, Katey, Kathy, Darius, Angela, Mimi, Jesse, Kenny, Lynn Hector, Brittany, Jenn, Joe, Chloe, Geena, Sylvia, Dean
Below is BirthYear.txt:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
