Skip to content

Instantly share code, notes, and snippets.

@johnhmj
Created January 13, 2010 01:42
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 johnhmj/275839 to your computer and use it in GitHub Desktop.
Save johnhmj/275839 to your computer and use it in GitHub Desktop.
import java.io.*;
import java.util.*;
public class Lab08c100 {
public static void main(String args[]) {
PrintStream jout = new PrintStream(System.out);
Scanner jin = new Scanner(System.in);
Quadratic q = new Quadratic();
q.Readme();
// Input value
jout.printf("Input a: ");
q.setA(jin.nextDouble());
jout.printf("Input b: ");
q.setB(jin.nextDouble());
jout.printf("Input c: ");
q.setC(jin.nextDouble());
// Compute
q.Solution();
// Display
jout.printf("The 1st solution for x is ");
q.getX1().Print();
jout.println();
jout.printf("The 2nd solution for x is ");
q.getX2().Print();
jout.println();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment