From 5b3e2238563a94514c5f67023e7670b8c406c8af Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 23 Jan 2017 10:45:06 -0400 Subject: [PATCH 01/47] Added header file --- take home test .h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 take home test .h diff --git a/take home test .h b/take home test .h new file mode 100644 index 0000000..49f49da --- /dev/null +++ b/take home test .h @@ -0,0 +1,30 @@ + +#include +#include + +using namespace std; + +class Rectangle { +private: + int width; + +public: + int area() { return width*height; } + + double height; + void set_values(int, double); +}; + +void Rectangle::set_values(int x, double y) { + width = x; + height = y; +} + +int main () { + Rectangle rect; + rect.set_values (3,4); + cout << " area: " << rect.area(); + + system("pause"); + return 0; +} From d60602eaaf05415e6077c215bd2c2027ddeca7f6 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Fri, 27 Jan 2017 18:46:49 -0400 Subject: [PATCH 02/47] Added header file --- Student.h | 25 +++++++++++++++++++++++++ take home test .h | 30 ------------------------------ 2 files changed, 25 insertions(+), 30 deletions(-) create mode 100644 Student.h delete mode 100644 take home test .h diff --git a/Student.h b/Student.h new file mode 100644 index 0000000..0148240 --- /dev/null +++ b/Student.h @@ -0,0 +1,25 @@ +#ifndef STUDENT_H +#define STUDENT_H + +#include +#include +using namespace std; + +class Student { + private: + string newName; + char newGrade; + + public: + Student(); + + Student(string, char); + + string getName() const; + char getGrade() const; + + void setName (string); + void setGrade(char); +}; +#endif // !STUDENT_H + diff --git a/take home test .h b/take home test .h deleted file mode 100644 index 49f49da..0000000 --- a/take home test .h +++ /dev/null @@ -1,30 +0,0 @@ - -#include -#include - -using namespace std; - -class Rectangle { -private: - int width; - -public: - int area() { return width*height; } - - double height; - void set_values(int, double); -}; - -void Rectangle::set_values(int x, double y) { - width = x; - height = y; -} - -int main () { - Rectangle rect; - rect.set_values (3,4); - cout << " area: " << rect.area(); - - system("pause"); - return 0; -} From cb313b9b1930ab8c2fa626e749a1e398651bdd8c Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Fri, 27 Jan 2017 18:49:58 -0400 Subject: [PATCH 03/47] Added Student.cpp File --- Student.cpp | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Student.cpp diff --git a/Student.cpp b/Student.cpp new file mode 100644 index 0000000..b81b792 --- /dev/null +++ b/Student.cpp @@ -0,0 +1,64 @@ +#include +#include "Student.h" + + +Student::Student() { + newGrade = ' '; +} + +Student::Student(string name, char grade) { + newName = name; + newGrade = grade; +} + +string Student::getName() const { + return newName; +} + +char Student::getGrade() const { + return newGrade; +} + +void Student::setName(string name) { + newName = name; +} + +void Student::setGrade(char grade) { + newGrade = grade; +} + +void fillVector(vector&); +void printVector(const vector&); + +void fillVector(vector& newClass) { + + string name; + char grade; + + cout << "Please enter the amount of students in class? " << endl; + int numStudents; + cin >> numStudents; + + for (int i = 0; i < numStudents; i++) { + cout << "Please enter Student's Name: "; + cin >> name; + cout << "Please enter Student's Grade: "; + cin >> grade; + + Student newStudent(name, grade); + newClass.push_back(newStudent); + cout << endl; + } + cout << endl; + +} + +void printVector(const vector& newClass) { + for (unsigned int i = 0; i < newClass.size(); i++) { + cout << "Student Name: " << newClass[i].getName() << endl; + cout << "Student Grade: " << newClass[i].getGrade() << endl; + cout << endl; + + } +} + From f4fddbb6caf8ffd14bb467265146931c6db5d0bf Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Fri, 27 Jan 2017 18:50:52 -0400 Subject: [PATCH 04/47] Added Main.cpp file --- Main.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Main.h diff --git a/Main.h b/Main.h new file mode 100644 index 0000000..50bee7b --- /dev/null +++ b/Main.h @@ -0,0 +1,51 @@ +#include +#include +#include +#include "Student.h" + +using namespace std; + + +int main() { + + vector myclass; + + fillVector(myclass); + printVector(myclass); + + system("pause"); + return 0; +} + +void fillVector(vector& newClass) { + + string name; + char grade; + + cout << "Please enter the amount of students in class? " << endl; + int numStudents; + cin >> numStudents; + + for (int i = 0; i < numStudents; i++) { + cout << "Please enter Student's Name: " ; + cin >> name; + cout << "Please enter Student's Grade: " ; + cin >> grade; + + Student newStudent(name, grade); + newClass.push_back(newStudent); + cout << endl; + } + cout << endl; + +} + + +void printVector(const vector& newClass ) { + for (unsigned int i = 0; i < newClass.size(); i++) { + cout << "Student Name: " << newClass[i].getName() << endl; + cout << "Student Grade: " << newClass[i].getGrade() << endl; + cout << endl; + + } +} \ No newline at end of file From 714be5376c2e042fc523c61a7638400169b5fd53 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Fri, 27 Jan 2017 23:25:26 -0400 Subject: [PATCH 05/47] Added header file --- Main.h | 51 ------------------------------------------ Student.cpp | 64 ----------------------------------------------------- 2 files changed, 115 deletions(-) delete mode 100644 Main.h delete mode 100644 Student.cpp diff --git a/Main.h b/Main.h deleted file mode 100644 index 50bee7b..0000000 --- a/Main.h +++ /dev/null @@ -1,51 +0,0 @@ -#include -#include -#include -#include "Student.h" - -using namespace std; - - -int main() { - - vector myclass; - - fillVector(myclass); - printVector(myclass); - - system("pause"); - return 0; -} - -void fillVector(vector& newClass) { - - string name; - char grade; - - cout << "Please enter the amount of students in class? " << endl; - int numStudents; - cin >> numStudents; - - for (int i = 0; i < numStudents; i++) { - cout << "Please enter Student's Name: " ; - cin >> name; - cout << "Please enter Student's Grade: " ; - cin >> grade; - - Student newStudent(name, grade); - newClass.push_back(newStudent); - cout << endl; - } - cout << endl; - -} - - -void printVector(const vector& newClass ) { - for (unsigned int i = 0; i < newClass.size(); i++) { - cout << "Student Name: " << newClass[i].getName() << endl; - cout << "Student Grade: " << newClass[i].getGrade() << endl; - cout << endl; - - } -} \ No newline at end of file diff --git a/Student.cpp b/Student.cpp deleted file mode 100644 index b81b792..0000000 --- a/Student.cpp +++ /dev/null @@ -1,64 +0,0 @@ -#include -#include "Student.h" - - -Student::Student() { - newGrade = ' '; -} - -Student::Student(string name, char grade) { - newName = name; - newGrade = grade; -} - -string Student::getName() const { - return newName; -} - -char Student::getGrade() const { - return newGrade; -} - -void Student::setName(string name) { - newName = name; -} - -void Student::setGrade(char grade) { - newGrade = grade; -} - -void fillVector(vector&); -void printVector(const vector&); - -void fillVector(vector& newClass) { - - string name; - char grade; - - cout << "Please enter the amount of students in class? " << endl; - int numStudents; - cin >> numStudents; - - for (int i = 0; i < numStudents; i++) { - cout << "Please enter Student's Name: "; - cin >> name; - cout << "Please enter Student's Grade: "; - cin >> grade; - - Student newStudent(name, grade); - newClass.push_back(newStudent); - cout << endl; - } - cout << endl; - -} - -void printVector(const vector& newClass) { - for (unsigned int i = 0; i < newClass.size(); i++) { - cout << "Student Name: " << newClass[i].getName() << endl; - cout << "Student Grade: " << newClass[i].getGrade() << endl; - cout << endl; - - } -} - From c1a08bfe96a97a291861b5a13bf7561234e8670b Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Fri, 27 Jan 2017 23:26:49 -0400 Subject: [PATCH 06/47] Added implementation file --- Student.cpp | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Student.cpp diff --git a/Student.cpp b/Student.cpp new file mode 100644 index 0000000..b81b792 --- /dev/null +++ b/Student.cpp @@ -0,0 +1,64 @@ +#include +#include "Student.h" + + +Student::Student() { + newGrade = ' '; +} + +Student::Student(string name, char grade) { + newName = name; + newGrade = grade; +} + +string Student::getName() const { + return newName; +} + +char Student::getGrade() const { + return newGrade; +} + +void Student::setName(string name) { + newName = name; +} + +void Student::setGrade(char grade) { + newGrade = grade; +} + +void fillVector(vector&); +void printVector(const vector&); + +void fillVector(vector& newClass) { + + string name; + char grade; + + cout << "Please enter the amount of students in class? " << endl; + int numStudents; + cin >> numStudents; + + for (int i = 0; i < numStudents; i++) { + cout << "Please enter Student's Name: "; + cin >> name; + cout << "Please enter Student's Grade: "; + cin >> grade; + + Student newStudent(name, grade); + newClass.push_back(newStudent); + cout << endl; + } + cout << endl; + +} + +void printVector(const vector& newClass) { + for (unsigned int i = 0; i < newClass.size(); i++) { + cout << "Student Name: " << newClass[i].getName() << endl; + cout << "Student Grade: " << newClass[i].getGrade() << endl; + cout << endl; + + } +} + From 8cc3d79fb862d08ceb7e1cc36d366e9e7756c4ce Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Fri, 27 Jan 2017 23:27:46 -0400 Subject: [PATCH 07/47] Added client file --- Main.cpp | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Main.cpp diff --git a/Main.cpp b/Main.cpp new file mode 100644 index 0000000..50bee7b --- /dev/null +++ b/Main.cpp @@ -0,0 +1,51 @@ +#include +#include +#include +#include "Student.h" + +using namespace std; + + +int main() { + + vector myclass; + + fillVector(myclass); + printVector(myclass); + + system("pause"); + return 0; +} + +void fillVector(vector& newClass) { + + string name; + char grade; + + cout << "Please enter the amount of students in class? " << endl; + int numStudents; + cin >> numStudents; + + for (int i = 0; i < numStudents; i++) { + cout << "Please enter Student's Name: " ; + cin >> name; + cout << "Please enter Student's Grade: " ; + cin >> grade; + + Student newStudent(name, grade); + newClass.push_back(newStudent); + cout << endl; + } + cout << endl; + +} + + +void printVector(const vector& newClass ) { + for (unsigned int i = 0; i < newClass.size(); i++) { + cout << "Student Name: " << newClass[i].getName() << endl; + cout << "Student Grade: " << newClass[i].getGrade() << endl; + cout << endl; + + } +} \ No newline at end of file From 128ba41525fb4144cb1206bc9e08067cdf1c942e Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 30 Jan 2017 11:23:44 -0400 Subject: [PATCH 08/47] Added header file --- Main.cpp | 51 ------------------------------------------ Student.cpp | 64 ----------------------------------------------------- 2 files changed, 115 deletions(-) delete mode 100644 Main.cpp delete mode 100644 Student.cpp diff --git a/Main.cpp b/Main.cpp deleted file mode 100644 index 50bee7b..0000000 --- a/Main.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include -#include -#include -#include "Student.h" - -using namespace std; - - -int main() { - - vector myclass; - - fillVector(myclass); - printVector(myclass); - - system("pause"); - return 0; -} - -void fillVector(vector& newClass) { - - string name; - char grade; - - cout << "Please enter the amount of students in class? " << endl; - int numStudents; - cin >> numStudents; - - for (int i = 0; i < numStudents; i++) { - cout << "Please enter Student's Name: " ; - cin >> name; - cout << "Please enter Student's Grade: " ; - cin >> grade; - - Student newStudent(name, grade); - newClass.push_back(newStudent); - cout << endl; - } - cout << endl; - -} - - -void printVector(const vector& newClass ) { - for (unsigned int i = 0; i < newClass.size(); i++) { - cout << "Student Name: " << newClass[i].getName() << endl; - cout << "Student Grade: " << newClass[i].getGrade() << endl; - cout << endl; - - } -} \ No newline at end of file diff --git a/Student.cpp b/Student.cpp deleted file mode 100644 index b81b792..0000000 --- a/Student.cpp +++ /dev/null @@ -1,64 +0,0 @@ -#include -#include "Student.h" - - -Student::Student() { - newGrade = ' '; -} - -Student::Student(string name, char grade) { - newName = name; - newGrade = grade; -} - -string Student::getName() const { - return newName; -} - -char Student::getGrade() const { - return newGrade; -} - -void Student::setName(string name) { - newName = name; -} - -void Student::setGrade(char grade) { - newGrade = grade; -} - -void fillVector(vector&); -void printVector(const vector&); - -void fillVector(vector& newClass) { - - string name; - char grade; - - cout << "Please enter the amount of students in class? " << endl; - int numStudents; - cin >> numStudents; - - for (int i = 0; i < numStudents; i++) { - cout << "Please enter Student's Name: "; - cin >> name; - cout << "Please enter Student's Grade: "; - cin >> grade; - - Student newStudent(name, grade); - newClass.push_back(newStudent); - cout << endl; - } - cout << endl; - -} - -void printVector(const vector& newClass) { - for (unsigned int i = 0; i < newClass.size(); i++) { - cout << "Student Name: " << newClass[i].getName() << endl; - cout << "Student Grade: " << newClass[i].getGrade() << endl; - cout << endl; - - } -} - From 11e994d226c66be1ac68dbb29953bcea11090194 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 30 Jan 2017 11:25:17 -0400 Subject: [PATCH 09/47] Added Implementation file --- Student.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Student.cpp diff --git a/Student.cpp b/Student.cpp new file mode 100644 index 0000000..b66aa1d --- /dev/null +++ b/Student.cpp @@ -0,0 +1,32 @@ +#include +#include "Student.h" + + +Student::Student() { + newGrade = ' '; +} + +Student::Student(string name, char grade) { + newName = name; + newGrade = grade; +} + +string Student::getName() const { + return newName; +} + +char Student::getGrade() const { + return newGrade; +} + +void Student::setName(string name) { + newName = name; +} + +void Student::setGrade(char grade) { + newGrade = grade; +} + + + + From 6f13c159bf5681b9c3f454ab8dae673c12a97fa9 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 30 Jan 2017 11:26:02 -0400 Subject: [PATCH 10/47] Added client file --- Main.cpp | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Main.cpp diff --git a/Main.cpp b/Main.cpp new file mode 100644 index 0000000..fcc237c --- /dev/null +++ b/Main.cpp @@ -0,0 +1,53 @@ +#include +#include +#include +#include "Student.h" + +using namespace std; + +void fillVector(vector newClass) ; +void printVector(const vector newClass); + +int main() { + + vector myclass; + + fillVector(myclass); + printVector(myclass) ; + + + return 0; + +} + +void fillVector(vector newClass) { + + string name; + char grade; + + cout << "Please enter the amount of students in class? " << endl; + int numStudents; + cin >> numStudents; + + for (int i = 0; i < numStudents; i++) { + cout << "Please enter Student's Name: "; + cin >> name; + cout << "Please enter Student's Grade: "; + cin >> grade; + + Student newStudent(name, grade); + newClass.push_back(newStudent); + cout << endl; + } + cout << endl; + +} + +void printVector(const vector newClass) { + for (unsigned int i = 0; i < newClass.size(); i++) { + cout << "Student Name: " << newClass[i].getName() << endl; + cout << "Student Grade: " << newClass[i].getGrade() << endl; + cout << endl; + + } +} \ No newline at end of file From 4b39924790ab3c67aaca6f8f9bf0d89ba4b63b93 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Sun, 5 Feb 2017 19:53:41 -0400 Subject: [PATCH 11/47] Updated client file --- Main.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Main.cpp b/Main.cpp index fcc237c..9272214 100644 --- a/Main.cpp +++ b/Main.cpp @@ -7,19 +7,34 @@ using namespace std; void fillVector(vector newClass) ; void printVector(const vector newClass); +int linearSearch(vector newClass, auto key); int main() { vector myclass; - + fillVector(myclass); printVector(myclass) ; - + linearSearch(myclass, key); return 0; } +int linearSearch(vector newClass, auto key) + { + string key; + for(int i = 0; i < newClass.size(); i ++) + { + if (newClass[i] == key)//we found it + { + return i;//return its location + } + }//end for + return -1;//element not found + } + + void fillVector(vector newClass) { string name; From b8ec00743f6a7c87eb23f2b3f1dc0884a2ca56b2 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 6 Feb 2017 10:57:21 -0400 Subject: [PATCH 12/47] Updated Client file --- Main.cpp | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Main.cpp b/Main.cpp index 9272214..e3cdabc 100644 --- a/Main.cpp +++ b/Main.cpp @@ -7,15 +7,29 @@ using namespace std; void fillVector(vector newClass) ; void printVector(const vector newClass); -int linearSearch(vector newClass, auto key); +int linearSearch(vector myclass, auto key); int main() { - + + string result; + vector myclass; - fillVector(myclass); - printVector(myclass) ; - linearSearch(myclass, key); + + + cout << "Please enter the name of the student you would like to search" << endl; + cin >> name; + while(name != "#") + { + result = linearSearch(myclass, name); + cout << " " << name << "was "; + if (result == .1) + cout << " not found"; + else + cout << " found" << result; + } + + return 0; From 3db4f1ea2eec6582d9c80487ade2f3fccf902f52 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 6 Feb 2017 11:01:19 -0400 Subject: [PATCH 13/47] Updated Client File --- Main.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Main.cpp b/Main.cpp index e3cdabc..e899dec 100644 --- a/Main.cpp +++ b/Main.cpp @@ -7,7 +7,7 @@ using namespace std; void fillVector(vector newClass) ; void printVector(const vector newClass); -int linearSearch(vector myclass, auto key); +string linearSearch(vector newClass, auto key); int main() { @@ -16,7 +16,6 @@ int main() { vector myclass; - cout << "Please enter the name of the student you would like to search" << endl; cin >> name; while(name != "#") @@ -35,7 +34,7 @@ int main() { } -int linearSearch(vector newClass, auto key) +string linearSearch(vector newClass, auto key) { string key; for(int i = 0; i < newClass.size(); i ++) From e6cd00d957eb4e10e637d0c2cb6a869ed80448a3 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 6 Feb 2017 11:03:31 -0400 Subject: [PATCH 14/47] Updated Client File --- Main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main.cpp b/Main.cpp index e899dec..9868641 100644 --- a/Main.cpp +++ b/Main.cpp @@ -7,7 +7,7 @@ using namespace std; void fillVector(vector newClass) ; void printVector(const vector newClass); -string linearSearch(vector newClass, auto key); +string linearSearch(const vector newClass, auto name); int main() { From 72874587afe5cfd97655caa907ec54041e2ef7fd Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 6 Feb 2017 11:06:42 -0400 Subject: [PATCH 15/47] Updated Client File --- Main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Main.cpp b/Main.cpp index 9868641..3e583cf 100644 --- a/Main.cpp +++ b/Main.cpp @@ -7,7 +7,7 @@ using namespace std; void fillVector(vector newClass) ; void printVector(const vector newClass); -string linearSearch(const vector newClass, auto name); +int linearSearch(vector newClass, auto key); int main() { @@ -15,6 +15,8 @@ int main() { vector myclass; + fillVector(myclass); + printVector(myclass) ; cout << "Please enter the name of the student you would like to search" << endl; cin >> name; @@ -34,7 +36,7 @@ int main() { } -string linearSearch(vector newClass, auto key) +int linearSearch(vector newClass, auto key) { string key; for(int i = 0; i < newClass.size(); i ++) From 53aa65b2a038a7e9fe14b44f0ff76479568c2036 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 6 Feb 2017 11:09:34 -0400 Subject: [PATCH 16/47] Updted Client File --- Main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main.cpp b/Main.cpp index 3e583cf..a7fe04e 100644 --- a/Main.cpp +++ b/Main.cpp @@ -16,7 +16,7 @@ int main() { vector myclass; fillVector(myclass); - printVector(myclass) ; + cout << "Please enter the name of the student you would like to search" << endl; cin >> name; From b8dd880842726cb0988145755ff0693ad3607257 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 6 Feb 2017 11:19:31 -0400 Subject: [PATCH 17/47] Updated Client File --- Main.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Main.cpp b/Main.cpp index a7fe04e..affbea4 100644 --- a/Main.cpp +++ b/Main.cpp @@ -7,23 +7,24 @@ using namespace std; void fillVector(vector newClass) ; void printVector(const vector newClass); -int linearSearch(vector newClass, auto key); + int main() { string result; + string key; vector myclass; fillVector(myclass); - + printVector(myclass); cout << "Please enter the name of the student you would like to search" << endl; cin >> name; while(name != "#") { - result = linearSearch(myclass, name); - cout << " " << name << "was "; + result = linearSearch(myclass, key); + cout << " " << key << "was "; if (result == .1) cout << " not found"; else @@ -36,12 +37,12 @@ int main() { } -int linearSearch(vector newClass, auto key) +int linearSearch(vector newClass, string name) { - string key; + for(int i = 0; i < newClass.size(); i ++) { - if (newClass[i] == key)//we found it + if (newClass[i] == name)//we found it { return i;//return its location } From 7d374f138ba5c60e6fd1825edd50898bc6a74658 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 6 Feb 2017 11:28:07 -0400 Subject: [PATCH 18/47] Updated Client File --- Main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Main.cpp b/Main.cpp index affbea4..ba512f2 100644 --- a/Main.cpp +++ b/Main.cpp @@ -21,9 +21,10 @@ int main() { cout << "Please enter the name of the student you would like to search" << endl; cin >> name; + while(name != "#") { - result = linearSearch(myclass, key); + result = linearSearch(myclass, name); cout << " " << key << "was "; if (result == .1) cout << " not found"; From 1280a9a26b7e1d7ec1f8db464ab043eba3d107bf Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 6 Feb 2017 11:31:14 -0400 Subject: [PATCH 19/47] Updated Client File --- Main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Main.cpp b/Main.cpp index ba512f2..a187ef0 100644 --- a/Main.cpp +++ b/Main.cpp @@ -7,12 +7,13 @@ using namespace std; void fillVector(vector newClass) ; void printVector(const vector newClass); - +int linearSearch(vector newClass, string name) int main() { string result; string key; + string name; vector myclass; From 49c4f9cae09758bf83e720ce061be0004a764529 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 6 Feb 2017 11:32:53 -0400 Subject: [PATCH 20/47] Updated Client File --- Main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Main.cpp b/Main.cpp index a187ef0..db64356 100644 --- a/Main.cpp +++ b/Main.cpp @@ -7,7 +7,7 @@ using namespace std; void fillVector(vector newClass) ; void printVector(const vector newClass); -int linearSearch(vector newClass, string name) +string linearSearch(vector newClass, string name) int main() { @@ -39,7 +39,7 @@ int main() { } -int linearSearch(vector newClass, string name) +string linearSearch(vector newClass, string name) { for(int i = 0; i < newClass.size(); i ++) From 05dfed5c14116310a2a478169f801dec040b8c80 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 6 Feb 2017 11:34:02 -0400 Subject: [PATCH 21/47] Updated Client FIle --- Main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main.cpp b/Main.cpp index db64356..1c0918f 100644 --- a/Main.cpp +++ b/Main.cpp @@ -7,7 +7,7 @@ using namespace std; void fillVector(vector newClass) ; void printVector(const vector newClass); -string linearSearch(vector newClass, string name) +void linearSearch(vector newClass, string name) int main() { From 71ad85b4ed258f313540de63f55ff12252721ca1 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 6 Feb 2017 11:35:31 -0400 Subject: [PATCH 22/47] Updated Client File --- Main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Main.cpp b/Main.cpp index 1c0918f..dfd58c7 100644 --- a/Main.cpp +++ b/Main.cpp @@ -7,10 +7,12 @@ using namespace std; void fillVector(vector newClass) ; void printVector(const vector newClass); -void linearSearch(vector newClass, string name) + int main() { + int linearSearch(vector newClass, string name) + string result; string key; string name; @@ -39,7 +41,7 @@ int main() { } -string linearSearch(vector newClass, string name) +int linearSearch(vector newClass, string name) { for(int i = 0; i < newClass.size(); i ++) From 4a55aa03202775a0bbd88c6f90c56299ef2280d2 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 6 Feb 2017 11:37:08 -0400 Subject: [PATCH 23/47] Updated Client File --- Main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Main.cpp b/Main.cpp index dfd58c7..407b7f9 100644 --- a/Main.cpp +++ b/Main.cpp @@ -7,11 +7,11 @@ using namespace std; void fillVector(vector newClass) ; void printVector(const vector newClass); +int linearSearch(vector newClass, string name) - -int main() { +void main() { + - int linearSearch(vector newClass, string name) string result; string key; @@ -37,7 +37,7 @@ int main() { - return 0; + return ; } From b5f9b7a2fb47c1b3d34b29e13a2011e4398c34d2 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 6 Feb 2017 11:39:12 -0400 Subject: [PATCH 24/47] Updated Client File --- Main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Main.cpp b/Main.cpp index 407b7f9..6788882 100644 --- a/Main.cpp +++ b/Main.cpp @@ -9,7 +9,7 @@ void fillVector(vector newClass) ; void printVector(const vector newClass); int linearSearch(vector newClass, string name) -void main() { +int main() { @@ -37,7 +37,7 @@ void main() { - return ; + return 0; } From 646f0cc413dfb436260b8a9e09520b62c8e955e2 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 6 Feb 2017 11:40:21 -0400 Subject: [PATCH 25/47] Updated Client File --- Main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main.cpp b/Main.cpp index 6788882..10e28b6 100644 --- a/Main.cpp +++ b/Main.cpp @@ -7,7 +7,7 @@ using namespace std; void fillVector(vector newClass) ; void printVector(const vector newClass); -int linearSearch(vector newClass, string name) +int linearSearch(vector newClass, string name); int main() { From e6412840176c3a65d8038f84ce9ef41f82f00760 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 6 Feb 2017 11:41:40 -0400 Subject: [PATCH 26/47] Updated Client File --- Main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main.cpp b/Main.cpp index 10e28b6..a8ef241 100644 --- a/Main.cpp +++ b/Main.cpp @@ -46,7 +46,7 @@ int linearSearch(vector newClass, string name) for(int i = 0; i < newClass.size(); i ++) { - if (newClass[i] == name)//we found it + if (newClass[i] = = name)//we found it { return i;//return its location } From 4150224aaa7496efc8a8f809a34ba7231151e8fc Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 6 Feb 2017 11:42:11 -0400 Subject: [PATCH 27/47] Updated Client File --- Main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main.cpp b/Main.cpp index a8ef241..10e28b6 100644 --- a/Main.cpp +++ b/Main.cpp @@ -46,7 +46,7 @@ int linearSearch(vector newClass, string name) for(int i = 0; i < newClass.size(); i ++) { - if (newClass[i] = = name)//we found it + if (newClass[i] == name)//we found it { return i;//return its location } From 64a15843e7de45f83b8bd0cc478e3facee632701 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 6 Feb 2017 11:46:50 -0400 Subject: [PATCH 28/47] Updated Client File --- Main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Main.cpp b/Main.cpp index 10e28b6..635bb34 100644 --- a/Main.cpp +++ b/Main.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include "Student.h" @@ -29,7 +30,7 @@ int main() { { result = linearSearch(myclass, name); cout << " " << key << "was "; - if (result == .1) + if (result == ".1") cout << " not found"; else cout << " found" << result; From 5e0c588ccd1fcae55b1c2208f1869b517ba2527a Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 6 Feb 2017 11:47:21 -0400 Subject: [PATCH 29/47] Updated Client FIle --- Main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Main.cpp b/Main.cpp index 635bb34..b8de1f1 100644 --- a/Main.cpp +++ b/Main.cpp @@ -1,5 +1,4 @@ #include -#include #include #include #include "Student.h" From acc5c3259436e79f7542bf79cc5bcd4273673b59 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 6 Feb 2017 11:48:32 -0400 Subject: [PATCH 30/47] Updated Client File --- Main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main.cpp b/Main.cpp index b8de1f1..30a6a01 100644 --- a/Main.cpp +++ b/Main.cpp @@ -29,7 +29,7 @@ int main() { { result = linearSearch(myclass, name); cout << " " << key << "was "; - if (result == ".1") + if (result != name) cout << " not found"; else cout << " found" << result; From 88563bde87e255c003f4bee79912d53dff378326 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 6 Feb 2017 11:49:43 -0400 Subject: [PATCH 31/47] Updated Client File --- Main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Main.cpp b/Main.cpp index 30a6a01..7968763 100644 --- a/Main.cpp +++ b/Main.cpp @@ -29,7 +29,7 @@ int main() { { result = linearSearch(myclass, name); cout << " " << key << "was "; - if (result != name) + if (result == .1) cout << " not found"; else cout << " found" << result; @@ -46,7 +46,7 @@ int linearSearch(vector newClass, string name) for(int i = 0; i < newClass.size(); i ++) { - if (newClass[i] == name)//we found it + if (newClass[i] == "name")//we found it { return i;//return its location } From 2858b13ac031eed476e82f4adb85cf58cde9dd4e Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 6 Feb 2017 11:55:33 -0400 Subject: [PATCH 32/47] Updted Client FIle --- Main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main.cpp b/Main.cpp index 7968763..0057b88 100644 --- a/Main.cpp +++ b/Main.cpp @@ -46,7 +46,7 @@ int linearSearch(vector newClass, string name) for(int i = 0; i < newClass.size(); i ++) { - if (newClass[i] == "name")//we found it + if ( "newClass[i]" == "name")//we found it { return i;//return its location } From fd3f5e1bf67ffaf7b56cc7ff3b096dce52855b02 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 6 Feb 2017 11:56:39 -0400 Subject: [PATCH 33/47] Updated Client FIle --- Main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Main.cpp b/Main.cpp index 0057b88..088fde7 100644 --- a/Main.cpp +++ b/Main.cpp @@ -29,7 +29,7 @@ int main() { { result = linearSearch(myclass, name); cout << " " << key << "was "; - if (result == .1) + if ( result == .1 ) cout << " not found"; else cout << " found" << result; @@ -46,7 +46,7 @@ int linearSearch(vector newClass, string name) for(int i = 0; i < newClass.size(); i ++) { - if ( "newClass[i]" == "name")//we found it + if ( newClass[i] == name )//we found it { return i;//return its location } From 0d331985aceec2a29da3b63730c5fd0cdc9fe86f Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Sun, 12 Feb 2017 20:49:25 -0400 Subject: [PATCH 34/47] Updated Client File --- Main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main.cpp b/Main.cpp index 088fde7..f6c05d9 100644 --- a/Main.cpp +++ b/Main.cpp @@ -46,7 +46,7 @@ int linearSearch(vector newClass, string name) for(int i = 0; i < newClass.size(); i ++) { - if ( newClass[i] == name )//we found it + if ( newClass[i] == "name" )//we found it { return i;//return its location } From c5b2f1db6edbfc5997f9da2d004b569ae8e929f4 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Sun, 12 Feb 2017 20:50:28 -0400 Subject: [PATCH 35/47] Updated Client File --- Main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main.cpp b/Main.cpp index f6c05d9..088fde7 100644 --- a/Main.cpp +++ b/Main.cpp @@ -46,7 +46,7 @@ int linearSearch(vector newClass, string name) for(int i = 0; i < newClass.size(); i ++) { - if ( newClass[i] == "name" )//we found it + if ( newClass[i] == name )//we found it { return i;//return its location } From 6a1878ead46fafcbb49fe9abec811cd110b8b9c8 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 13 Feb 2017 10:30:30 -0400 Subject: [PATCH 36/47] Updated Client File --- Main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main.cpp b/Main.cpp index 088fde7..5a1c94d 100644 --- a/Main.cpp +++ b/Main.cpp @@ -46,7 +46,7 @@ int linearSearch(vector newClass, string name) for(int i = 0; i < newClass.size(); i ++) { - if ( newClass[i] == name )//we found it + if ( newClass[i].getName == name )//we found it { return i;//return its location } From 9cd74302d4c74e32cae82a9ea4f49b388e9cfce7 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 13 Feb 2017 10:31:34 -0400 Subject: [PATCH 37/47] Updated Client File --- Main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main.cpp b/Main.cpp index 5a1c94d..20041cb 100644 --- a/Main.cpp +++ b/Main.cpp @@ -46,7 +46,7 @@ int linearSearch(vector newClass, string name) for(int i = 0; i < newClass.size(); i ++) { - if ( newClass[i].getName == name )//we found it + if ( newClass[i].getName() == name )//we found it { return i;//return its location } From 4b2e8bf2f37dc6e8c713218d6eee53cea4d595e0 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 13 Feb 2017 10:32:29 -0400 Subject: [PATCH 38/47] Updated Client File --- Main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main.cpp b/Main.cpp index 20041cb..88f02bb 100644 --- a/Main.cpp +++ b/Main.cpp @@ -29,7 +29,7 @@ int main() { { result = linearSearch(myclass, name); cout << " " << key << "was "; - if ( result == .1 ) + if ( result != name ) cout << " not found"; else cout << " found" << result; From b93331614c578e291814fdc3d4a5970c7fdbd2e2 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 13 Feb 2017 10:34:26 -0400 Subject: [PATCH 39/47] Updated Client File --- Main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main.cpp b/Main.cpp index 88f02bb..16e184a 100644 --- a/Main.cpp +++ b/Main.cpp @@ -29,7 +29,7 @@ int main() { { result = linearSearch(myclass, name); cout << " " << key << "was "; - if ( result != name ) + if ( result == -1 ) cout << " not found"; else cout << " found" << result; From bf5daa08e8a02bcf7051ac2292e3f21e6e51386c Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 13 Feb 2017 10:36:58 -0400 Subject: [PATCH 40/47] Updated Client File --- Main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Main.cpp b/Main.cpp index 16e184a..4f8cb7f 100644 --- a/Main.cpp +++ b/Main.cpp @@ -29,10 +29,10 @@ int main() { { result = linearSearch(myclass, name); cout << " " << key << "was "; - if ( result == -1 ) - cout << " not found"; + if ( result == name ) + cout << " found"; else - cout << " found" << result; + cout << " not found" << result; } From 00cc3957fce22933616f794bfcf2701dc88bb3a7 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 13 Feb 2017 10:43:02 -0400 Subject: [PATCH 41/47] Updated Client File --- Main.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Main.cpp b/Main.cpp index 4f8cb7f..fe075d3 100644 --- a/Main.cpp +++ b/Main.cpp @@ -16,27 +16,30 @@ int main() { string result; string key; string name; - + char choice; vector myclass; fillVector(myclass); printVector(myclass); - cout << "Please enter the name of the student you would like to search" << endl; - cin >> name; + cout << "Would you like to search for a student? y = yes , n = no" << endl; + cin >> choice; + + - while(name != "#") + while(choice == 'y') { + cout << "Please enter the name of the student you would like to search" << endl; + cin >> name; + result = linearSearch(myclass, name); - cout << " " << key << "was "; + cout << " " << name << "was "; if ( result == name ) cout << " found"; else cout << " not found" << result; } - - return 0; } From 813fceb243dd90f881ccbc29ecf492095947ca73 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 13 Feb 2017 10:45:46 -0400 Subject: [PATCH 42/47] Updated Client File --- Main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main.cpp b/Main.cpp index fe075d3..bc8587e 100644 --- a/Main.cpp +++ b/Main.cpp @@ -51,7 +51,7 @@ int linearSearch(vector newClass, string name) { if ( newClass[i].getName() == name )//we found it { - return i;//return its location + return name;//return its location } }//end for return -1;//element not found From f0ebfae9ca5e5b543ac07cf1afc02378b9b97a3a Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 13 Feb 2017 10:46:44 -0400 Subject: [PATCH 43/47] Updated Client File --- Main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Main.cpp b/Main.cpp index bc8587e..a1feed6 100644 --- a/Main.cpp +++ b/Main.cpp @@ -7,7 +7,7 @@ using namespace std; void fillVector(vector newClass) ; void printVector(const vector newClass); -int linearSearch(vector newClass, string name); +string linearSearch(vector newClass, string name); int main() { @@ -44,7 +44,7 @@ int main() { } -int linearSearch(vector newClass, string name) +string linearSearch(vector newClass, string name) { for(int i = 0; i < newClass.size(); i ++) From 2025e5ff46787d29ad7894d1cb09b1b06753b3a9 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 13 Feb 2017 10:47:25 -0400 Subject: [PATCH 44/47] Updated Client FIle --- Main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main.cpp b/Main.cpp index a1feed6..7ab88c2 100644 --- a/Main.cpp +++ b/Main.cpp @@ -54,7 +54,7 @@ string linearSearch(vector newClass, string name) return name;//return its location } }//end for - return -1;//element not found + return "error";//element not found } From 91e4a6c8169681e3b6c1b0ced871c787c833ab7f Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 13 Feb 2017 10:49:21 -0400 Subject: [PATCH 45/47] Updated Client File --- Main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Main.cpp b/Main.cpp index 7ab88c2..fe075d3 100644 --- a/Main.cpp +++ b/Main.cpp @@ -7,7 +7,7 @@ using namespace std; void fillVector(vector newClass) ; void printVector(const vector newClass); -string linearSearch(vector newClass, string name); +int linearSearch(vector newClass, string name); int main() { @@ -44,17 +44,17 @@ int main() { } -string linearSearch(vector newClass, string name) +int linearSearch(vector newClass, string name) { for(int i = 0; i < newClass.size(); i ++) { if ( newClass[i].getName() == name )//we found it { - return name;//return its location + return i;//return its location } }//end for - return "error";//element not found + return -1;//element not found } From 31445a6c4a3ff1ebcb94d8c2456792dc23922874 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 13 Feb 2017 10:51:23 -0400 Subject: [PATCH 46/47] Updated Client File --- Main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Main.cpp b/Main.cpp index fe075d3..b6cf811 100644 --- a/Main.cpp +++ b/Main.cpp @@ -34,10 +34,13 @@ int main() { result = linearSearch(myclass, name); cout << " " << name << "was "; - if ( result == name ) + if ( result == i ) cout << " found"; else cout << " not found" << result; + + cout << "Would you like to search for a student? y = yes , n = no" << endl; + cin >> choice; } return 0; From 7a8a3ee31192721705266b113d6cd70af3397713 Mon Sep 17 00:00:00 2001 From: WarSloth21 Date: Mon, 13 Feb 2017 10:56:31 -0400 Subject: [PATCH 47/47] Updated Client FIle --- Main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main.cpp b/Main.cpp index b6cf811..13f59e3 100644 --- a/Main.cpp +++ b/Main.cpp @@ -34,7 +34,7 @@ int main() { result = linearSearch(myclass, name); cout << " " << name << "was "; - if ( result == i ) + if ( result == name ) cout << " found"; else cout << " not found" << result;