Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I really need help writing a program using C++ that creates anarray large enough

ID: 3618162 • Letter: I

Question

I really need help writing a program using C++ that creates anarray large enough to hold all the data, then reads all the datafrom the file into that array.

the follwing is an example of the file i need to use
 100058800 Jason Ipswitch 19251006

100127084 Benjamin Grant 19640526

100324711 Urkel Gordon 19830707

etc

2. Basic Search

Make your program ask the user to enter a name. It should thensearch through the data in the array (don’t read the fileagain), finding any entry with a matching name. Correct matcheswith either first or last name should be accepted. For everymatching entry that is found, print out all four data items: thesocial security number, first and last names, and date of birth ofeach matching person.

3. Find the Oldest
Modify your program so that after closing the file it searchesthrough them all to find the oldest person represented. It shouldprint the
social security number, first and last names, and date of birth ofthe oldest person found.
4. Promote the Oldest
Modify your program so that after finding the oldest person,it
swaps his or her data with the data already occupying the firstposition in the array.
5. Now Promote the Second Oldest.
,After searching for the oldest and moving their data to the frontof the array,
now search the remainder of the array (all except the firstelement), and move the oldest
person you find (which must be the second oldest of all) into thesecond position of the array.
Make sure you swap data, so that whoever was originally in thesecond position is not lost.
6. More of the Same.
Next putting the third oldest in the third position, then thefourth, then the fifth.
7. The Ultimate Demand.
You are to repeat the process of moving the nth-oldest person intothe nth position 1000 times. (remember, 1000 is the number ofdata
records in the whole file).
Make your program print the contents of the array after it hasfinished.
8. Sorting the File.
Make your program create a new file, and write all thecontents of the array into
that file in a sensible format.
How Fast Is It?
It requires two extra library files to be included, theyare:
#include <time.h>
#include <sys/resource.h>
Here is the function
double get_cpu_time()
{ struct rusage ruse;
getrusage(RUSAGE_SELF, &ruse);
return ruse.ru_utime.tv_sec+ruse.ru_utime.tv_usec/1000000.0 +
ruse.ru_stime.tv_sec+ruse.ru_stime.tv_usec/1000000.0; }
It returns the time as a double, and is accurate to a couple ofmilliseconds.
Use this function (twice) to time how long it takes the computer tosort the array of 1000
data items.

Explanation / Answer

looks like you're taking my 118