Comp 1572, Winter 2002 Pencil-and-Paper Assignment 6 Assigned Friday, February 22, 2002 Due Friday, March 1, 2002 (At the beginning of class) ============================================================================ Write your answers as neatly as possible. If your handwriting is hard to read, please type your answers. As always, this is an independent effort. ============================================================================ 0. Do self-review exercise 7.1 and 7.2 from page 720 of Deitel and Deitel. (You do not need to hand these in, but do them before you proceed with the rest of this assignment) 1. Do problem 7.5 in Deitel and Deitel 2. Write a function that takes a char * and a char as a parameter, and searches through the array pointed to by the first parameter for the character passed in the second parameter. It should return a pointer to the location in the array where the search character was first found, and if the character was not found in the array, the function shold return 0. Please keep in mind that character arrays are null-terminated. 3. Given the following class class Employee { public: Employee(); //default constructor Employee(const char *, const char *); // constructor ~Employee(); //destructor const char *getFirstName() const; // return first name const char *getLastName() const; // return last name void setLastName(char *); // set employee last name void setFirstName(char *); // set employee first name private: char *firstName; char *lastName; }; Write a program that will ask the user how many employees there are, dynamically allocate an array of Employees of the appropriate size, input from the user the data for each employee and update the Employees in the array, traverse the array and display the data, delete the dynamically allocated memory, and exit. 4. Read Section 7.10 on proxy classes, the purpose of which is to hide the list of private data members from the client application. Now consider the class class Internal_version_of_Time { public: Time(); // default constructor Time(int, int, int); // constructor, takes hour, minute, second void setTime(int, int, int); // set hour, minute, second void printMilitary() const; // print military time format void printStandard() const; // print standard time format private: int sec; // seconds since 12:00 am }; If this declaration is made available to client applications, then we reveal our internal method of storing the time. Suppose we wish to hide this proprietary information. Develop a proxy class Time for the given class, and implement this proxy class. See Figure 7.10 for an example of this method. Please assume that the class Internal_version_of_Time has already been implemented.