Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
nvhhung authored May 15, 2021
1 parent 5477aa5 commit 1552bda
Show file tree
Hide file tree
Showing 10 changed files with 5,162 additions and 0 deletions.
Binary file added Assignment2_doc_vi.pdf
Binary file not shown.
Binary file added Assignment2_spec_vi.pdf
Binary file not shown.
1,388 changes: 1,388 additions & 0 deletions FinishAss.cpp

Large diffs are not rendered by default.

Binary file added FinishAss.exe
Binary file not shown.
1,242 changes: 1,242 additions & 0 deletions expect.txt

Large diffs are not rendered by default.

1,242 changes: 1,242 additions & 0 deletions input.txt

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#include "main.h"
#include "processData.h"

using namespace std;
void usage();


int main(int argc, char** argv) {
ifstream inFile;
ofstream outFile;

if (argc != 3){
usage();
return EXIT_FAILURE;
}

inFile.open(argv[1]);
if (!inFile) {
cout << "Unable to open file " << argv[1];
return EXIT_FAILURE; // terminate with error
}

outFile.open(argv[2]);
if (!outFile) {
cout << "Unable to open file " << argv[2];
return EXIT_FAILURE; // terminate with error
}

ProcessData * data = new ProcessData();

string line;
while (getline(inFile, line)) {
outFile << data->process(line) << endl;
}

inFile.close();
outFile.close();
delete data;

return EXIT_SUCCESS;
}
void usage() {
cout << "Usage: main <input file> <output file>" << endl;
}
7 changes: 7 additions & 0 deletions main.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <iostream>
#include <string>
#include <fstream>
#include <map>
#include <math.h>

using namespace std;
Loading

0 comments on commit 1552bda

Please sign in to comment.