help with SQL files

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!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <fstream>
using namespace 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;
}
Here is what I'm suppose to do. http://m.imgur.com/9KHrvs4
Put the equation in an input folder and get all the results in an output folder
Topic archived. No new replies allowed.