Hey guys, I don't know where to get started in this. I pretty much only have the header file and I don't even know if that is correct. I don't know what the question is asking other than it is asking me to open up a text file. Any suggestions?
- Basic Concepts
Definition 1. A tag in XML is what is written between angled brackets e.g. <name>.
Definition 2. An XML element is a logical data structure (piece of data) within an XML file. It consists of:
• Start (opening) tag (the beginning of an element), e.g. <name>;
• End (closing) tag (the end of an element), e.g. </name>;
• The information between the tags (the contents of the element).
So, an XML element is an opening and a closing tag and what comes in between.
Examples:
<point>
<x>10</x>
<y> 20 </y>
</point>
or
<point><x>10 </x> <y> 20</y></point>
Definition 3. An XML tag name is a string including letters, digits, underscores, hyphens, and periods and may not include white spaces.
Note: The XML data is correctly constructed (nested). - Problem Statement
3.1. Write a C++ class named Points with the following functionality:
Points (char [] fileName); // Constructor
size_t counter() const; // Returns the number of points
void print () const; // Prints out a list of points in the format:
// (x1, y1), (x2, y2), (x3, y3) . . . , (xn, yn)
Hint:
(1) Use a C++ vector to store the points.
(2) The constructor should reads the XML text file (named it “input.txt”), extract the coordinates of all points and store them in a C++ vector.
3.2. Write a C++ main function to test the Points class