/**
 * Determines roots of a quadratic formula given its coefficients.
 *
 * @author Terry Sergeant
 * @version In Class Demo
 *
*/

import java.util.Scanner;

public class Quadratic
{
	public static void main(String [] args)
	{
		Scanner kb= new Scanner(System.in);

		double a,b,c;
		double discrim;
		double y1,y2;

		System.out.print("Enter 3 coefficients separated by spaces: ");
		a= kb.nextDouble();
		b= kb.nextDouble();
		c= kb.nextDouble();

		discrim= b*b-4*a*c;
		y1= (-b + Math.sqrt(discrim)) / (2*a);
		y2= (-b - Math.sqrt(discrim)) / (2*a);

		System.out.println("The roots are "+y1+" and "+y2);
	}

}

