Instantly share code, notes, and snippets.

Embed
What would you like to do?
CSC-111 Quadratic Equation Solver in class exercise
package chapter3;
import java.util.Scanner;
public class QuadraticEquationSolver {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Welcome to the Quadratic Equation Solver!");
System.out.print("Enter a: ");
double a = input.nextDouble();
System.out.print("Enter b: ");
double b = input.nextDouble();
System.out.print("Enter c: ");
double c = input.nextDouble();
// Now enter your code here to calculate the solutions
// provided the input values represent a valid quadratic
// Remember there can be 0, 1, or 2 solutions.
// Out results accordingly.
input.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment