In my math programming class I have an assignment to find the slope intercept formula (y2 - y1) / (x2 - x1) which is the m of the formula y = mx + b.
I have to find 2 slope intercept equations and make an if-statement or multiple if-statements to see if the lines intercept, don't intercept, or are the same line. Pretty easy right? I have 2 error LNK2019 errors. There are my errors and my program is copy pasted underneath. Can anyone help me out please??
1>main_program.obj : error LNK2019: unresolved external symbol "float __cdecl Other_Slope_intercept_formula(float *,float *)" (?Other_Slope_intercept_formula@@YAMPAM0@Z) referenced in function _main
1>main_program.obj : error LNK2019: unresolved external symbol "float __cdecl Slope_intercept_formula_of_the_lines(float *,float *)" (?Slope_intercept_formula_of_the_lines@@YAMPAM0@Z) referenced in function _main
1>c:\users\zvjezdan\documents\visual studio 2010\Projects\project2_gamephysics\Debug\project2_gamephysics.exe : fatal error LNK1120: 2 unresolved externals
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;
int main()
{
int formula1[2];
int formula2[2];
int formula3[2];
int formula4[2];
int B, b;
cout << "Welcome to the program. ^_^" << endl;
cout << endl;
cout << "What is the X number for the first slope intercept formula? ";
cin >> formula1[0];
cout << endl;
cout << "What is the Y number for the first slope intercept formula? ";
cin >> formula1[1];
cout << endl;
cout << "What is the X number for the second slope intercept formula? ";
cin >> formula2[0];
cout << endl;
cout << "What is the Y number for the second slope intercept formula? ";
cin >> formula2[1];
cout << endl;
float Slope_intercept_formula_of_the_lines( float *formula1, float *formula2);
{
cout << " The slope intercept formula is (y2 - y1) / (x2 - x1) which is the M in the formula y = mx + b" << endl;
cout << endl;
cout << "That being the case, your Slope Intercept of the First Problem is: " << (formula2[1] - formula1[1]) /(formula2[0] - formula1[0]) << "x" << endl;
cout << endl;
};
cout << "For the formula y = mx + b, your m is: " << Slope_intercept_formula_of_the_lines << "x" << endl;
cout << endl;
cout << "What do you want b to be? ";
cin >> B;
cout << endl;
cout << "What is the X number for the first slope intercept formula? ";
cin >> formula3[0];
cout << endl;
cout << "What is the Y number for the first slope intercept formula? ";
cin >> formula3[1];
cout << endl;
cout << "What is the X number for the second slope intercept formula? ";
cin >> formula4[0];
cout << endl;
cout << "What is the Y number for the second slope intercept formula? ";
cin >> formula4[1];
cout << endl;
float Other_Slope_intercept_formula( float *formula3, float *formula4);
{
cout << " The slope intercept formula is (y2 - y1) / (x2 - x1) which is the M in the formula y = mx + b" << endl;
cout << endl;
cout << "That being the case, your Slope Intercept of the First Problem is: " << (formula4[1] - formula3[1]) /(formula4[0] - formula3[0]) << "x" << endl;
cout << endl;
};
cout << "For the formula y = mx + b, your m is: " << Other_Slope_intercept_formula << "x" << endl;
cout << endl;
cout << "What do you want b to be? ";
cin >> b;
cout << endl;
if (Slope_intercept_formula_of_the_lines == Other_Slope_intercept_formula && B == b)
{
cout << "The Lines are the same line. " << endl;
cout << endl;
}
else if (Slope_intercept_formula_of_the_lines == Other_Slope_intercept_formula && B != b)
{
cout << "The lines are parallel." << endl;
cout << endl;
}
else if (Slope_intercept_formula_of_the_lines != Other_Slope_intercept_formula && B == b)
{
cout << "The lines intersect at B." << endl;
cout << endl;
}
else if(Slope_intercept_formula_of_the_lines != Other_Slope_intercept_formula && B != b)
{
cout << "The lines intersect." << endl;
cout << endl;
}
system("pause");
return 0;
}