Skip to content

Instantly share code, notes, and snippets.

@bytecodeman
Created October 11, 2018 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bytecodeman/9d17d0228dd46e2726e2803b2990e1e5 to your computer and use it in GitHub Desktop.
Save bytecodeman/9d17d0228dd46e2726e2803b2990e1e5 to your computer and use it in GitHub Desktop.
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