Write a class named Adder that enables theaddition of up to and including 20-dig
ID: 3618582 • Letter: W
Question
Write a class named Adder that enables theaddition of up to and including 20-digit integers. (The“20” value might be a named constant so your classcould work with integers exceeding this number of digits.)
The following public methods should be available:
o A method to display an addend. (I’ll allowthis, this time!)
Your class should have appropriate private data members and anyother private methods to accomplish the required addition.
Of course, write a "main" program that demonstrates thecorrectness and functionality of your class.
Explanation / Answer
please rate - thanks #include #include #include using namespace std; #define DIGITS 20 class Adder { public: Adder(); void Input(); void Output(); Adder operator+( Adder ); private: int integer[ DIGITS ]; int len; }; void Adder::Output() { int i; for (i=len-1;i >= 0; i-- ) coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.