Question: C++ PROGRAMMING please help within an hour so i can give 5 stars :-) (looks hard but its easy only a couple lines of code
C++ PROGRAMMING
please help within an hour so i can give 5 stars :-)
(looks hard but its easy only a couple lines of code need to be implemented)


#include#include #include using namespace std; class lineType { //Overload the stream extraction operators friend ostream& operator>(istream&, lineType&); public: const lineType& operator=(const lineType&); //overload the assignment operator void setLine(double a = 0, double b = 0, double c = 0); //Function to set the line. double getXCoefficient() const; double getYCoefficient() const; double getCOnstantTerm() const; void setXCoefficient(double coeff); void setYCoefficient(double coeff); void setConstantTerm(double c); lineType(double a = 0, double b = 0, double c = 0); //Constructor private: double xCoeff; double yCoeff; double constTerm; }; //--------------------------------functions implementation--------------------------------------- void lineType::setLine(double a, double b, double c) { xCoeff = a; yCoeff = b; if (a == 0 && b == 0) constTerm = 0; else constTerm = c; } double lineType::getXCoefficient() const { return xCoeff; } double lineType::getYCoefficient() const { return yCoeff; } double lineType::getCOnstantTerm() const { return constTerm; } void lineType::setXCoefficient(double coeff) { xCoeff = coeff; } void lineType::setYCoefficient(double coeff) { yCoeff = coeff; } void lineType::setConstantTerm(double c) { constTerm = c; } lineType::lineType(double a, double b, double c) { setLine(a, b, c); } const lineType& lineType::operator=(const lineType& otherLine) { //Complete me } ostream& operator>(istream& isObject, lineType& line) { //Complete me } //----------------------DriverProgram----------------------- int main() { lineType line1(2, 3, 4); lineType line2(3, 5, 7); lineType line3(2, 3, -2); lineType line4(3, -2, 1); lineType line5; lineType line6; cout > line5; cout Related math background: The equation of a line: ax+by c is the standard equation for a line, where a and b cannot both be zero, and where a, b, and c are real numbers. Question Download lab15.cpp from the blackboard. In this file, the definition of the class lineType has given which represents a line equation. In this lab, you are asked to complete the body for two operators overloading function as following: 1) overload the stream extraction operator for the input stream. The user input should be in (a,b,c format where Xcoef a, Ycoef b and ConstTerm c variables for the line object. For example, the code cin line: should accept (2,3,4) as the line input format. 2) overload the assignment operator to assign a line object into another line object. It will copy all member variables from its right operand to its left operand For example, linel line2; will copy all member variables from line2 to the linel object Then, without changing the main function, execute your program to get the same output. Submit a single cpp file
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
