Question: 1. Write a Python program that does the following: a. Inputs a pair of points, (x1, y1), (x2, y2). (use the pairs given below, individually)

1. Write a Python program that does the following: a. Inputs a pair of points, (x1, y1), (x2, y2). (use the pairs given below, individually) b. Write a function that calculates the slope of the line connecting the points. Be sure to check if your input is numeric. Be sure to check if the slope is defined and not infinity. If the slope is infinity display that message. Use a threshold of 0.0001. c. Write a function that calculates the y-intercept of the line connecting the points. d. Write a function that outputs the equation of the line in slope-intercept (y = mx+b) form by calling the functions that you have written. Output floats to the thousandths place (xx.xxx). If input is not proper, then the program should output a message stating why. The program should not crash. Point pairs:

(x1, y1) (x2, y2) 1. (2, 4) (6, 8)

2. (4, 6) (-4, 6)

3. (8,10) (4,12)

4. (1,10) (1, 20)

5. (3.7, 6.6) (8.3, 4.4)

6. (1, a) (b, 2)

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!