hey guys I understand the programming before the graph but i just cant figure how to graph it like the code all through command lone by the way...
Thanks for your help!
import java.util.*;
import java.text.*;
public class Proj3 {
public static void main(String[] args){
Scanner s = new Scanner(System.in);
DecimalFormat df = new DecimalFormat("0.00");
System.out.print("Enter x1: ");
double x1 = Double.parseDouble(s.nextLine());
System.out.print("Enter y1: ");
double y1 = Double.parseDouble(s.nextLine());
System.out.print("Enter x2: ");
double x2 = Double.parseDouble(s.nextLine());
System.out.print("Enter y2: ");
double y2 = Double.parseDouble(s.nextLine());
double m = (y2-y1)/(x2-x1);
double b = y1 - m*x1;
System.out.println("y = " + df.format(m) + "x + " + df.format(b));
}
}