I'm having trouble making a bank statements with SQL input and output files. The formula should be in the input, and the output should display numbers. Since I missed so many days because of switching jobs, my teacher said this assignment is make or break for me. This aboutvthe set-up I'm looking for, but not sure how to pull from the input file. I have a picture of the assignment, but can't upload it. Any advice would be appreciated. Thanks!
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <fstream>
usingnamespace std;
/*
*
*/
int main()
{
double sum = 0.0;
int max = 0;
int min = 0;
int number;
ifstream getdata;
ofstream outresult;
getdata.open ("num.sql");
if (!getdata)
{
cout << "unable to open test file";
exit (1);
}
outresult.open ("outp.sql");
if (!outresult)
{
cout << "unable to open num/result file" << endl;
exit (1);
}
while (getdata >> number)
{
max = (number > max) ? number : max;
min = (number < min) ? number : min;
}
outresult << "The difference is = " << max - min << endl;
getdata.close ();
outresult.close ();
return 0;
}