c++
Programming Assignment 1 (and Prerequisite Test) 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: First Name Last Name (30 chars, max) Address (50 chars, max) Your program will open a file al.txt and read one person's info at a time, and you may assume the entries in the file are all in correct forms. Each person's information is collected, in sequencas name, address. You can assume the maximum number of people 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 and address. 2. Your program prints the information of all people according to Last Name in alphabet order. The information (name, address) should be identical to the information your program read from al.txt (see sample al.txt as in the same folder of this assignment; you need to follow the same formatting as defined in al.txt) 3. Your program then asks the user if there is additional person to add. If so, the fields of information on this new person are the same format as in al.txt, in sequence of name, address, and your program asks the user to enter one entry 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. After 3, your program asks the user to search for a person by last name. The user will enter the last name and your program should print out the information: name, address, in sequence and one line per field (e.g. name takes one line). 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, cach of them should be listed. Your program prints out the information 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) information consists: name, address, in sequence and one line per field, similar to that in al.txt Check the sample file for conforming the format, and test if your program works. MacBook Pro 80 Kitty Garfield 36 Jon Havey Court, Middle, MO 66222 Bill Lake 21 Ritts, Middletown, MI 48788 Betty Jones 78 Jon Havey Court, Middle, MO 66222 Betty Goodman 12 15th Street, Pontiac, MI 48310 Jocob Matthews 3930 4th Blvd, Yourcity, NJ 88710 Joe April 126 Freelane, Yourtown, State 88990