Question: in C++ Quadratic A one-variable quadratic expression is an arithmetic expression of the form a bxc, where a, b, and c are some fixed numbers

in C++  in C++ Quadratic A one-variable quadratic expression is an arithmetic expression

Quadratic A one-variable quadratic expression is an arithmetic expression of the form a bxc, where a, b, and c are some fixed numbers (called the coefficients) and x is a variable that can take on different values. Design and implement a class that can store information about a quadratic expression. The default constructor should set all three coefficients to zero, and another member function should allow you to change these coefficients. An overloaded constructor should also be able to take the three coefficients. There should be constant member functions to retrieve the current values of the coefficients. There should also be a member function to allow you to "evaluate" the quadratic expression at a particular value of x (i.e, the function has one parameter x, and returns the value of the expression ar+ bxc). Also overload the following operators (as non-member functions) to perform these indicated operations: Postcondition: The return value is the II quadratic expression obtained by adding Il ql and q2. For example, the c coefficient 11 of the return value is the sum of qis c II coefficient and q2'sc coefficient friend quadratic operator+(const quadratic&ql, const quadratic& q2), I Postcondition: The return value is the II quadratic expression obtained by multiplying each of q's II coefficients by the number r friend quadratic operator double r, const quadratic&q) Notice that the left argument of the overloaded operator * is a double number (rather thana quadratic expression). This allows expressions such as 3.14 ' q, where q is a quadratic expression

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!