Question: Take four doubles from the command line, x1,y1 and x2,y2 (representing 2D * coordinates) and compute the slope described by the line. The slope formula
Take four doubles from the command line, x1,y1 and x2,y2 (representing 2D * coordinates) and compute the slope described by the line. The slope formula * is: * (y2 - y1) * slope = --------- * (x2 - x1) * * Print the usage message: "Usage: h4 x1 y1 x2 y2" if not enough parameters * are provided. The output should be: * slope of (x1,y1) to (x2,y2) is slope * Print the input coordinates to 2 decimal places and the slope * itself to 4 decimal places. * * Example input/output: * ./h4 1 2.5 -11.5 6
* slope of (1.00,2.50) to (-11.50,6.00) is -0.2800
int main(int argc, char *argv[]) { return 0; }
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
