-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSkillsetJobMatchingExpertSystem.cpp
More file actions
52 lines (47 loc) · 1.31 KB
/
Copy pathSkillsetJobMatchingExpertSystem.cpp
File metadata and controls
52 lines (47 loc) · 1.31 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
#include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
map<string, set<string>> jobs;
void initializeJobs() {
jobs["Software Developer"] = {"java", "data structures", "algorithms"};
jobs["Web Developer"] = {"html", "css", "javascript"};
jobs["Data Analyst"] = {"python", "sql", "statistics"};
}
vector<string> recommend(const set<string>& skills) {
vector<string> result;
for (const auto& entry : jobs) {
if (includes(skills.begin(), skills.end(),
entry.second.begin(), entry.second.end())) {
result.push_back(entry.first);
}
}
return result;
}
string formatVector(const vector<string>& items) {
string result = "[";
for (size_t i = 0; i < items.size(); ++i) {
result += items[i];
if (i + 1 < items.size()) result += ", ";
}
result += "]";
return result;
}
int main() {
initializeJobs();
set<string> candidateSkills = {"java", "data structures", "algorithms", "sql"};
cout << "Recommended jobs: " << formatVector(recommend(candidateSkills)) << '\n';
return 0;
}