Question: Write a program in java that prints all real solutions to the quadratic equation: . Read in a, b, c and use the quadratic formula
Write a program in java that prints all real solutions to the quadratic equation: . Read in a, b, c and use the quadratic formula 20axbxc . If the discriminant is negative, display a message stating that there are no real solutions.242bbacxaImplement a class QuadraticEquation whose constructor receives the coefficients a, b, c of the quadratic equation. The instance fields are a, b, c, and discriminant. Supply the methods getSolution1 and getSolution2 that get the solutions, using the quadratic formula. Supply a method hasSolution( ) that returns false if the discriminant is negative. Have a test program as well
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
