Description
You are to implement a List template class. This class stores a list of numbers, providing information about the list items thru calls to class member functions. You will probably want to place the entire class in a file List.h, as most compilers cannot handle the .h/.cpp file combination for a template class.
The List Class is described in the following UML class diagram
List
friend ostream& operator<<
friend istream& operator>>
Application
You are to write an application (main program) which:
• Asks the user how many values he/she would like in the list
• Creates a List object with that capacity * 2
• Prompts the user for a filename, and reads values from that file storing them in the list
If file does not exist, list remains empty
• Prints out the list to the screen, if it is not empty
Otherwise message ‘List is empty’ is printed
• Allows user to enter more int values if he/she wishes
• Allows user to view the last value in the list
• Allow the user to enter a value, and check how many times it occurs in the list
• Allow the user to enter a value, and remove all occurrances of this from the list
• Creates a 2nd list, and output it
• Determines if two lists are equal
• Outputs the values from first list to a file (this file should be usable as input for this program)
• Catches and handles any ListException that is thrown by informing the user of
The problem
Test this program with different list values, to ensure correct operation. Recompile your main program to work with a different type — and retest. Your program should work with any type (primitive or object type) which overloads == and << . ** You may want to first get the application running using ‘cin’ and ‘cout’ and then adjust it to work with files. Submit files List.h and your application.cpp file. Be sure that your name is included in each file and that all code is readable. Be sure to well-test your class, as I will test it with applications other than your own.