Question: compiler error when creating two functioning classes, how to fix? 1 main.cpp #include 2 #include 3 #include - sinclude 5 #include $ #include 7 #include

compiler error when creating two functioning classes, how to fix?
compiler error when creating two functioning classes, how to fix? 1 main.cpp
#include 2 #include 3 #include - sinclude 5 #include $ #include 7

1 main.cpp #include 2 #include 3 #include - sinclude 5 #include $ #include 7 #include #include | e using namespace std; 1 class Can 2 { 3 public: 4 string content; 15 double weight; 16 Can(); 17 Can(string s, double d); I 18 Can operator+(const Can &); 19 Can operator-(const Can &); 20 friend can operator+(const Can &c2); 21 }; 22 23 Can Can::operator+(const Can &c2) // c3 = c + c2; 24 25 17 if the content is not the same, content = mixed 26 // else, content - same 27 string newc; 28 if (content != c2.content) 29 { 30 new - "Mixed"; 31 } 32 double nendel - weight + c2.weight; 33 return Can(nesc,nes); 34 } 35 36 ostream& operator 2 #include 3 #include - sinclude 5 #include $ #include 7 #include #include | e using namespace std; 1 class Can 2 { 3 public: 4 string content; 15 double weight; 16 Can(); 17 Can(string s, double d); I 18 Can operator+(const Can &); 19 Can operator-(const Can &); 20 friend can operator+(const Can &c2); 21 }; 22 23 Can Can::operator+(const Can &c2) // c3 = c + c2; 24 25 17 if the content is not the same, content = mixed 26 // else, content - same 27 string newc; 28 if (content != c2.content) 29 { 30 new - "Mixed"; 31 } 32 double nendel - weight + c2.weight; 33 return Can(nesc,nes); 34 } 35 36 ostream& operator

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!