Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help this is the first project and i have no clue how to do this. Thanks! . Slopelntercept.java needed that takes the x and
Please help this is the first project and i have no clue how to do this. Thanks!
. Slopelntercept.java needed that takes the x and y coordinates of two points as doubles Requirements: A program is and calculates the slope (if defined) of the line defined by the two points. The slope is only defined if the two x coordinates are not equal. If the slope is defined, the program calculates and prints the Y intercept and then further, if the slope is not 0, it calculates and prints the X intercept 2) and the Y and X intercepts are as Design: The equations for finding the slope (where xl follows: y2-y1 x2-x1 slope where x1 x2 = yl intercept-yl-slope * x1 ylntercept x!intercept =-1 * where slope 0; i.e.,y1 y2 Three examples of program output for the indicated input values are show below (you may replace everything in italics with your own words if desired) Example #1 Line number out Enter the Xand Ycoordinates of starting point x1=3 y1 = 1 x2 = 4 y2 = 2 Enter the X and Y coordinates of ending point Slope: 1.0 Y intercept: -2.0 X intercept: 2.0 Note that lines 2, 3, 5, and 6 begin with tab, which is set to three spaces in jGRASP. Below is an example where slope is undefined 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