diff options
| author | Tyler Taormina <[email protected]> | 2021-11-14 22:02:06 -0800 |
|---|---|---|
| committer | Tyler Taormina <[email protected]> | 2021-11-14 22:02:06 -0800 |
| commit | f6ef79fae2201c6d5b47b32ab5e4962345e7ea42 (patch) | |
| tree | 7354af09f8c83ca24edcde67abc7f74f8d4785aa /num2.cpp | |
| parent | Lab complete (diff) | |
| download | cst116-lab7-till-t-f6ef79fae2201c6d5b47b32ab5e4962345e7ea42.tar.xz cst116-lab7-till-t-f6ef79fae2201c6d5b47b32ab5e4962345e7ea42.zip | |
Complete Lab
Diffstat (limited to 'num2.cpp')
| -rw-r--r-- | num2.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -130,7 +130,9 @@ void RmString(string arr[], int limit) // May need to use vector. int i = 0, j = 0, k = 0; int choice; + string deleted; string copy[max]; + cout << "What data entry would you like to delete..." << endl; PrintString(limit, arr); cout << "Please enter the number for the string that you'd like to delte: " << endl; @@ -142,28 +144,28 @@ void RmString(string arr[], int limit) { if (k == choice) { cout << "Deleting...\n\n" << endl; + deleted = arr[k]; k++; + j--; + } else { copy[j] = arr[k]; k++; } - - } - cout << "==================================================================\n"; cout << "Here is our updated database..." << endl; cout << "==================================================================\n"; - while (i < limit) + while (i < (limit - 1)) { cout << i+1 << ") " << copy[i] << endl; i++; } - + cout << "We removed: " << deleted << endl; } |