Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

Explain the steps involved in training programmes.

Answered: 1 week ago

Question

4. How would you deal with the store manager?

Answered: 1 week ago