Question: You should implement each of the public methods described below. In each case you are given the method header which specifies the methods name, return
You should implement each of the public methods described below. In each case you are given the method header which specifies the methods name, return type and parameter list. A brief description follows each method, including any exceptions that should be thrown by the method. You may implement other private methods as you deem necessary.
Main Function
You should write a main function in a separate file from your StringSet class; you should use your main function (and other test functions) to test your class methods. You should not submit the file containing the main function. I would strongly suggest compiling and running your program after you complete each method (or couple of methods), do not try to complete the entire class before testing it as this will almost certainly end up being considerably more work.
CMPT 225 Assignment 1 - String Set You are to implement a class that stores a set of strings. The class should use a dynamic array as its underlying representation. This assignment is worth 5% of your grade. Please read the requirements carefully, paying particular attention to the names and input and output requirements of the class and its methods. We will be testing your class in our test program, so if you do not follow the requirements the program may not compile. Assignment submissions that do not compile will not be marked. We will be compiling and running our test program and your class in Linux using the g++ compiler with the -std=C++11 option. If you complete your assignment in some other environment (such as Visual Studio) I would strongly suggest checking that it compiles in g++ before submitting it. String Set Class Class Description Your class should be named StringSet and should support these operations: . Creating an empty set Inserting a string . Removing a string . Finding a string . Returning the size of a set . Returning the union of the calling object and another String Set Returning the intersection of the calling object and another String Set . Returning the set difference of the calling object and another StringSet Class Attributes Your class should be implemented using a dynamic array and should have at least the following private member variables . A pointer to a string that will point to an array of strings created in dynamic memory . An int that records the current size of the array (i.e. the number of strings stored in the array) . An int that records the maximum size of the array String Support Your header file should include the string class (#include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
