-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsuggestion.cpp
More file actions
47 lines (38 loc) · 1.32 KB
/
suggestion.cpp
File metadata and controls
47 lines (38 loc) · 1.32 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
#include "suggestion.h"
#include <iostream>
using namespace std;
// Base class constructor
SuggestionBase::SuggestionBase() {
suggestionID = "";
customerID = "";
}
// Derived class constructor
Suggestion::Suggestion() : SuggestionBase() {
suggestedItems = {};
}
// Method to generate suggestions for a customer
void Suggestion::generateSuggestions(const string& customerID) {
this->customerID = customerID;
// Example: Generate dynamic suggestions based on customer preferences
suggestedItems = {"Pizza", "Pasta", "Salad"}; // Replace with real logic
cout << "Generated suggestions for customer " << customerID << ": ";
for (const auto& item : suggestedItems) {
cout << item << " ";
}
cout << endl;
}
// Method to update suggestions based on new preferences
void Suggestion::updateSuggestions(const string& customerID, const vector<string>& newPreferences) {
this->customerID = customerID;
// Update the suggested items
suggestedItems = newPreferences;
cout << "Updated suggestions for customer " << customerID << ": ";
for (const auto& item : suggestedItems) {
cout << item << " ";
}
cout << endl;
}
// Getter for encapsulation
vector<string> Suggestion::getSuggestedItems() const {
return suggestedItems;
}