diff --git a/Grade b/Grade new file mode 100755 index 0000000..aef4d51 Binary files /dev/null and b/Grade differ diff --git a/MySearch b/MySearch new file mode 100755 index 0000000..b0d91be Binary files /dev/null and b/MySearch differ diff --git a/class.h b/class.h new file mode 100644 index 0000000..6b361ce --- /dev/null +++ b/class.h @@ -0,0 +1,25 @@ +#ifndef CLASS_H +#define CLASS_H +#include +#include +using namespace std; + +class Class +{ + private : + string name; + int grade; + + public : + Class (); + + void setName (string); + + void setGrade (int); + + string getName (); + + int getGrade (); +}; + +#endif diff --git a/client.cpp b/client.cpp new file mode 100644 index 0000000..568fb83 --- /dev/null +++ b/client.cpp @@ -0,0 +1,68 @@ +#include +#include "myclass.cpp" +#include +#include +using namespace std; + +int linearSearch(auto data, auto key); + +int main () +{ + string name = ""; + string search_key; + //int grade (0); + int result = 0; + vector Student (8); + + for (int i = 0; i0) + { + cin.ignore(); + }*/ + cout << "Please enter the name: "; + getline (cin, name); + Student[i].setName(name); + /*cout << "Please enter the grade: "; + cin >> grade; + while ((grade<0) || (grade>100)) + { + cout << "Please enter a value between 0 and 100: "; + cin >> grade; + } + Student[i].setGrade(grade);*/ + } + + cout<> search_key; + + result = linearSearch(Student, search_key); + cout<<" '"< +#include "class.h" +#include +using namespace std; + +Class::Class () +{ + name = " "; + grade = 0; +} + +void Class::setName (string className) +{ + name = className; +} + +void Class::setGrade (int classGrade) +{ + grade = classGrade; +} + +string Class::getName () +{ + return name; +} + +int Class::getGrade () +{ + return grade; +} +