Lab 6 Prelab Questions 1) Describe operator overloading. 2) What operators can you overload? 3) Why would you use operator overloading? 4) Give an example of overloading the addition operator. 5) Suppose you want to overload a binary operator. Describe the differences between implementing a binary operator as a member function versus a non-member function. 6) Consider a class Thermometer class Thermometer { int minTemp; int maxTemp; int currentTemp; public: Thermometer(int, int, int); // prototypes for preincrement and postincrement // overloaded operators as member functions }; Write down the prototypes for preincrement and postincrement operators for this class. How are they different? Why are they different? 7) If the overloaded operators in the above example were made non-member functions, how would their prototypes in the class change and why? (Hint: Friends) 8) Overload the << operator for the temperature. Provide both the prototype and the implementation. Give this operator direct access to the private data members of the class (i.e. don't use accessors or mutators). 9) Suppose you overload the binary + operator for the temperature class. Provide the prototype and implementation so that both of the additions in the following code will work. int main() { Temperature temp(20,40,25); temp + 20; 10 + temp; }