Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

what is going on here - what formula are we calculating - starting at x = y = th

ID: 3692162 • Letter: W

Question

what is going on here - what formula are we calculating - starting at x = y = thanks

#include <iostream>

using namespace std;

int main()
{
    float m1, m2, b1, b2, x, y;
    cout << "Enter the slope of line 1: ";
    cin >> m1;
    cout << "Enter the slope of line 2: ";
    cin >> m2;
    cout << "Enter the y-intercept of line 1: ";
    cin >> b1;
    cout << "Enter the y-intercept of line 2: ";
    cin >> b2;
    x = (b1-b2)/(m2 - m1);
    y = m1*x + b1;
    cout << "(" << x <<","<< y << ") ";
    return 0;
}

Explanation / Answer

In y = m1*x+b1; we are finding the equation of straight line. Here m is slopes and b is y-intercept

In x = (b1-b2)/(m2 - m1); here we are finding a point using slope and intercept to create a graph