$18.99
OBJECTIVES:
The objective of this lab task is to let you get some experience in writing programs using different file format, text processing, and also multi source file.
TASKS:
The XML (eXtensible Markup Language) is a common format used to structure and store data on the web. Refer to the attached XML file (address.XML) that could be used to store names in an address book.
The sample file contains four contacts. The < tag denotes the start of the field and the < / tag denotes the end of the field.
Your task is to write a program that reads the name of an XML file, and provide the following options to the user:
§ allow the user to select and display the names and their corresponding addresses by specifying the city they are living in.
§ allow the user to select and display the names and addresses of everyone whose postcode falls within a specified range. For example, everyone who lives in the postcodes 41000 through 42300.
Each option should be performed by a separate function. The functions should take an open stream to the file specified and display the output. For each option, the output should not contain any of the tag information, just the name and addresses only.
You may assume that each contact in the address file has the same structure and the same fields. However, your solution should be able to handle an input file with any number of contacts.
Your program should also perform a checking on the extension of the filename entered. A file without a .xml entension should not be processed. If this occurred, an error message should be displayed and the program should terminate.
Place your functions in an implementation file called xmlAddress.cpp. Write a suitable driver program and place it in main.cpp.