From a0df1feaa33ca577b1572fa0436828775b700fa3 Mon Sep 17 00:00:00 2001 From: Shanice98 Date: Sat, 28 Jan 2017 18:52:14 -0400 Subject: [PATCH 01/10] home_test --- home test | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 home test diff --git a/home test b/home test new file mode 100644 index 0000000..1372cc5 --- /dev/null +++ b/home test @@ -0,0 +1,30 @@ +#include +#include +using namespace std; + +class food{ + private: + int num-of_dishes; + string dish_type; + + void set_type_name(string dish) + { + dish_type=dish; + } + + void set_dish_num(int num) + { + dnum_of_dishes=num; + } + + string get_type_name() + { + return dish_type; + } + + int get_dish_num() + { + return num-of_dishes; + } +};//class + From 1ce4ec01972edfcb177a76df72d639b4f1a2ec8e Mon Sep 17 00:00:00 2001 From: Shanice98 Date: Sun, 29 Jan 2017 15:26:53 -0400 Subject: [PATCH 02/10] home_test --- home test | 33 ++++++++++++--------------------- home_test | 30 ++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 21 deletions(-) create mode 100644 home_test diff --git a/home test b/home test index 1372cc5..19ca64a 100644 --- a/home test +++ b/home test @@ -1,30 +1,21 @@ +#ifndef CUISINE_H +#define CUISINE_H #include #include using namespace std; -class food{ +class cuisine{ private: int num-of_dishes; - string dish_type; + std::string dish_type; - void set_type_name(string dish) - { - dish_type=dish; - } - - void set_dish_num(int num) - { - dnum_of_dishes=num; - } + void set_type_name(string dish); - string get_type_name() - { - return dish_type; - } - - int get_dish_num() - { - return num-of_dishes; - } + void set_dish_num(int num); + + std::string get_type_name(); + + int get_dish_num(): + };//class - +#endif diff --git a/home_test b/home_test new file mode 100644 index 0000000..1372cc5 --- /dev/null +++ b/home_test @@ -0,0 +1,30 @@ +#include +#include +using namespace std; + +class food{ + private: + int num-of_dishes; + string dish_type; + + void set_type_name(string dish) + { + dish_type=dish; + } + + void set_dish_num(int num) + { + dnum_of_dishes=num; + } + + string get_type_name() + { + return dish_type; + } + + int get_dish_num() + { + return num-of_dishes; + } +};//class + From 58b88b2abdf69ba78a8f074d33da60d9624fddf3 Mon Sep 17 00:00:00 2001 From: Shanice98 Date: Sun, 29 Jan 2017 15:29:16 -0400 Subject: [PATCH 03/10] Delete home_test --- home_test | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 home_test diff --git a/home_test b/home_test deleted file mode 100644 index 1372cc5..0000000 --- a/home_test +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include -using namespace std; - -class food{ - private: - int num-of_dishes; - string dish_type; - - void set_type_name(string dish) - { - dish_type=dish; - } - - void set_dish_num(int num) - { - dnum_of_dishes=num; - } - - string get_type_name() - { - return dish_type; - } - - int get_dish_num() - { - return num-of_dishes; - } -};//class - From 14c82523f75ca8ce428704b4146595b6919b45c8 Mon Sep 17 00:00:00 2001 From: Shanice98 Date: Sun, 29 Jan 2017 16:06:56 -0400 Subject: [PATCH 04/10] implementation file --- implementation file | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 implementation file diff --git a/implementation file b/implementation file new file mode 100644 index 0000000..0659aa7 --- /dev/null +++ b/implementation file @@ -0,0 +1,24 @@ +#include +#include +#include"cuisine.h" +using namespace std; +void set_type_name(std::string dish) +{ + dish_type=dish; +} + +void set_dish_num(int num) +{ + num_of_dishes=num; +} + +std::string get_type_name(std::string dish) +{ + return dish_type; +} + +int get_dish_num(int num) +{ + return num_of_dishes; +} + From aed5518d158e52f744b7b4890044f2fa8c22dae5 Mon Sep 17 00:00:00 2001 From: Shanice98 Date: Sun, 29 Jan 2017 18:27:33 -0400 Subject: [PATCH 05/10] Delete home test --- home test | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 home test diff --git a/home test b/home test deleted file mode 100644 index 19ca64a..0000000 --- a/home test +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef CUISINE_H -#define CUISINE_H -#include -#include -using namespace std; - -class cuisine{ - private: - int num-of_dishes; - std::string dish_type; - - void set_type_name(string dish); - - void set_dish_num(int num); - - std::string get_type_name(); - - int get_dish_num(): - -};//class -#endif From 58fa8842e0824ac064f785cf06696f6787b2f317 Mon Sep 17 00:00:00 2001 From: Shanice98 Date: Sun, 29 Jan 2017 18:33:25 -0400 Subject: [PATCH 06/10] cuisine.h --- client file | 36 ++++++++++++++++++++++++++++++++++++ home test => cuisine.h | 0 cuisineIm.cpp | 24 ++++++++++++++++++++++++ cuisinedriver.cpp | 36 ++++++++++++++++++++++++++++++++++++ home_test | 30 ------------------------------ 5 files changed, 96 insertions(+), 30 deletions(-) create mode 100644 client file rename home test => cuisine.h (100%) create mode 100644 cuisineIm.cpp create mode 100644 cuisinedriver.cpp delete mode 100644 home_test diff --git a/client file b/client file new file mode 100644 index 0000000..6d3b3ed --- /dev/null +++ b/client file @@ -0,0 +1,36 @@ +#include +#include +#include +#include "cuisine.h" +using namespace std; + +int main() +{ + sting dish; + + int num; + + vector restaurant; + + for(int i=0;i<4;i++) + { + + cout << "Please enter the type of cuisine and the number of dishes you have of this cuisine." + + cin >> dish >> num; + + restaurant[i].set_type_name(dish); + + restaurant[i].set_dish_num(num); + } + + for(int i=0;i<4;i++) + { + cout << client[i].get_type_name() << ":" << client[i].get_dish_num() << endl; + } + + return 0; + +} + + diff --git a/home test b/cuisine.h similarity index 100% rename from home test rename to cuisine.h diff --git a/cuisineIm.cpp b/cuisineIm.cpp new file mode 100644 index 0000000..0659aa7 --- /dev/null +++ b/cuisineIm.cpp @@ -0,0 +1,24 @@ +#include +#include +#include"cuisine.h" +using namespace std; +void set_type_name(std::string dish) +{ + dish_type=dish; +} + +void set_dish_num(int num) +{ + num_of_dishes=num; +} + +std::string get_type_name(std::string dish) +{ + return dish_type; +} + +int get_dish_num(int num) +{ + return num_of_dishes; +} + diff --git a/cuisinedriver.cpp b/cuisinedriver.cpp new file mode 100644 index 0000000..6d3b3ed --- /dev/null +++ b/cuisinedriver.cpp @@ -0,0 +1,36 @@ +#include +#include +#include +#include "cuisine.h" +using namespace std; + +int main() +{ + sting dish; + + int num; + + vector restaurant; + + for(int i=0;i<4;i++) + { + + cout << "Please enter the type of cuisine and the number of dishes you have of this cuisine." + + cin >> dish >> num; + + restaurant[i].set_type_name(dish); + + restaurant[i].set_dish_num(num); + } + + for(int i=0;i<4;i++) + { + cout << client[i].get_type_name() << ":" << client[i].get_dish_num() << endl; + } + + return 0; + +} + + diff --git a/home_test b/home_test deleted file mode 100644 index 1372cc5..0000000 --- a/home_test +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include -using namespace std; - -class food{ - private: - int num-of_dishes; - string dish_type; - - void set_type_name(string dish) - { - dish_type=dish; - } - - void set_dish_num(int num) - { - dnum_of_dishes=num; - } - - string get_type_name() - { - return dish_type; - } - - int get_dish_num() - { - return num-of_dishes; - } -};//class - From 33741cf8e3115849940340f62de29c47ba656f92 Mon Sep 17 00:00:00 2001 From: Shanice98 Date: Sun, 29 Jan 2017 20:33:39 -0400 Subject: [PATCH 07/10] cuisineIm.cpp --- client file | 36 ------------------------------------ cuisine.h | 6 ++++-- cuisineIm.cpp | 14 ++++++++++---- cuisinedriver.cpp | 23 +++++++++++++++++------ implementation file | 24 ------------------------ 5 files changed, 31 insertions(+), 72 deletions(-) delete mode 100644 client file delete mode 100644 implementation file diff --git a/client file b/client file deleted file mode 100644 index 6d3b3ed..0000000 --- a/client file +++ /dev/null @@ -1,36 +0,0 @@ -#include -#include -#include -#include "cuisine.h" -using namespace std; - -int main() -{ - sting dish; - - int num; - - vector restaurant; - - for(int i=0;i<4;i++) - { - - cout << "Please enter the type of cuisine and the number of dishes you have of this cuisine." - - cin >> dish >> num; - - restaurant[i].set_type_name(dish); - - restaurant[i].set_dish_num(num); - } - - for(int i=0;i<4;i++) - { - cout << client[i].get_type_name() << ":" << client[i].get_dish_num() << endl; - } - - return 0; - -} - - diff --git a/cuisine.h b/cuisine.h index 19ca64a..bae0b56 100644 --- a/cuisine.h +++ b/cuisine.h @@ -6,8 +6,10 @@ using namespace std; class cuisine{ private: - int num-of_dishes; + int num_of_dishes; std::string dish_type; + public: + cuisine(string="",int=0); void set_type_name(string dish); @@ -15,7 +17,7 @@ class cuisine{ std::string get_type_name(); - int get_dish_num(): + int get_dish_num(); };//class #endif diff --git a/cuisineIm.cpp b/cuisineIm.cpp index 0659aa7..a5d0e6a 100644 --- a/cuisineIm.cpp +++ b/cuisineIm.cpp @@ -2,22 +2,28 @@ #include #include"cuisine.h" using namespace std; -void set_type_name(std::string dish) +cuisine::cuisine(string dish, int num) { + std::string dish_type; + int num_of_dishes; +} +void cuisine::set_type_name(std::string dish) +{ + dish_type=dish; } -void set_dish_num(int num) +void cuisine::set_dish_num(int num) { num_of_dishes=num; } -std::string get_type_name(std::string dish) +std::string cuisine::get_type_name() { return dish_type; } -int get_dish_num(int num) +int cuisine::get_dish_num() { return num_of_dishes; } diff --git a/cuisinedriver.cpp b/cuisinedriver.cpp index 6d3b3ed..7c27736 100644 --- a/cuisinedriver.cpp +++ b/cuisinedriver.cpp @@ -6,27 +6,38 @@ using namespace std; int main() { - sting dish; + string dish; int num; vector restaurant; + cuisine order; for(int i=0;i<4;i++) { - cout << "Please enter the type of cuisine and the number of dishes you have of this cuisine." + cout << "Please enter the type of cuisine." << endl; + + cin >> dish; + + order.set_type_name(dish); + + cout << "Enter the number of dishes you have of this cuisine." > num; + + order.set_dish_num(num); - cin >> dish >> num; + restaurant.push_back(order); - restaurant[i].set_type_name(dish); + //restaurant[i].set_type_name(dish); - restaurant[i].set_dish_num(num); + //restaurant[i].set_dish_num(num); } for(int i=0;i<4;i++) { - cout << client[i].get_type_name() << ":" << client[i].get_dish_num() << endl; + cout << restaurant[i].get_type_name() << ":" << restaurant[i].get_dish_num() << endl; } return 0; diff --git a/implementation file b/implementation file deleted file mode 100644 index 0659aa7..0000000 --- a/implementation file +++ /dev/null @@ -1,24 +0,0 @@ -#include -#include -#include"cuisine.h" -using namespace std; -void set_type_name(std::string dish) -{ - dish_type=dish; -} - -void set_dish_num(int num) -{ - num_of_dishes=num; -} - -std::string get_type_name(std::string dish) -{ - return dish_type; -} - -int get_dish_num(int num) -{ - return num_of_dishes; -} - From ac2c57722116ec691f364c8522fa362ba1754f51 Mon Sep 17 00:00:00 2001 From: Shanice98 Date: Thu, 9 Feb 2017 16:41:31 -0400 Subject: [PATCH 08/10] cuisinedriver.cpp --- cuisine.h | 8 ++++---- cuisineIm.cpp | 8 ++++---- cuisinedriver.cpp | 35 +++++++++++++++++++++++++---------- 3 files changed, 33 insertions(+), 18 deletions(-) diff --git a/cuisine.h b/cuisine.h index bae0b56..81dadff 100644 --- a/cuisine.h +++ b/cuisine.h @@ -11,13 +11,13 @@ class cuisine{ public: cuisine(string="",int=0); - void set_type_name(string dish); + void settypeName(string dish); - void set_dish_num(int num); + void setdishNum(int num); - std::string get_type_name(); + std::string gettypeName(); - int get_dish_num(); + int getdishNum(); };//class #endif diff --git a/cuisineIm.cpp b/cuisineIm.cpp index a5d0e6a..10ab4a6 100644 --- a/cuisineIm.cpp +++ b/cuisineIm.cpp @@ -7,23 +7,23 @@ cuisine::cuisine(string dish, int num) std::string dish_type; int num_of_dishes; } -void cuisine::set_type_name(std::string dish) +void cuisine::settypeName(std::string dish) { dish_type=dish; } -void cuisine::set_dish_num(int num) +void cuisine::setdishNum(int num) { num_of_dishes=num; } -std::string cuisine::get_type_name() +std::string cuisine::gettypeName() { return dish_type; } -int cuisine::get_dish_num() +int cuisine::getdishNum() { return num_of_dishes; } diff --git a/cuisinedriver.cpp b/cuisinedriver.cpp index 7c27736..64f57ef 100644 --- a/cuisinedriver.cpp +++ b/cuisinedriver.cpp @@ -4,12 +4,25 @@ #include "cuisine.h" using namespace std; +int linearSearch(auto data, auto key) +{ + for (int i=0; i restaurant; cuisine order; @@ -20,25 +33,27 @@ int main() cin >> dish; - order.set_type_name(dish); + order.settypeName(dish); cout << "Enter the number of dishes you have of this cuisine." > num; - order.set_dish_num(num); + order.setdishNum(num); restaurant.push_back(order); - //restaurant[i].set_type_name(dish); - - //restaurant[i].set_dish_num(num); + } + cout <<" Enter an interger for a search key"; + cin >> search_key; - for(int i=0;i<4;i++) + cout << linearSearch(restaurant,search_key); + + /*for(int i=0;i<4;i++) { - cout << restaurant[i].get_type_name() << ":" << restaurant[i].get_dish_num() << endl; - } + cout << restaurant[i].gettypeName() << ":" << restaurant[i].getdishNum() << endl; + }*/ return 0; From 500107bd42708abad7f34dd452cafdb2d7004f47 Mon Sep 17 00:00:00 2001 From: Shanice98 Date: Fri, 10 Feb 2017 22:13:14 -0400 Subject: [PATCH 09/10] cuisinedriver.cpp --- cuisinedriver.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cuisinedriver.cpp b/cuisinedriver.cpp index 64f57ef..a3ceaf1 100644 --- a/cuisinedriver.cpp +++ b/cuisinedriver.cpp @@ -4,11 +4,12 @@ #include "cuisine.h" using namespace std; +int linearSearch(auto data, auto key);//prototype int linearSearch(auto data, auto key) { for (int i=0; i> num; @@ -45,10 +46,10 @@ int main() } - cout <<" Enter an interger for a search key"; + cout <<" Enter an interger for a search key"<> search_key; - cout << linearSearch(restaurant,search_key); + cout < Date: Fri, 10 Feb 2017 22:14:53 -0400 Subject: [PATCH 10/10] cuisinedriver.cpp --- cuisinedriver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cuisinedriver.cpp b/cuisinedriver.cpp index a3ceaf1..d1c9e3e 100644 --- a/cuisinedriver.cpp +++ b/cuisinedriver.cpp @@ -49,7 +49,7 @@ int main() cout <<" Enter an interger for a search key"<> search_key; - cout <