diff options
| author | alexandra-apetroaei <andra@MSI> | 2022-11-02 22:26:59 -0800 |
|---|---|---|
| committer | alexandra-apetroaei <andra@MSI> | 2022-11-02 22:26:59 -0800 |
| commit | 5a9653ed640e7cc1e4eb85fd11ad0379296c7ccc (patch) | |
| tree | fff1a9c5e1b0c868d65a260095ff04dc65e443e9 | |
| parent | change (diff) | |
| download | cst116-ch11-debugging-alexandra-apetroaei-5a9653ed640e7cc1e4eb85fd11ad0379296c7ccc.tar.xz cst116-ch11-debugging-alexandra-apetroaei-5a9653ed640e7cc1e4eb85fd11ad0379296c7ccc.zip | |
finish
| -rw-r--r-- | CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp | 7 | ||||
| -rw-r--r-- | TEMP/psuedocode.txt | 6 |
2 files changed, 11 insertions, 2 deletions
diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp index ffbcaa4..f1212c3 100644 --- a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp +++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp @@ -67,6 +67,7 @@ using std::ofstream; const int EMPLOYEES = 20; const int MAX = 21; + int ReadData(ifstream& inFile, ofstream& outFile, char name[][MAX], int age[]); void WriteOutputFile(ofstream& outFile, char name[][MAX], int age[], @@ -79,6 +80,7 @@ int main() char name[EMPLOYEES][MAX]; int age[EMPLOYEES]; int record_counter(0); + int totalRecords; ifstream inFile; @@ -112,10 +114,11 @@ int main() } return 0; } -int ReadData(ifstream& inFile, ofstream& outFile, char name[][MAX], int age[]) +int ReadData(ifstream& inFile, ofstream& outFile, char name[][MAX], int age[]) { int counter = 0; - inFile >> name[counter] >> age[counter]; // Priming Read + + inFile >> name[counter] >> age[counter]; // Priming Read while (!inFile.eof()) { diff --git a/TEMP/psuedocode.txt b/TEMP/psuedocode.txt new file mode 100644 index 0000000..2983b7e --- /dev/null +++ b/TEMP/psuedocode.txt @@ -0,0 +1,6 @@ +Read in variable employees and assign the value 20 +Read in variable empoyee name +Read in variable age + +Make a file and input it to the program +Display total records to the user
\ No newline at end of file |