Hi, I am a begginner programmer that is attempting to create a program that will spit out the (x,y) plots for a graph. Currently, I only need it to give me the x and y data in (x,y) form, so here is my current code. By the way, I am experiencing errors in it so if anyone could proofread it that would be greatly appriciated.
--Dylan
//Grapher
#include <iostream>;
#include <fstream>;
#include <string.h>;
#include <cctype>;
using namespace std;
void grapher(float, float, int, int, int, int);
int main() {
float yInt;
float xInt;
float m;
int yMin = -10;
int yMax = 10;
int xMin = -10;
int xMax = 10;
cout << "Welcome to teh GRAPHER" << endl;
cout << "Key = Y=M*X+B" << endl;
cout << "Enter M: ";
cin >> m;
cout << "Enter B: ";
cin >> yInt;
grapher(m, yInt, yMin, yMax, xMin, xMax);
system("pause");
return 0;
}
grapher(float m, float yInt,int yMin,int yMax, int xMin, int xMax) {
int counter = xMin;
cout << "Calculating graph..." << endl;
float xData[];
float yData[];
while(counter <= yMax || counter >= yMin || counter =< xMax || counter => xMin){
cout << "In teh Graph Calculating Prog..." << endl;
xData[counter] = counter;
yData[counter] = xData[counter] * m + yInt;
cout << "(" << xData[counter] << "," << yData[counter] << ")" << endl;
}
return;
}