The local realtor?s association keeps track of homes for sale in the area. The file (LISTINGS.TXT) contains;the MLS listing number, the asking price, whether the listing is available, under contract, or sold, the zip;code, and the representing realty company.;You will write a program to help the realtor?s association use and manage the file. The data from the file;will be stored during program execution as an array of records, with one record (struct) for each listing.;The array should be declared to hold up to 750 listing records.;The following listing information will be stored as separate member fields within each record;MLS number integer format ? six digits, no leading zeros;Price double floating point number;Status enumerated type;Options for enumerated type are;AVAILABLE, CONTRACT, and SOLD;(define the values in this order, so their ordinal values will be;0, 1, and 2 when saved to the data file).;NOTE: When referring to enumerated values in the program code, the;code should never use the ordinal values. It should always use the;AVAILABLE, CONTRACT, and SOLD values.;Zip code string type (format must be #####-####) to store 5+4 zip code;Realty Company string type, with up to 20 characters;(Any combination of letters and spaces);After displaying a short program introduction, begin the program by asking the user whether they want to;use existing information. Example;Load existing data from a file (Y/N)?;If the user chooses to use existing data, the program will try to read the data from a previously stored;LISTINGS.TXT file into an array of records.;The program will check to see if the file exists, before trying to read from it. If the file doesn't exist;the program will present an error message about the file, and ask the user whether he wishes to exit;the program, or proceed starting with no data.;If the LISTINGS.TXT file exists, the program will read the data from the file into an array of;records. When reading data from an existing data file, you may assume that all data in the file is;valid and properly formatted, so you do not need to error check it.;NOTE: Storing the enumerated value for the status will be a 2-step process.;First read the integer number into a temporary integer variable.;Then use static_cast to convert the integer to an enumerated type and store it in the array.;As you read the data from the file, keep track of the number of listings stored. Your program;should error check that there are not too many data lines in the input data file, so that the data will;not overrun the array boundaries. If there are over 750 data lines in the input file, issue an error;message that further listings will be ignored, and do not read any more data records.;Sample LISTINGS.TXT Data Lines;111111 229700 0 80501-2345 Jones Realty;345678 176900 1 80513-2918 Metro Brokers;Note that the ordinal value of the enumerated listing category is stored in the data file.;This enables the program to simply write the data to the file from the enumerated type field;with no conversion.;For example, the code;outFile << CURRENT << endl;would write the value 0 to the outFile file.;So if a variable contains the value CURRENT, writing it out to a file will also cause 0 to be;written.;AFTER the listing records have been read from the data file into the array of records;OR if the file does not exist and the user chooses to continue anyway with an initially empty array;Give the user a menu of choices, as follows. Use a mnemonic letter for each menu option (NOT numbers);with the letter listed to the left of the menu option description;Display All (to the screen) listings;If the array is empty, simply display a message stating there are no listings stored.;Otherwise, display all data in columns, with one line per listing.;Display the listing status as a word, not a letter or enumerated type ordinal value.;Include column headers for each data item.;Sample output lines;Asking Listing;MLS# Price Status Zip Code Realtor;------ ------- --------- ---------- ------------;111111 229700 Available 80501-2345 Jones Realty;345678 176900 Contract 80513-2918 Metro Brokers;Add listing(s) to the array;a) Add a new listing to the listings ARRAY (if there is still room in the array).;Call a separate user-defined function to read each data item for one record.;b) Loop, adding listings to the array until the user says s/he is done;OR until the max of 750 listings has been entered.;NOTE: Once the array contains 750 listings, do not ask whether to add another!;The program MUST error check all user input, as detailed below.
Paper#69127 | Written in 18-Jul-2015Price : $37