aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Ten Eyck <[email protected]>2021-12-09 03:50:10 -0800
committerJoseph Ten Eyck <[email protected]>2021-12-09 03:50:10 -0800
commit6a15e27c904b4035778f9932b6b7e85a56108841 (patch)
tree1ad0fba4d26aa289dc0d12def2d4e1a759f4e210
parentI had a lot of troubles over the week with syntax errors while file reading/w... (diff)
downloadcst116-lab9-josephteneyck-master.tar.xz
cst116-lab9-josephteneyck-master.zip
Finished it all! All working and everything!HEADmaster
-rw-r--r--CST116F2021-Lab9/CST116F2021-Lab9 - Joseph Ten Eyck.cpp807
-rw-r--r--CST116F2021-Lab9/RUNS.txt206
-rw-r--r--CST116F2021-Lab9/Records.txt11
-rw-r--r--CST116F2021-Lab9/RecordsOutput.txt7
4 files changed, 729 insertions, 302 deletions
diff --git a/CST116F2021-Lab9/CST116F2021-Lab9 - Joseph Ten Eyck.cpp b/CST116F2021-Lab9/CST116F2021-Lab9 - Joseph Ten Eyck.cpp
index f186574..f1640f6 100644
--- a/CST116F2021-Lab9/CST116F2021-Lab9 - Joseph Ten Eyck.cpp
+++ b/CST116F2021-Lab9/CST116F2021-Lab9 - Joseph Ten Eyck.cpp
@@ -3,134 +3,155 @@
/////////////////////////////////////////////
-//#include <iostream>
-//#include <iomanip>
-//#include <fstream>
-//#include <string>
-//
-//using namespace std;
-//
-//const int MAX_INTEGERS = 10;
-//
-//void readData(string&, ifstream& inFile, int[]); //takes in user input filename, gets integers from file and puts them into an array
-//void sort(int[], int[]); //sorts the integers into another array (ascending order)
-//void displayInfo(int[]); //displays the smallest and greatest integers and then displays the list of sorted integers (ascending order)
-//
-//int main()
-//{
-// string fileName;
-// int originalList[MAX_INTEGERS];
-// int sortedList[MAX_INTEGERS];
-//
-// ifstream inFile;
-//
-// cout << "\n\t\t============================================";
-// cout << "\n\t\t Basic integer sorting from file";
-// cout << "\n\t\t (with smallest & greatest integer found)";
-// cout << "\n\t\t============================================";
-//
-// readData(fileName, inFile, originalList);
-// sort(originalList, sortedList);
-// displayInfo(sortedList);
-//
-//}
-//
-//void readData(string& fileName, ifstream& inFile, int originalList[]) //takes in user input filename, gets integers from file and puts them into an array
-//{
-// cout << "\n\n\tInput file name (including extension): ";
-// getline(cin, fileName);
-//
-// string filePath = "C:\\Users\\eclip\\source\\repos\\cst116-lab9-JosephTenEyck\\CST116F2021-Lab9\\" + fileName;
-//
-// inFile.open(filePath);
-//
-// if (inFile.is_open())
-// {
-// int i = 0;
-//
-// inFile >> originalList[i]; //priming read
-//
-// while (!inFile.eof()) //reads rest of file into array
-// {
-// i++;
-//
-// inFile >> originalList[i];
-// }
-// }
-// else
-// {
-// cout << "\n\nERROR: Unable to open file with name '" << fileName << "'" << endl;
-//
-// exit(1);
-// }
-//}
-//
-//void sort(int originalList[], int sortedList[]) //sorts the integers into another array (ascending order)
-//{
-// int tempList[MAX_INTEGERS];
-//
-// for (int i = 0; i < MAX_INTEGERS - 1; i++) //makes a copy of originalList to be used for sorting algorithm
-// {
-// tempList[i] = originalList[i];
-// }
-//
-// //sorting algorithm
-// for (int j = 0; j < MAX_INTEGERS - 1; j++) //each index of sortedList
-// {
-// if ((sizeof(tempList) / sizeof(tempList[0])) > 1)
-// {
-// int hold = tempList[0]; //value of current smallest found integer
-// int indexH = 0; //index of current smallest found integer
-//
-// for (int i = 0; i < (sizeof(tempList) / sizeof(tempList[0])) - 1; i++) //finds smallest number in the current version of tempList
-// {
-// if (hold < tempList[i + 1])
-// {
-// hold = hold;
-// }
-// else if (hold == tempList[i + 1])
-// {
-// hold = tempList[i + 1];
-// indexH++;
-// }
-// else
-// {
-// hold = tempList[i + 1];
-// indexH++;
-// }
-// }
-// sortedList[j] = hold; //writes currently found smallest integer to sortedList
-//
-// for (int k = 0; k < (sizeof(tempList) / sizeof(tempList[0])) - indexH + 1; k++) //removes current smallest found integer from tempList and compresses
-// {
-// tempList[indexH + k] = tempList[indexH + k + 1];
-// }
-// }
-// else if ((sizeof(tempList) / sizeof(tempList[0])) == 1)
-// {
-// sortedList[MAX_INTEGERS - 1] = tempList[0];
-// }
-// }
-//}
-//
-//void displayInfo(int sortedList[]) //displays the smallest and greatest integers and then displays the list of sorted integers (ascending order)
-//{
-// int smallest = sortedList[0];
-// int largest = sortedList[MAX_INTEGERS - 1];
-//
-// cout << "\n\n\tThe smallest number is: " << smallest;
-// cout << "\n\tThe largest number is: " << largest;
-//
-// cout << "\n\nThe numbers in order from smallest to largest are :";
-// cout << "\n\n";
-//
-// for (int i = 0; i < MAX_INTEGERS - 1; i++)
-// {
-// cout << sortedList[i] << ", ";
-// }
-//
-// cout << "\n" << endl;
-//}
+#include <iostream>
+#include <iomanip>
+#include <fstream>
+#include <string>
+
+using namespace std;
+
+const int MAX_INTEGERS = 10;
+
+void readData(string&, ifstream& inFile, int[]); //takes in user input filename, gets integers from file and puts them into an array
+void sort(int[], int[]); //sorts the integers into another array (ascending order)
+void displayInfo(int[]); //displays the smallest and greatest integers and then displays the list of sorted integers (ascending order)
+
+int main()
+{
+ string fileName;
+ int originalList[MAX_INTEGERS];
+ int sortedList[MAX_INTEGERS];
+
+ ifstream inFile;
+
+ cout << "\n\t\t============================================";
+ cout << "\n\t\t Basic integer sorting from file";
+ cout << "\n\t\t (with smallest & greatest integer found)";
+ cout << "\n\t\t============================================";
+
+ readData(fileName, inFile, originalList);
+ sort(originalList, sortedList);
+ displayInfo(sortedList);
+
+ return 0;
+}
+
+void readData(string& fileName, ifstream& inFile, int originalList[]) //takes in user input filename, gets integers from file and puts them into an array
+{
+ cout << "\n\n\tInput file name (including extension): ";
+ getline(cin, fileName);
+
+ string filePath = "C:\\Users\\eclip\\source\\repos\\cst116-lab9-JosephTenEyck\\CST116F2021-Lab9\\" + fileName;
+
+ inFile.open(filePath);
+
+ if (inFile.is_open())
+ {
+ int i = 0;
+
+ inFile >> originalList[i]; //priming read
+
+ while (!inFile.eof()) //reads rest of file into array
+ {
+ i++;
+
+ inFile >> originalList[i];
+ }
+ }
+ else
+ {
+ cout << "\n\nERROR: Unable to open file with name '" << fileName << "'" << endl;
+
+ exit(1);
+ }
+}
+
+void sort(int originalList[], int sortedList[]) //sorts the integers into another array (ascending order)
+{
+ for (int i = 0; i < MAX_INTEGERS; i++) //makes a copy of array in case the original list order is needed for something
+ {
+ sortedList[i] = originalList[i];
+ }
+
+ //actual working bubble sorting algorithm
+ for (int i = 0; i < MAX_INTEGERS; i++)
+ {
+ for (int j = 0; j < MAX_INTEGERS - i - 1; j++)
+ {
+ if (sortedList[j] > sortedList[j + 1])
+ {
+ int temp = sortedList[j];
+ sortedList[j] = sortedList[j + 1];
+ sortedList[j + 1] = temp;
+ }
+ }
+ }
+
+ ////my sorting algorithm that does not work
+ //int tempList[MAX_INTEGERS];
+
+ //for (int i = 0; i < MAX_INTEGERS - 1; i++) //makes a copy of originalList to be used for sorting algorithm
+ //{
+ // tempList[i] = originalList[i];
+ //}
+
+ //
+ //for (int j = 0; j < MAX_INTEGERS - 1; j++) //each index of sortedList
+ //{
+ // if ((sizeof(tempList) / sizeof(tempList[0])) > 1)
+ // {
+ // int hold = tempList[0]; //value of current smallest found integer
+ // int indexH = 0; //index of current smallest found integer
+
+ // for (int i = 0; i < (sizeof(tempList) / sizeof(tempList[0])) - 1; i++) //finds smallest number in the current version of tempList
+ // {
+ // if (hold < tempList[i + 1])
+ // {
+ // hold = hold;
+ // }
+ // else if (hold == tempList[i + 1])
+ // {
+ // hold = tempList[i + 1];
+ // indexH++;
+ // }
+ // else
+ // {
+ // hold = tempList[i + 1];
+ // indexH++;
+ // }
+ // }
+ // sortedList[j] = hold; //writes currently found smallest integer to sortedList
+
+ // for (int k = 0; k < (sizeof(tempList) / sizeof(tempList[0])) - indexH + 1; k++) //removes current smallest found integer from tempList and compresses
+ // {
+ // tempList[indexH + k] = tempList[indexH + k + 1];
+ // }
+ // }
+ // else if ((sizeof(tempList) / sizeof(tempList[0])) == 1)
+ // {
+ // sortedList[MAX_INTEGERS - 1] = tempList[0];
+ // }
+ //}
+}
+
+void displayInfo(int sortedList[]) //displays the smallest and greatest integers and then displays the list of sorted integers (ascending order)
+{
+ int smallest = sortedList[0];
+ int largest = sortedList[MAX_INTEGERS - 1];
+
+ cout << "\n\n\tThe smallest number is: " << smallest;
+ cout << "\n\tThe largest number is: " << largest;
+
+ cout << "\n\nThe numbers in order from smallest to largest are :";
+ cout << "\n\n";
+
+ for (int i = 0; i < MAX_INTEGERS; i++)
+ {
+ cout << sortedList[i] << ", ";
+ }
+
+ cout << "\n" << endl;
+}
/////////////////////////////////////////////
@@ -243,172 +264,364 @@
/////////////////////////////////////////////
-#include <iostream>
-#include <iomanip>
-#include <fstream>
-#include <string>
-#include <cstdio>
-#include <cstring>
-
-using namespace std;
-
-const int MAX_RECORDS = 5;
-
-void getData(ifstream& inFile, string[], string[], string[], string[]); //reads datafile into arrays
-void displayMenu(int&); //displays menu
-void findInfo(string[], string[], string[], string[]); //finds a person's info
-void addInfo(); //allows user to add a person to the database
-void editInfo(); //allows user to edit a person's info
-void displayRecords(); //displays all records
-
-int main()
-{
- ifstream inFile;
-
- int menuChoice = 0;
-
- string firstNames[MAX_RECORDS];
- string lastNames[MAX_RECORDS];
- string phoneNumbers[MAX_RECORDS];
- string birthdays[MAX_RECORDS];
-
-
- cout << "\n\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~";
- cout << "\n\t\t Basic database program";
- cout << "\n\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl;
-
- getData(inFile, firstNames, lastNames, phoneNumbers, birthdays);
- displayMenu(menuChoice);
-
- switch (menuChoice)
- {
- case 1:
- {
- findInfo(firstNames, lastNames, phoneNumbers, birthdays);
- break;
- }
- case 2:
- {
- addInfo();
- break;
- }
- case 3:
- {
- editInfo();
- break;
- }
- case 4:
- {
- displayRecords();
- break;
- }
- case 5:
- {
- cout << "\n\n\t\t~ Goodbye! ~" << endl;
- exit(0);
- break;
- }
- default:
- {
- cout << "\nERROR: Impossible menu value";
- }
- }
-}
-
-
-void getData(ifstream& inFile, string firstNames[], string lastNames[], string phoneNumbers[], string birthdays[])
-{
- inFile.open("C:\\Users\\eclip\\source\\repos\\cst116-lab9-JosephTenEyck\\CST116F2021-Lab9\\Records.txt");
-
- if (inFile.is_open())
- {
- int i = 0;
-
- inFile >> firstNames[i] >> lastNames[i] >> phoneNumbers[i] >> birthdays[i]; //priming read
-
- while (!inFile.eof()) //reads rest of file into array
- {
- i++;
-
- inFile >> firstNames[i] >> lastNames[i] >> phoneNumbers[i] >> birthdays[i];
- }
- }
- else
- {
- cout << "\n\nERROR: Unable to open file" << endl;
-
- exit(1);
- }
-}
-
-void displayMenu(int& menuChoice) //displays menu
-{
- do
- {
- cout << "\n\t\t==============================";
- cout << "\n\t\t What would you like to do?";
- cout << "\n\t\t==============================" << endl;
-
- cout << "\n\n\t1. Find person's info";
- cout << "\n\t2. Add person's info";
- cout << "\n\t3. Edit a person's info";
- cout << "\n\t4. Display all records";
- cout << "\n\t5. Exit";
-
- cout << "\n\n\t\tMenu choice: ";
- cin >> menuChoice;
-
- if (menuChoice < 1 || menuChoice > 5)
- {
- cout << "\nERROR: Invalid menu choice";
- }
- } while (menuChoice < 1 || menuChoice > 5);
-}
-
-void findInfo(string firstNames[], string lastNames[], string phoneNumbers[], string birthdays[]) //finds and displays a person's info
-{
- string searchFirst;
- string searchLast;
- int i = 0;
-
- cout << "\n\tEnter the peron's first name (case sensitive): ";
- cin >> searchFirst;
-
- cout << "\n\tEnter the peron's last name (case sensitive): ";
- cin >> searchLast;
-
- do
- {
- if (searchFirst == firstNames[i] && searchLast == lastNames[i])
- {
- cout << "\n~~~~";
- cout << "\n" << "First name: " << firstNames[i];
- cout << "\n" << "Last name: " << lastNames[i];
- cout << "\n" << "Phone number: " << phoneNumbers[i];
- cout << "\n" << "Birthday: " << birthdays[i];
- cout << "\n~~~~" << endl;
-
- break;
- }
-
- i++;
-
- } while (searchFirst != firstNames[i] && searchLast != lastNames[i]);
-
- cout << "\n\n\t\tGOT HERE!!!!";
-}
-
-void addInfo() //allows user to add a person to the database
-{
-
-}
-
-void editInfo() //allows user to edit a person's info
-{
-
-}
-
-void displayRecords() //displays all records
-{
-
-} \ No newline at end of file
+//#include <iostream>
+//#include <iomanip>
+//#include <fstream>
+//#include <string>
+//#include <cstdio>
+//#include <cstring>
+//
+//using namespace std;
+//
+//const int MAX_RECORDS = 10;
+//
+//int getData(ifstream& inFile, string[], string[], string[], string[]); //reads datafile into arrays
+//void displayMenu(int&); //displays menu, takes in user menu choice
+//void processMenuChoice(ofstream& outFile, int, int&, string[], string[], string[], string[]); //processes user menu choice
+//void findInfo(int, string[], string[], string[], string[]); //finds a person's info
+//void addInfo(int&, string[], string[], string[], string[]); //allows user to add a person to the database
+//void editInfo(int, string[], string[], string[], string[]); //allows user to edit a person's info
+//void displayRecords(int, string[], string[], string[], string[]); //displays all records
+//void sort(int, string[], string[], string[], string[]); //sorts records by last name
+//void fileWrite(ofstream& outFile, int, string[], string[], string[], string[]); //writes the arrays to the output file
+//
+//int main()
+//{
+// ifstream inFile;
+// ofstream outFile;
+//
+// int menuChoice = 1;
+// int count = 0;
+//
+// string firstNames[MAX_RECORDS];
+// string lastNames[MAX_RECORDS];
+// string phoneNumbers[MAX_RECORDS];
+// string birthdays[MAX_RECORDS];
+//
+//
+// cout << "\n\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~";
+// cout << "\n\t\t Basic database program";
+// cout << "\n\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl;
+//
+// count = getData(inFile, firstNames, lastNames, phoneNumbers, birthdays) + 1;
+//
+// do
+// {
+// displayMenu(menuChoice);
+// processMenuChoice(outFile, menuChoice, count, firstNames, lastNames, phoneNumbers, birthdays);
+//
+// } while (menuChoice > 0 && menuChoice < 6);
+//
+// return 0;
+//}
+//
+//
+//int getData(ifstream& inFile, string firstNames[], string lastNames[], string phoneNumbers[], string birthdays[])
+//{
+// inFile.open("C:\\Users\\eclip\\source\\repos\\cst116-lab9-JosephTenEyck\\CST116F2021-Lab9\\Records.txt");
+//
+// int recordCount = 0;
+//
+// if (inFile.is_open())
+// {
+// inFile >> firstNames[recordCount] >> lastNames[recordCount] >> phoneNumbers[recordCount] >> birthdays[recordCount]; //priming read
+//
+// while (!inFile.eof()) //reads rest of file into array
+// {
+// recordCount++;
+//
+// inFile >> firstNames[recordCount] >> lastNames[recordCount] >> phoneNumbers[recordCount] >> birthdays[recordCount];
+// }
+// inFile.close();
+// }
+// else
+// {
+// cout << "\n\nERROR: Unable to open file" << endl;
+//
+// exit(1);
+// }
+//
+// return recordCount;
+//}
+//
+//void displayMenu(int& menuChoice) //displays menu
+//{
+// do
+// {
+// cout << "\n\t\t==============================";
+// cout << "\n\t\t What would you like to do?";
+// cout << "\n\t\t==============================" << endl;
+//
+// cout << "\n\n\t1. Find person's info";
+// cout << "\n\t2. Add person's info";
+// cout << "\n\t3. Edit a person's info";
+// cout << "\n\t4. Display all records";
+// cout << "\n\t5. Exit";
+//
+// cout << "\n\n\t\tMenu choice: ";
+// cin >> menuChoice;
+//
+// if (menuChoice < 1 || menuChoice > 5)
+// {
+// cout << "\nERROR: Invalid menu choice";
+// }
+// } while (menuChoice < 1 || menuChoice > 5);
+//}
+//
+//void processMenuChoice(ofstream& outFile, int menuChoice, int& count, string firstNames[], string lastNames[], string phoneNumbers[], string birthdays[])
+//{
+// switch (menuChoice)
+// {
+// case 1:
+// {
+// findInfo(count, firstNames, lastNames, phoneNumbers, birthdays);
+// break;
+// }
+// case 2:
+// {
+// addInfo(count, firstNames, lastNames, phoneNumbers, birthdays);
+// break;
+// }
+// case 3:
+// {
+// editInfo(count, firstNames, lastNames, phoneNumbers, birthdays);
+// break;
+// }
+// case 4:
+// {
+// sort(count, firstNames, lastNames, phoneNumbers, birthdays);
+// displayRecords(count, firstNames, lastNames, phoneNumbers, birthdays);
+// break;
+// }
+// case 5:
+// {
+// fileWrite(outFile, count, firstNames, lastNames, phoneNumbers, birthdays);
+//
+// cout << "\n\t~~ ~~";
+// cout << "\n\t Output file successfully written!";
+// cout << "\n\t~~ ~~";
+//
+// cout << "\n\n\t\t~ Goodbye! ~" << endl;
+//
+// exit(0);
+// break;
+// }
+// default:
+// {
+// cout << "\nERROR: Impossible menu value";
+// }
+// }
+//}
+//
+//void findInfo(int count, string firstNames[], string lastNames[], string phoneNumbers[], string birthdays[]) //finds and displays a person's info
+//{
+// string searchFirst;
+// string searchLast;
+// int i = 0;
+//
+// cout << "\n\tEnter the person's first name (case sensitive): ";
+// cin >> searchFirst;
+//
+// cout << "\n\tEnter the person's last name (case sensitive): ";
+// cin >> searchLast;
+//
+// do
+// {
+// if (searchFirst == firstNames[i] && searchLast == lastNames[i])
+// {
+// cout << "\n~~~~";
+// cout << "\n" << "First name: " << firstNames[i];
+// cout << "\n" << "Last name: " << lastNames[i];
+// cout << "\n" << "Phone number: " << phoneNumbers[i];
+// cout << "\n" << "Birthday: " << birthdays[i];
+// cout << "\n~~~~" << endl;
+//
+// break;
+// }
+//
+// i++;
+//
+// } while (i < count);
+//
+// if (i == count)
+// {
+// cout << "\n\tPerson not found." << endl;
+// }
+//}
+//
+//void addInfo(int& count, string firstNames[], string lastNames[], string phoneNumbers[], string birthdays[]) //allows user to add a person to the database
+//{
+// cout << "\n\tEnter first name (no spaces): ";
+// cin >> firstNames[count];
+//
+// cout << "\n\tEnter last name (no spaces): ";
+// cin >> lastNames[count];
+//
+// cout << "\n\tEnter phone number (ex: 555-123-4567): ";
+// cin >> phoneNumbers[count];
+//
+// cout << "\n\tEnter birthday mm/dd/yyyy (ex: 1/26/1996): ";
+// cin >> birthdays[count];
+//
+// count++;
+//
+// sort(count, firstNames, lastNames, phoneNumbers, birthdays);
+//
+// cout << "\n\t~~ ~~";
+// cout << "\n\t Data entered successfully!" << endl;
+// cout << "\n\t~~ ~~";
+//}
+//
+//void editInfo(int count, string firstNames[], string lastNames[], string phoneNumbers[], string birthdays[]) //allows user to edit a person's info
+//{
+// string searchFirst;
+// string searchLast;
+// int i = 0;
+// int editLocation = 0;
+// int menu2 = 0;
+//
+// cout << "\n\tEnter the peron's first name (case sensitive): ";
+// cin >> searchFirst;
+//
+// cout << "\n\tEnter the peron's last name (case sensitive): ";
+// cin >> searchLast;
+//
+// do
+// {
+// if (searchFirst == firstNames[i] && searchLast == lastNames[i]) //finds index of record to edit
+// {
+// editLocation = i;
+// }
+//
+// i++;
+//
+// } while (i < count - 1);
+//
+// if (i == count - 1)
+// {
+// cout << "\n\tPerson not found." << endl;
+// }
+//
+// do
+// {
+// cout << "\n\t\t---------------------------------------";
+// cout << "\n\t\t What info would you like to change?";
+// cout << "\n\t\t---------------------------------------";
+//
+// cout << "\n\n\t1. First name";
+// cout << "\n\t2. Last name";
+// cout << "\n\t3. Phone number";
+// cout << "\n\t4. Birthday";
+//
+// cout << "\n\n\t\tMenu choice: ";
+// cin >> menu2;
+//
+// if (menu2 < 1 || menu2 > 4)
+// {
+// cout << "\nERROR: Invalid menu choice";
+// }
+// } while (menu2 < 1 || menu2 > 4);
+//
+// switch (menu2)
+// {
+// case 1:
+// {
+// cout << "\n\tEnter new first name (no spaces): ";
+// cin >> firstNames[editLocation];
+//
+// cout << "\n\tChange successful!" << endl;
+//
+// break;
+// }
+// case 2:
+// {
+// cout << "\n\tEnter new last name (no spaces): ";
+// cin >> lastNames[editLocation];
+//
+// sort(count, firstNames, lastNames, phoneNumbers, birthdays);
+//
+// cout << "\n\tChange successful!" << endl;
+//
+// break;
+// }
+// case 3:
+// {
+// cout << "\n\tEnter new phone number (ex: 555-123-4567): ";
+// cin >> phoneNumbers[editLocation];
+//
+// cout << "\n\tChange successful!" << endl;
+//
+// break;
+// }
+// case 4:
+// {
+// cout << "\n\tEnter new birthday dd/mm/yyyy (ex: 1/26/1996): ";
+// cin >> birthdays[editLocation];
+//
+// cout << "\n\tChange successful!" << endl;
+//
+// break;
+// }
+// default:
+// {
+// cout << "\nERROR: Impossible menu2 value." << endl;
+// }
+// }
+//}
+//
+//void displayRecords(int count, string firstNames[], string lastNames[], string phoneNumbers[], string birthdays[]) //displays all records
+//{
+// cout << "\n\nName (last, first) " << "Phone Number " << "Birthday";
+// cout << "\n------------------------------------------------------------------------------------\n";
+//
+// for (int i = 0; i < count; i++)
+// {
+// cout << left << setw(30) << lastNames[i] + ", " + firstNames[i]
+// << left << setw(18) << phoneNumbers[i] << left << setw(12) << birthdays[i] << "\n";
+// }
+// cout << endl;
+//}
+//
+//void sort(int count, string firstNames[], string lastNames[], string phoneNumbers[], string birthdays[]) //sorts records by last name
+//{
+// for (int i = 0; i < count; i++) //bubble sort algorithm (efficient)
+// {
+// for (int j = 0; j < count - i - 1; j++)
+// {
+// if (lastNames[j] > lastNames[j + 1])
+// {
+// string temp1 = lastNames[j];
+// string temp2 = firstNames[j];
+// string temp3 = phoneNumbers[j];
+// string temp4 = birthdays[j];
+//
+// lastNames[j] = lastNames[j + 1];
+// lastNames[j + 1] = temp1;
+//
+// firstNames[j] = firstNames[j + 1];
+// firstNames[j + 1] = temp2;
+//
+// phoneNumbers[j] = phoneNumbers[j + 1];
+// phoneNumbers[j + 1] = temp3;
+//
+// birthdays[j] = birthdays[j + 1];
+// birthdays[j + 1] = temp4;
+// }
+// }
+// }
+//}
+//
+//void fileWrite(ofstream& outFile, int count, string firstNames[], string lastNames[], string phoneNumbers[], string birthdays[]) //writes the arrays to the output file
+//{
+// outFile.open("C:\\Users\\eclip\\source\\repos\\cst116-lab9-JosephTenEyck\\CST116F2021-Lab9\\RecordsOutput.txt");
+//
+// if (outFile.is_open())
+// {
+// for (int i = 0; i < count; i++)
+// {
+// outFile << firstNames[i] << " " << lastNames[i] << " "
+// << phoneNumbers[i] << " " << birthdays[i] << "\n";
+// }
+// outFile.close();
+// }
+//} \ No newline at end of file
diff --git a/CST116F2021-Lab9/RUNS.txt b/CST116F2021-Lab9/RUNS.txt
index f8fcf68..d348660 100644
--- a/CST116F2021-Lab9/RUNS.txt
+++ b/CST116F2021-Lab9/RUNS.txt
@@ -3,6 +3,28 @@
//////////////////////////////////////////////
+ ============================================
+ Basic integer sorting from file
+ (with smallest & greatest integer found)
+ ============================================
+
+ Input file name (including extension): Integers.txt
+
+
+ The smallest number is: 23
+ The largest number is: 2021
+
+The numbers in order from smallest to largest are :
+
+23, 33, 44, 120, 234, 340, 501, 530, 567, 2021,
+
+
+C:\Users\eclip\Source\Repos\cst116-lab9-JosephTenEyck\Debug\CST116F2021-Lab9.exe (process 6868) exited with code 0.
+To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
+Press any key to close this window . . .
+
+
+
//////////////////////////////////////////////
// RUNs FOR PROBLEM #3 ON PAGE 337 ARE BELOW
//////////////////////////////////////////////
@@ -54,3 +76,187 @@ Press any key to close this window . . .
//////////////////////////////////////////////
+
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Basic database program
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ ==============================
+ What would you like to do?
+ ==============================
+
+
+ 1. Find person's info
+ 2. Add person's info
+ 3. Edit a person's info
+ 4. Display all records
+ 5. Exit
+
+ Menu choice: 4
+
+
+Name (last, first) Phone Number Birthday
+------------------------------------------------------------------------------------
+Clackin, Clayton 635-254-1458 2/23/1999
+Falcon, Scarlett 636-985-6742 10/17/1975
+Megadude, Todd 555-123-4567 11/24/1990
+Pies, Sherri 321-987-6542 1/19/2005
+Pizzaguy, Tony 503-928-6666 5/21/2010
+Strangelove, Breanna 666-321-9856 6/18/1804
+
+
+ ==============================
+ What would you like to do?
+ ==============================
+
+
+ 1. Find person's info
+ 2. Add person's info
+ 3. Edit a person's info
+ 4. Display all records
+ 5. Exit
+
+ Menu choice: 1
+
+ Enter the person's first name (case sensitive): Todd
+
+ Enter the person's last name (case sensitive): Megadude
+
+~~~~
+First name: Todd
+Last name: Megadude
+Phone number: 555-123-4567
+Birthday: 11/24/1990
+~~~~
+
+ ==============================
+ What would you like to do?
+ ==============================
+
+
+ 1. Find person's info
+ 2. Add person's info
+ 3. Edit a person's info
+ 4. Display all records
+ 5. Exit
+
+ Menu choice: 2
+
+ Enter first name (no spaces): Katie
+
+ Enter last name (no spaces): Dutch
+
+ Enter phone number (ex: 555-123-4567): 552-180-9623
+
+ Enter birthday mm/dd/yyyy (ex: 1/26/1996): 2/8/1950
+
+ ~~ ~~
+ Data entered successfully!
+
+ ~~ ~~
+ ==============================
+ What would you like to do?
+ ==============================
+
+
+ 1. Find person's info
+ 2. Add person's info
+ 3. Edit a person's info
+ 4. Display all records
+ 5. Exit
+
+ Menu choice: 4
+
+
+Name (last, first) Phone Number Birthday
+------------------------------------------------------------------------------------
+Clackin, Clayton 635-254-1458 2/23/1999
+Dutch, Katie 552-180-9623 2/8/1950
+Falcon, Scarlett 636-985-6742 10/17/1975
+Megadude, Todd 555-123-4567 11/24/1990
+Pies, Sherri 321-987-6542 1/19/2005
+Pizzaguy, Tony 503-928-6666 5/21/2010
+Strangelove, Breanna 666-321-9856 6/18/1804
+
+
+ ==============================
+ What would you like to do?
+ ==============================
+
+
+ 1. Find person's info
+ 2. Add person's info
+ 3. Edit a person's info
+ 4. Display all records
+ 5. Exit
+
+ Menu choice: 3
+
+ Enter the peron's first name (case sensitive): Katie
+
+ Enter the peron's last name (case sensitive): Dutch
+
+ Person not found.
+
+ ---------------------------------------
+ What info would you like to change?
+ ---------------------------------------
+
+ 1. First name
+ 2. Last name
+ 3. Phone number
+ 4. Birthday
+
+ Menu choice: 2
+
+ Enter new last name (no spaces): Zenith
+
+ Change successful!
+
+ ==============================
+ What would you like to do?
+ ==============================
+
+
+ 1. Find person's info
+ 2. Add person's info
+ 3. Edit a person's info
+ 4. Display all records
+ 5. Exit
+
+ Menu choice: 4
+
+
+Name (last, first) Phone Number Birthday
+------------------------------------------------------------------------------------
+Clackin, Clayton 635-254-1458 2/23/1999
+Falcon, Scarlett 636-985-6742 10/17/1975
+Megadude, Todd 555-123-4567 11/24/1990
+Pies, Sherri 321-987-6542 1/19/2005
+Pizzaguy, Tony 503-928-6666 5/21/2010
+Strangelove, Breanna 666-321-9856 6/18/1804
+Zenith, Katie 552-180-9623 2/8/1950
+
+
+ ==============================
+ What would you like to do?
+ ==============================
+
+
+ 1. Find person's info
+ 2. Add person's info
+ 3. Edit a person's info
+ 4. Display all records
+ 5. Exit
+
+ Menu choice: 5
+
+ ~~ ~~
+ Output file successfully written!
+ ~~ ~~
+
+ ~ Goodbye! ~
+
+C:\Users\eclip\Source\Repos\cst116-lab9-JosephTenEyck\Debug\CST116F2021-Lab9.exe (process 15744) exited with code 0.
+To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
+Press any key to close this window . . .
diff --git a/CST116F2021-Lab9/Records.txt b/CST116F2021-Lab9/Records.txt
index 5328244..d0a448b 100644
--- a/CST116F2021-Lab9/Records.txt
+++ b/CST116F2021-Lab9/Records.txt
@@ -1,5 +1,6 @@
-Todd Megadude 5551234567 11/24/1990
-Breanna Strangelove 6663219856 6/18/1804
-Sherri Pies 3219876542 1/19/2005
-Clayton Clackin 6352541458 2/23/1999
-Scarlett Falcon 6369856742 10/17/1975 \ No newline at end of file
+Todd Megadude 555-123-4567 11/24/1990
+Breanna Strangelove 666-321-9856 6/18/1804
+Sherri Pies 321-987-6542 1/19/2005
+Clayton Clackin 635-254-1458 2/23/1999
+Scarlett Falcon 636-985-6742 10/17/1975
+Tony Pizzaguy 503-928-6666 5/21/2010 \ No newline at end of file
diff --git a/CST116F2021-Lab9/RecordsOutput.txt b/CST116F2021-Lab9/RecordsOutput.txt
new file mode 100644
index 0000000..f9f7f78
--- /dev/null
+++ b/CST116F2021-Lab9/RecordsOutput.txt
@@ -0,0 +1,7 @@
+Clayton Clackin 635-254-1458 2/23/1999
+Scarlett Falcon 636-985-6742 10/17/1975
+Todd Megadude 555-123-4567 11/24/1990
+Sherri Pies 321-987-6542 1/19/2005
+Tony Pizzaguy 503-928-6666 5/21/2010
+Breanna Strangelove 666-321-9856 6/18/1804
+Katie Zenith 552-180-9623 2/8/1950