import java.util.Scanner;
public class Main {
static double a, b, c, x, y, AOS;
public static void main(String[] args) {
Main.getA();
}
public static void getA() {
Scanner inputA = new Scanner(System.in);
System.out.println("Input variable 'a'");
a = inputA.nextDouble();
inputA.close();
System.out.println("A: " + a);
Main.getB();
}
public static void getB() {
Scanner inputB = new Scanner(System.in);
System.out.println("Input variable 'b'");
b = inputB.nextDouble();
inputB.close();
System.out.print("B: " + b);
Main.getC();
}
public static void getC() {
Scanner inputC = new Scanner(System.in);
System.out.println("Input variable 'c'");
c = inputC.nextDouble();
inputC.close();
System.out.print("C: " + c);
Main.getAOS();
}
public static void getAOS() {
AOS = (-b + Math.sqrt((b*b)-4*a*c)) / 2*a;
System.out.println("AOS: " + AOS);
Main.getPoint1();
}
public static void getPoint1() {
x = AOS;
y = (a*(x*x)) + (b*x) + c;
System.out.println("Origin: (" + x + "," + y + ")");
Main.getPoint2();
}
public static void getPoint2() {
x = AOS + 1;
y = (a*(x*x)) + (b*x) + c;
System.out.println("1: (" + x + "," + y + ")");
Main.getPoint3();
}
public static void getPoint3() {
x = AOS - 1;
y = (a*(x*x)) + (b*x) + c;
System.out.println("2: (" + x + "," + y + ")");
Main.getPoint4();
}
public static void getPoint4() {
x = AOS + 2;
y = (a*(x*x)) + (b*x) + c;
System.out.println("3: (" + x + "," + y + ")");
Main.getPoint5();
}
public static void getPoint5() {
x = AOS - 2;
y = (a*(x*x)) + (b*x) + c;
System.out.println("4: (" + x + "," + y + ")");
}
}
This is my code. I am trying to get user input to select the value for variables a, b, and c so the program can run the equations. Math works, but I am getting an error after the first input.