CS 1410 - Exam #1 Makeup

  1. Create a class called CharArray. It is intended to be similar to a vector<char>. Therefore it will use a dynamically allocated array of characters so that the size can change. Provide for all three common constructors: default, explicit-value, and copy. The explicit-value should receive two arguments; one indicating the size and the other a character to which all elements will be initialized. Overload the assignment operator and the subscript operator. Provide any other typical member functions that you find to be necessary/useful.
  2. Create a class called MyString that is derived from the CharArray class. It is intended to be similar to the string class. In addition to the inherited member fucntions it should overload the "+" operator for concatenation and the output operator. Provide all three common constructors. Provide any other necessary/useful typical member functions.
  3. Provide a driver that demonstrates the MyString class. It should allow the user to enter a string. It should exercise the output assignment operator, the "+" operator, the subscript operator, and the output operator.
  4. Submit your source code file to ude.wons@nosneros.htrag. Due at 5:00 pm on 23 February.

150 East College Avenue * Ephraim, Utah 84627 * Email: ude.wons@nosneros.htrag
© 2006 Snow College * All Rights Reserved
©