Q1. Design a class named math to overload operator \"+\", \"-\", \"*\".After thi
ID: 3608733 • Letter: Q
Question
Q1. Design a class named math to overload operator "+", "-", "*".After this overload add subtract and miultiply two integers.Q2. Design a Cash register, using classes. It should be able tohave following functions, Cashdeposit, cashwidraw and cashtotal.program should be able to perform all functios of a cash register.like deposit widraw and calculate and display cash at the end oftransaction.
Q2. Design a Cash register, using classes. It should be able tohave following functions, Cashdeposit, cashwidraw and cashtotal.program should be able to perform all functios of a cash register.like deposit widraw and calculate and display cash at the end oftransaction.
Explanation / Answer
please rate - thanks hope this helps #include class math {public: void Input(); void Output(); math Add(math x); math Sub(math x); math Mult(math x); private: float real; }; math math::Add(math x) {math temp; temp.real=real+x.real; return(temp);} math math::Sub(math x) {math temp; temp.real=real-x.real; return(temp);} math math::Mult(math x) {math temp; temp.real=(real*x.real); return(temp);} void math::Input(void) {cin>>real;} void math::Output(void) {coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.