1. A one-variable quadratic expression is an arithmetic expression of the formax2+ +bxc,wherea,b, andcare some fixed numbers (called the coefficients) and x is a variable that can take on different values. Specify, design, and implement a class that can store information about a quadratic expression. The constructor should set all three coefficients to zero, and another method should allow you to change these coefficients. There should be accessor methods to retrieve the current values of the coefficients. There should also be a method to allow you to “evaluate” the quadratic expression at a particular value ofx(i.e., the method has one parameterxand returns the value of the expressionax2+ +bx c).
Also write the following static methods to perform these indicated operations:
Notice that the first argument of the scale method is a double number (rather than a quadratic expression). For example, this allows the method activation Quadratic.scale(3.14, q) where q is a quadratic expression.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here