Project 1: Intersection of Sloped Lines

In the example above, the red line has slope -1 and y-intercept 2.  The blue line has slope 1 and y-intercept -4.

The equation of the first line is: y = -x + 2.  The equation of the second line is: y = x - 4

Using the substitution method, we can let -x + 2 = x - 4.

Solving this algebraically yields: -2x = -6, which yields x = 3.

If we substitute x = 3 into either equation, we obtain y = -1.

Therefore, the solution to the system of equation is (3, -1), which is the point where the lines intersect.


Example 2:

y = -2x + 7

y = 3x - 3

Substitution: -2x + 7 = 3x - 3

Solving: -5x = -10

               x = 2

Substituting: y = -2(2) + 7 = 3

Intersection point occurs at (2, 3).


Project 1: Variables 'm1', 'b1', 'm2', 'b2' are initialized.  

Task: Assign the variables appropriately so that 'x' and 'y' represent the x and y values for the intersection point.

**If your code works for 5 test cases in a row, you can enter your e-mail address.