Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started