Question: COP 3 5 0 2 C Python Module 0 2 Lab Activity C You are given two lines in slope - intercept form ) =

COP3502C Python
Module 02 Lab
Activity C
You are given two lines in slope-intercept form )=(mx+b and must find their intersection point. For example, if Line 1 is y=x and Line 2 is y=3, then the intersect point is (3,3). Develop a program to find the intersection of any two lines (you can assume there will always be an intersection!).
Program Inputs ?()
Enter m for Line 1:
Enter b for Line 1:
Enter m for Line 2:
Enter b for Line 2: - You can safely assume the user will always enter real numbers for all questions.
Program Outputs
The intersection point is (XXX,YYY)
Replace xxx with correct x coordinate and YYY with the y coordinate with at most 2 decimal places
Sample Output
Test Case 1:
Enter m for Line 1: 1
Enter b for Line 1: 0
Enter m for Line 2: 0
Enter b for Line 2: 3
The intersection point is (3.0,3.0)
Test Case 2:
Enter m for Line 1: 0.5
Enter b for Line 1: 1
Enter m for Line 2: -2
Enter b for Line 2: 20
The intersection point is (7.6,4.8)
COP3502C Python
Module 02Lab
Test Case 3:
Enter m for Line 1: 3
Enter b for Line 1: -5
Enter m for Line 2: 0.01
Enter b for Line 2: 2
The intersection point is (2.34,2.02)
Test Case 4:
Enter m for Line 1: 20
Enter b for Line 1: 0
Enter m for Line 2: -5.5
Enter b for Line 2: 50
The intersection point is (1.96,39.22)
 COP3502C Python Module 02 Lab Activity C You are given two

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!