-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
65 lines (62 loc) · 2.11 KB
/
main.cpp
File metadata and controls
65 lines (62 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <istream>
#include <fstream>
#include <iostream>
#include "readcsv.h"
#include "redblacktree.h"
#include "hash.h"
using namespace std;
int main() {
BuildDataStructures dataStruct;
RedBlackTree tree;
tree = dataStruct.readFile("recipes.csv");
HashTable h = dataStruct.readHashFile("recipes.csv");
ifstream file("recipes.csv");
string line;
Recipe recipe;
//h.printHash();
string input;
vector<string> ingredients;
cout << "--------------------------------------" << endl;
cout << "Welcome to Build Your Own Plate (BYOP)" << endl;
cout << "--------------------------------------" << endl;
cout << "With any ingredients you can find in your home, we can offer you a wide range of recipes to use" << endl;
cout << "Please enter 5 ingredients you currently have:" << endl;
cout << "1.";
getline(cin, input);
ingredients.push_back(" " + input);
cout << "2.";
getline(cin, input);
ingredients.push_back(" " + input);
cout << "3.";
getline(cin, input);
ingredients.push_back(" " + input);
cout << "4.";
getline(cin, input);
ingredients.push_back(" " + input);
cout << "5.";
getline(cin, input);
ingredients.push_back(" " + input);
cout << "Here are a list of recipes using the current ingredients you have:" << endl;
string k = "Yes";
while (k == "Yes") {
//tree.printRecipe(ingredients);
h.matchIngredients(ingredients);
cout << "Enter a recipe you would like to make from the list: " << endl;
getline(cin, input);
istringstream iss(input);
//tree.printInfo(input, ingredients);
h.printInfo(ingredients, input);
cout << "Would you like to go back to the recipe list? (Yes or No)" << endl;
getline(cin, k);
if (k == "No" || k == "no")
break;
}
cout << "-----------------------" << endl;
cout << "Thank for playing BYOP!" << endl;
cout << "I hope you enjoyed and feasted!" << endl;
cout << "-------------------------------" << endl;
}