Answered step by step
Verified Expert Solution
Question
1 Approved Answer
write a *= operator that multiplies an Even Number by another one. The operator is declared in the class, you need to implement it after
write a *= operator that multiplies an Even Number by another one. The operator is declared in the class, you need to implement it after the class declaration. Hint: This operator should NOT return a new object Code: Compile Errors Click an error to see it in code pane EvenNumberAugmentedMultiply.cpp: 23:58: error: 1include 2 using nanespace std; no EvenNumber EvenNumber::operator* (const EvenNumber&) const' member function declared in class 'EvenNumber" 5 class EvenNuber 6 public: 7 explicit EvenNumber (int n) EvenNumber EvenNumber: :operator* (const EvenNumber& other)const f value- (n % 2--0) ? n : n- 1; //must be even 10 EvenNumber& operator* (const EvenNumber& other); 12 13 14 15 16 private: 17 18; 19 20 //Do not modify anything on or above the line below this 21 YOUR CODE BELOW 22 Iwhat am I missing below? 23 EvenNumber EvenNumber: :operator(const EvenNumber& other)const 24 25 26 27 //YOUR CODE ABOVE 28 //Do not modify anything on or below the line above this 29 30 int main) 31 32 int getValue) const return value; int value; EvenNumber->value * other.value EvenNumber nl(6) EvenNumber n2 (2) EvenNumber n3 nln2; 1/should do nl *n2, then copy result 34 to n3 35 36 37 38 39 40 41 cout
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started