a) Develop a program for addition of two objects and theresult is placed in thir
ID: 3608347 • Letter: A
Question
a) Develop a program for addition of two objects and theresult is placed in third object for output. By Overloading thestream out operator "<<", use three arguments constructor forinitialization of object data i.e. Hours, Minutes andSeconds.b) Create a Line class using the coefficients a,band c of the equation ax+by+c=0 that represents the line as theclass fields. Enforce the class invariant that either a or b isnon-zero and c is either 0 or 1. a) Develop a program for addition of two objects and theresult is placed in third object for output. By Overloading thestream out operator "<<", use three arguments constructor forinitialization of object data i.e. Hours, Minutes andSeconds.
b) Create a Line class using the coefficients a,band c of the equation ax+by+c=0 that represents the line as theclass fields. Enforce the class invariant that either a or b isnon-zero and c is either 0 or 1.
Explanation / Answer
b. #includeusing namespace std;class line{private:double a,b,c;public:void get(){do{couta;coutb;if(a==0 && b==0)coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.