The program has four files. utility.h just contains all the include statements, filer.h, filer.cpp has the code to make the file of random numbers, and test.cpp has the main function to test the code with the console input.

Here is the application code.



Code:
C++ Syntax (Toggle Plain Text)

    #include "utility.h"
    #include "filer.h"
     
    /***
     Created by Andrew Smith on 8/25/11
     This program tests the filer class by asking the
     user to define the number generation criteria.
     It prints the numbers to a file specified by
     the user
    ***/
     
    using namespace std;
     
    int main(){
     
    int num;
    int range;
    bool randNum;
    string fileName;
    filer file; //create new filer object
     
    //get file name
    cout << "File name?" << endl;
    cin >> fileName;
    //get how many numbers to generate
    cout << "How many number?" << endl;
    cin >> num;
    //get the range
    cout << "What is the range of numbers?" << endl;
    cin >> range;
    //random or pseudo random
    cout << "Random/Pseudo (true/false)" << endl;
    cin >> randNum;
     
    //make the file
    //file.makefile(num, range, rand, fileName);
     
    return 0;
    }


Sponsored Links