Question: 1. (6) Two points in a plane ( x - y coordinate system) are specified using the coordinates ( x 1, y 1) and (

1. (6) Two points in a plane (x-y coordinate system) are specified using the coordinates (x1, y1) and (x2, y2). Write a program that gets the points from the user and

(a) calculates the slope of a line through two (non-vertical) points;

(c) outputs the slope to the screen.

(d) If the user enters two points on a vertical line, the denominator of the slope formula will be zero. Fix the program so that the program wont fail if the points are on a vertical line.

(e) (Optional) Write an equation for the line determined by the two points and output it to the screen.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!