import java.util.Scanner; public class Quad { public static void main(String[] args) { double a,b,c; double firstAnswer; double secondAnswer; Scanner in=new Scanner(System.in); System.out.print("Enter a non-zero value for a: "); a=in.nextDouble(); System.out.print("Enter a value for b: "); b=in.nextDouble(); System.out.print("Enter a value for c: "); c=in.nextDouble(); System.out.println("Finding zeroes for the following equation: " + a + "*x^2+" + b +"*x+" + c); firstAnswer=(-b+Math.sqrt(Math.pow(b,2)-4*a*c))/(2*a); secondAnswer=(-b-Math.sqrt(Math.pow(b,2)-4*a*c))/(2*a); System.out.println("The solutions are: " + firstAnswer + " and " + secondAnswer); } }