Question: in C++ Q4: Continue with Word class: a) Copy the previous program to a new file. b) Overload the operator + to output Word objects,

in C++  in C++ Q4: Continue with Word class: a) Copy the previous
program to a new file. b) Overload the operator + to output

Q4: Continue with Word class: a) Copy the previous program to a new file. b) Overload the operator + to output Word objects, with auto conversion. c) Overload the operator * to output Word objects. Class template (complete following function): class Word{ - friend Word operator+ friend Word operator* friend Word operator* } Use following main() to test your class. int main(){ Word a("abc"),b("def"); string c = "ghi"; cout Answer: 7 CO 10 2.cpp 1 #include 2 using namespace std; 3 class Word { 4 private: 5 string value; 6 int size; public: Word(){value = "empty"; size = 0;} 9 Word(string val): Word(){value = val;size = val.length(); } 11 12 void setValue(string v) {value = v;} 13 string getValue() {return value; } 14 void setSize(int s){size=s;} int getSize(){return size;) }; 18 int main() { Word a,b("abc"); 21 22 cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!