Troubleshoot the provided program. Indicate and correct all errors so that the program works correctly and has no memory leaks. Use in program comments and a color marker to highlight them to indicate your changes.
You can compare this class with dynamic array based list class discussed in the lecture. Please do the work by correcting the provided code and not by writing your own class from the scratch, or by modifying the dynamic array list class.
HINTS: There are four errors - missing instructions, instructions out of sequence, unnecessary instructions that damage data, or simple typos that twist an otherwise correct instruction to an incorrect one. Three errors may cause visible memory protection violation during program run (that could result in a program crashing with an error message - depending on a compiler and operating system that you use), and the last error causes only memory leak that is left undetected by compiler and may not be apparent as immediate malfunction. Each correction is worth 25% of the total number of points.
Consider the provided program and the data files generated by the WiFi monitoring program from one of the previous assingments: Campus.txt, and Redmond.txt. The program parses a user- specified data file and counts how many times each SSID is listed in that file.
Unfortunately, the data structure used for storing the counts was
not designed to handle very large number of elements. Please correct
this by modifying the class SSIDCntArray so
that it can process a file with any number of different SSIDs by
converting the static array to a pointer-based dynamic array that
increases its capacity as necessary. Please note that the class is
passed by value to a function, and an assignment operator is also used.
Also make sure that you do not create any memory leaks.
Additional materials for those who are interested: