Question: Help. Declare double variables x1,y1,x2, and y2, and read each variable from input in that order. Find the slope between point ( x1, y1) and

Help.
Declare double variables x1,y1,x2, and y2, and read each variable from input in that order. Find the slope between point ( x1, y1) and point (x2,y2) and assign the result to slopeValue. The calculation is: slope =x2x1y2y1 Ex: If the input is 2.03.54.53.0, the output is: 0.20 Note: Assume that x1 and 2 will not be the same. 1234567891011121314151617importjava.util.Scanner;publicclassSlopeCalculator{publicstaticvoidmain(String[]args){Scannerscnr=newScanner(System.in);doubleslopeValue;doublex1,x2,y1,y2;System.out.println("Enterthex1coordinate");x1=sc.nextDouble();System.out.println("Enterthey1coordinate");y1=sc.nextDouble();System.out.println("Enterthex2coordinate");x2=sc.nextDouble();System.out.println("Enterthey2coordinate");y2=sc.nextDouble()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
