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

the a1 text file below This is has to be done in C++ In this program, you are re

ID: 3887654 • Letter: T

Question

the a1 text file below

This is has to be done in C++

In this program, you are required to read in from a text file a list of persons, display their information, add new persons, and do a search for certain persons. The information of each person consists of Last Name First_Name (25 chars, max) ID (int) Address (60 chars, max) Your program will open a file al.at and read one person's info at a time, and you may assume the enties in the file are all in corect forms. Each person's information is collected, in sequence, as name, ID, address. You can assume the maximum number ofpeople in al.txt is 20 1. Read from al.txt the information. Each person should take one structure. The structure should be defined as to hold name, ID, and address. 2. Your program prints the information of all people according the ID numbers in ascending order. The information (name, ID, address) should be identical to the information your program read from altt (see sample al.tct as in the same folder of this assignment, you need to follow the same formatting as defined in al.txt) 3. If so, the fields of Your program then asks the user if there is additional person to add. information on this new person are the same format as in al.txt, in sequence of name, ID address, and your program asks the user to enter one enty at a time. Your program should continue to ask if additional person is to be added, and the user decides whether or not to add a new one. 4. After 3, your program asks the user to search for a person by last name. the name and your program should print out the information: name, ID, address, in sequence and one line per field (e.g. name takes oneli. Your program should continuously ask the user if to search a new person, and stop only if the user chooses so. If there are two or more people with identical last name, each of them should be listed. Your program prints out the The user will enter n immediately after the person is found. 5. After 4, your program should have a function to print out all people who are "searched and found", in the order of first searched and first printed. The standard printed (on screen) ID, address, in sequence and one line per field. naine,

Explanation / Answer

#include #include #include #include #include void main() { clrscr(); ifstream ifile; char s[100], fname[20]; coutfname; ifile.open(fname); if(!ifile) { couts; cout