Question: Write a Java program that prompts the user for the coefficient of the quadratic term, the coefficient of the linear term, and the constant term
Write a Java program that prompts the user for the coefficient of the quadratic term, the coefficient of the linear term, and the constant term of a quadratic equation. The program then displays the quadratic equation and determines its discriminant, roots, axis of symmetry, vertex, x-intercepts and y-intercept. It also determines whether the parabola is concave upward or downward. A parabola is concave upward if the coefficient of its quadratic term is positive and concave downward when the coefficient of the quadratic term is negative. Write the program incrementally. Write a preliminary version of the program so that it prints a message indicating that the equation is not quadratic if the input for the quadratic coefficient is 0 and prints the quadratic equation in standard form when a non-zero coefficient is entered for the quadratic term. You can then add the code to compute the roots and all the properties of the equation. You may also want to incrementally add the code for solving the equation: First, the code to solve an equation whose discriminant is 0, second, the code to solve the equation when the discriminant is positive and, finally, the code to solve the equation when the discriminant is negative.
Sample Output

Listing 1: Sample Run 1 Enter the coefficient of the quadratic term -> 1 2 Enter the coefficient of the linear term -> -6 3 Enter the constant term ->9 4 For the quadratic equation x^2-6.00000x+9.00000=0; 7 Discriminant: 0.00000 8 Axis of Symmetry: x = 3.00000 9 Vertex: (3.00000, 0.00000) 10 y-intercept: (0.00000, 9.00000) 11 x-intercept: (3.00000, 0.00000) 12 Shape: Concave upward 13 Root: x = {3.00000}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
